From 03251c090e64082acfe301e844610f64c8f8fdef Mon Sep 17 00:00:00 2001 From: eMerzh Date: Wed, 8 Apr 2020 14:00:24 +0200 Subject: merge settings and import to avoid clutter (#550) --- ihatemoney/templates/edit_project.html | 39 ++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'ihatemoney/templates/edit_project.html') diff --git a/ihatemoney/templates/edit_project.html b/ihatemoney/templates/edit_project.html index dcbbbc8..b7861c5 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 %} -

{{ _("Edit project") }}

-

+

+ +

{{ _("Edit project") }}

- {{ forms.edit_project(edit_form) }} + {{ forms.edit_project(edit_form) }} +
+ + +

{{ _("Import JSON") }}

+
+ {{ import_form.hidden_tag() }} + +
+
+ {{ import_form.file(class="custom-file-input") }} + + {{ import_form.file.description }} + +
+ +
+ +
+ {{ import_form.submit(class="btn btn-primary") }} +
-

-

{{ _("Download project's data") }}

-

+

{{ _("Download project's data") }}

@@ -51,5 +76,5 @@

{{ _('Download the list of transactions needed to settle the current bills.') }}

-

+
{% endblock %} -- cgit v1.1