diff --git a/ihatemoney/forms.py b/ihatemoney/forms.py index 88afd296..62c21444 100644 --- a/ihatemoney/forms.py +++ b/ihatemoney/forms.py @@ -114,8 +114,11 @@ class EditProjectForm(FlaskForm): class UploadForm(FlaskForm): file = FileField( - "JSON", validators=[FileRequired(), FileAllowed(["json", "JSON"], "JSON only!")] + "JSON", + validators=[FileRequired(), FileAllowed(["json", "JSON"], "JSON only!")], + description=_("Import previously exported JSON file"), ) + submit = SubmitField(_("Import")) class ProjectForm(EditProjectForm): diff --git a/ihatemoney/static/css/main.css b/ihatemoney/static/css/main.css index a646b175..75e54983 100644 --- a/ihatemoney/static/css/main.css +++ b/ihatemoney/static/css/main.css @@ -180,7 +180,7 @@ footer { padding: 45px 50px; } -@media (min-width: 768px) { +@media (min-width: 1024px) { footer { padding-left: calc(25% + 50px); } @@ -320,13 +320,15 @@ footer .footer-left { background: url("../images/see.png") no-repeat right; } -#bill_table, #monthly_stats { +#bill_table, +#monthly_stats { margin-top: 30px; margin-bottom: 30px; } @media (min-width: 768px) { - .split_bills, #table_overflow.statistics { + .split_bills, + #table_overflow.statistics { /* The table is shifted to left, so add the spacer width on the right to match */ width: calc(100% + 15px); } @@ -516,3 +518,13 @@ footer .icon svg { text-align: right; width: 200px; } + +/* edit settings */ + +.edit-project form { + margin-top: 1em; + margin-bottom: 3em; +} +.edit-project .custom-file { + margin-bottom: 2em; +} diff --git a/ihatemoney/templates/edit_project.html b/ihatemoney/templates/edit_project.html index dcbbbc86..b7861c51 100644 --- a/ihatemoney/templates/edit_project.html +++ b/ihatemoney/templates/edit_project.html @@ -5,18 +5,43 @@ { $(this).html("{{_("you sure?")}}"); }); + + $('.custom-file-input').on('change', function(event) { + var filename = [].slice.call(this.files).map(function (file) { return file.name}).join(',') + var $labelElement = $(this).parents('.custom-file').find('.custom-file-label') + $labelElement.text(filename) + }) {% endblock %} {% block content %} -
-
- ++
{{ _('Download the list of transactions needed to settle the current bills.') }}
-
- -{% endblock %} diff --git a/ihatemoney/web.py b/ihatemoney/web.py index 1b80ab62..feb9d8eb 100644 --- a/ihatemoney/web.py +++ b/ihatemoney/web.py @@ -382,36 +382,36 @@ def reset_password(): @main.route("/