Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
esmail committed Feb 27, 2017
2 parents 1f5fb6e + 6ffa12c commit a46eacc
Show file tree
Hide file tree
Showing 41 changed files with 849 additions and 203 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jsapp/js/refactored.es6
whoosh_index
tmp
staticfiles
.cache
.sass-cache
webpack-stats.json
sensitive_data.json

test/compiled/*
1 change: 0 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
],
"dependencies": {
"jquery": "~2.1.0",
"sinon": "http://sinonjs.org/releases/sinon-1.10.3.js",
"underscore": "~1.6.0",
"backbone": "~1.1.2",
"requirejs": "~2.1.11",
Expand Down
92 changes: 46 additions & 46 deletions dependencies/pip/dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,86 +7,86 @@
-e git+https://github.com/dimagi/django-digest@0eb1c921329dd187c343b61acfbec4e98450136e#egg=django_digest
-e git+https://github.com/kobotoolbox/formpack.git@1b5e8bab8c1327db6b7e37ad578359f3a97124d3#egg=formpack
-e git+https://github.com/kobotoolbox/pyxform.git@6dfff060fc2ad6c575c6a7d953c381d2180e6833#egg=pyxform
amqp==2.1.4
amqp==1.4.9
anyjson==0.3.3
appdirs==1.4.0 # via setuptools
begins==0.9
billiard==3.5.0.2
boto==2.45.0
celery==4.0.2
cffi==1.9.1 # via cryptography
cryptography==1.7.2 # via paramiko, pyopenssl
cssselect==1.0.1 # via pyquery
billiard==3.3.0.23
boto==2.40.0
celery==3.1.23
cffi==1.8.3 # via cryptography
cryptography==1.5.2 # via paramiko, pyopenssl
cssselect==0.9.2 # via pyquery
cyordereddict==1.0.0
dj-database-url==0.4.2
dj-database-url==0.4.1
dj-static==0.0.6
django-braces==1.11.0
django-debug-toolbar==1.6
django-extensions==1.7.6
django-braces==1.8.1
django-debug-toolbar==1.4
django-extensions==1.6.7
django-haystack==2.6.0
django-jsonbfield==0.1.0
django-loginas==0.2.3
django-markitup==3.0.0
django-mptt==0.8.7
django-oauth-toolkit==0.11.0
django-oauth-toolkit==0.10.0
django-registration-redux==1.3
django-reversion==2.0.8
django-ses==0.8.1
django-reversion==1.10.2
django-ses==0.7.1
django-taggit==0.22.0
django-toolbelt==0.0.1
django-webpack-loader==0.4.1
django==1.8.17
djangorestframework==3.5.4
docutils==0.13.1 # via statistics
django-webpack-loader==0.3.0
django==1.8.13
djangorestframework==3.3.3
docutils==0.12 # via statistics
drf-extensions==0.3.1
enum34==1.1.6 # via cryptography
fabric==1.13.1
Fabric==1.13.1
funcsigs==1.0.2 # via begins
functools32==3.2.3.post2 # via jsonschema
gunicorn==19.6.0
idna==2.2 # via cryptography
ipaddress==1.0.18 # via cryptography
jinja2==2.9.5 # via pyexcelerate
gunicorn==19.4.5
idna==2.1 # via cryptography
ipaddress==1.0.17 # via cryptography
jinja2==2.8 # via pyexcelerate
jsonfield==1.0.3
jsonschema==2.5.1
kombu==4.0.2
kombu==3.0.35
lxml==2.3.4
markdown==2.6.8
markdown==2.6.6
markupsafe==0.23 # via jinja2
ndg-httpsclient==0.4.2
oauthlib==1.1.2
oauthlib==1.0.3
packaging==16.8 # via setuptools
paramiko==2.1.1 # via fabric
paramiko==2.1.2 # via fabric
path.py==8.1.2
psycopg2==2.6.2
py==1.4.32 # via pytest
pyasn1==0.2.2
pycparser==2.17 # via cffi
psycopg2==2.6.1
py==1.4.31 # via pytest
pyasn1==0.1.9
pycparser==2.14 # via cffi
PyExcelerate==0.6.7
pygments==2.2.0
pymongo==3.4.0
pyopenssl==16.2.0
pygments==2.1.3
pymongo==3.3.0
pyopenssl==16.1.0
pyparsing==2.1.10 # via packaging
pyquery==1.2.11
pytest-django==3.1.2
pytest==3.0.6 # via pytest-django
pytest-django==3.0.0
pytest==3.0.3 # via pytest-django
python-dateutil==2.6.0
python-digest==1.7
pytz==2016.10
requests==2.13.0
pytz==2016.4
requests==2.10.0
shortuuid==0.4.3
six==1.10.0
sqlparse==0.2.2
sqlparse==0.1.19
static3==0.7.0
statistics==1.0.3.5
tabulate==0.7.7
tabulate==0.7.5
unicodecsv==0.14.1
uwsgi==2.0.14
vine==1.1.3 # via amqp
werkzeug==0.11.15
whitenoise==3.3.0
uwsgi==2.0.13
Werkzeug==0.11.15
whitenoise==3.0
Whoosh==2.7.4
xlrd==0.8.0
xlwt==1.2.0
xlwt==1.0.0

# The following packages are considered to be unsafe in a requirements file:
# setuptools # via cryptography, pytest
# setuptools # via cryptography
3 changes: 2 additions & 1 deletion dependencies/pip/external_services.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ django-markitup==3.0.0
django-mptt==0.8.7
django-oauth-toolkit==0.10.0
django-registration-redux==1.3
django-reversion==2.0.8
django-reversion==1.10.2
django-ses==0.7.1
django-taggit==0.22.0
django-toolbelt==0.0.1
django-webpack-loader==0.3.0
django==1.8.13
djangorestframework==3.3.3
docutils==0.12 # via statistics
drf-extensions==0.3.1
enum34==1.1.6 # via cryptography
funcsigs==1.0.2 # via begins
functools32==3.2.3.post2 # via jsonschema
Expand Down
13 changes: 7 additions & 6 deletions dependencies/pip/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ django-registration-redux==1.3 # DO NOT UPGRADE TO 1.4 WITHOUT TESTING!
django-ses
django-toolbelt
django-webpack-loader
django_haystack
django-haystack
django-loginas==0.2.3
django_markitup
django_mptt
django_reversion
django_taggit
django-markitup
django-mptt
django-reversion
django-taggit
djangorestframework
drf-extensions
gunicorn
jsonfield
kombu
Expand All @@ -47,7 +48,7 @@ oauthlib
psycopg2
pymongo
pytest-django
python_dateutil
python-dateutil
pytz
requests
shortuuid
Expand Down
3 changes: 2 additions & 1 deletion dependencies/pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ django-markitup==3.0.0
django-mptt==0.8.7
django-oauth-toolkit==0.10.0
django-registration-redux==1.3
django-reversion==2.0.8
django-reversion==1.10.2
django-ses==0.7.1
django-taggit==0.22.0
django-toolbelt==0.0.1
django-webpack-loader==0.3.0
django==1.8.13
djangorestframework==3.3.3
docutils==0.12 # via statistics
drf-extensions==0.3.1
enum34==1.1.6 # via cryptography
funcsigs==1.0.2 # via begins
functools32==3.2.3.post2 # via jsonschema
Expand Down
6 changes: 6 additions & 0 deletions jsapp/fonts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
*.ttf
*.woff
*.woff2
*.scss
*.css
*.md
*.ijmap
*.otf
codepoints
2 changes: 1 addition & 1 deletion jsapp/js/dataInterface.es6
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ var dataInterface;
var method = 'POST';
if (redeployment) {
method = 'PATCH';
data.version = asset.version_id;
data.version_id = asset.version_id;
}
return $ajax({
method: method,
Expand Down
17 changes: 17 additions & 0 deletions jsapp/js/editorMixins/editableForm.es6
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ export default assign({
saveButtonText,
} = this.buttonStates();

let translations = this.state.translations || [];

return (
<bem.FormBuilderHeader>
<bem.FormBuilderHeader__row m={['first', allButtonsDisabled ? 'disabled' : null]}>
Expand Down Expand Up @@ -550,6 +552,21 @@ export default assign({
: null }

</bem.FormBuilderHeader__cell>
<bem.FormBuilderHeader__cell m="translations">
{
(translations.length < 2) ?
<p>
{translations[0]}
</p>
:
<p>
{translations[0]}
<small>
{translations[1]}
</small>
</p>
}
</bem.FormBuilderHeader__cell>
<bem.FormBuilderHeader__cell m={'spacer'} />
<bem.FormBuilderHeader__cell m={'library-toggle'} >
<bem.FormBuilderHeader__button m={['showLibrary']}
Expand Down
9 changes: 7 additions & 2 deletions jsapp/js/editorMixins/existingForm.es6
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ export default {
componentDidMount () {
let uid = this.props.params.assetid;
stores.allAssets.whenLoaded(uid, (asset) => {
let translations = (asset.content && asset.content.translations
&& asset.content.translations.slice(0)) || [];
this.launchAppForSurveyContent(asset.content, {
name: asset.name,
translations: translations,
settings__style: asset.settings__style,
asset_uid: asset.uid,
asset_type: asset.asset_type,
Expand All @@ -32,9 +35,11 @@ export default {
if (isLibrary(this.context.router)) {
routeName = 'library';
} else {
if (stores.history.previousRoute == 'form-landing') {
if (stores.history.currentRoute === 'form-edit') {
routeName = 'form-landing';
params = {assetid: this.props.params.assetid};
params = {
assetid: this.props.params.assetid,
};
}
}

Expand Down
59 changes: 38 additions & 21 deletions jsapp/js/mixins.es6
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,19 @@ var dmix = {
},
survey: {
innerRender: function () {
var docTitle = this.state.name || t('Untitled');
let docTitle = this.state.name || t('Untitled');
let formList = this.makeHref('forms');
return (
<DocumentTitle title={`${docTitle} | KoboToolbox`}>
<bem.FormView m='scrollable'>
<bem.FormView__wrapper m='form'>
<bem.FormView__row>
<bem.FormView__cell m='overview'>
<bem.FormView__label m='title'>
<bem.FormView__link
m='close'
href={formList}
/>
{t('Form Overview')}
</bem.FormView__label>
{this.renderDeployments()}
Expand Down Expand Up @@ -1335,39 +1340,51 @@ mixins.clickAssets = {
delete: function(uid/*, evt*/){
let asset = stores.selectedAsset.asset;
let dialog = alertify.dialog('confirm');
let opts = {
title: t('Delete Project'),
message: `${t('You are about to permanently delete this form.')}
let deployed = asset.has_deployment;
let msg, onshow;
let onok = (evt, val) => {
actions.resources.deleteAsset({uid: uid}, {
onComplete: ()=> {
this.refreshSearch && this.refreshSearch();
}
});
};

if (!deployed) {
msg = t('You are about to permanently delete this draft.');
} else {
msg = `
${t('You are about to permanently delete this form.')}
<label class="alertify-toggle"><input type="checkbox"/> ${t('All data gathered for this form will be deleted.')}</label>
<label class="alertify-toggle"><input type="checkbox"/> ${t('All questions created for this form will be deleted.')}</label>
<label class="alertify-toggle"><input type="checkbox"/> ${t('The form associated with this project will be deleted.')}</label>
<label class="alertify-toggle alertify-toggle-important"><input type="checkbox" /> ${t('I understand that if I delete this project I will not be able to recover it.')}</label> `,
labels: {ok: t('Delete'), cancel: t('Cancel')},
onshow: (evt) => {
<label class="alertify-toggle alertify-toggle-important"><input type="checkbox" /> ${t('I understand that if I delete this project I will not be able to recover it.')}</label>
`;
onshow = (evt) => {
let ok_button = dialog.elements.buttons.primary.firstChild;
let $els = $('.alertify-toggle input');
ok_button.disabled = true;
var $els = $('.alertify-toggle input');
$($els).change(function() {
$els.change(function () {
ok_button.disabled = false;
$($els).each(function( index ) {
$els.each(function ( index ) {
if (!$(this).prop('checked')) {
ok_button.disabled = true;
}
}
});
});
$()
},
onok: (evt, val) => {
actions.resources.deleteAsset({uid: uid}, {
onComplete: ()=> {
this.refreshSearch && this.refreshSearch();
$('.alertify-toggle input').prop("checked", false);
}
});
};
}
let opts = {
title: t('Delete Project'),
message: msg,
labels: {
ok: t('Delete'),
cancel: t('Cancel')
},
onshow: onshow,
onok: onok,
oncancel: () => {
dialog.destroy();
$('.alertify-toggle input').prop("checked", false);
}
};
dialog.set(opts).show();
Expand Down
Loading

0 comments on commit a46eacc

Please sign in to comment.