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 ++++++++++++++++++++++++++++------ ihatemoney/templates/layout.html | 1 - ihatemoney/templates/upload_json.html | 10 --------- 3 files changed, 32 insertions(+), 18 deletions(-) delete mode 100644 ihatemoney/templates/upload_json.html (limited to 'ihatemoney/templates') 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 %} diff --git a/ihatemoney/templates/layout.html b/ihatemoney/templates/layout.html index dc3d32f..8609779 100644 --- a/ihatemoney/templates/layout.html +++ b/ihatemoney/templates/layout.html @@ -46,7 +46,6 @@ - {% endblock %} {% endif %} diff --git a/ihatemoney/templates/upload_json.html b/ihatemoney/templates/upload_json.html deleted file mode 100644 index 64aca0f..0000000 --- a/ihatemoney/templates/upload_json.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "layout.html" %} - -{% block content %} -

{{ _("Import JSON") }}

-

-

- {{ forms.upload_json(form) }} -
-

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