diff options
| author | eMerzh <brice@bmaron.net> | 2020-04-08 14:00:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-08 14:00:24 +0200 |
| commit | 03251c090e64082acfe301e844610f64c8f8fdef (patch) | |
| tree | 8e642b7c10fdcbd0f5a4a18f5648b6f8b6e32922 /ihatemoney/templates | |
| parent | 4b79efe18a9952268d65b98813e3929a8179ed2c (diff) | |
| download | ihatemoney-mirror-03251c090e64082acfe301e844610f64c8f8fdef.zip ihatemoney-mirror-03251c090e64082acfe301e844610f64c8f8fdef.tar.gz ihatemoney-mirror-03251c090e64082acfe301e844610f64c8f8fdef.tar.bz2 | |
merge settings and import to avoid clutter (#550)
Diffstat (limited to 'ihatemoney/templates')
| -rw-r--r-- | ihatemoney/templates/edit_project.html | 39 | ||||
| -rw-r--r-- | ihatemoney/templates/layout.html | 1 | ||||
| -rw-r--r-- | ihatemoney/templates/upload_json.html | 10 |
3 files changed, 32 insertions, 18 deletions
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("<a style='color:red; ' href='{{ url_for('.delete_project') }}' >{{_("you sure?")}}</a>"); }); + + $('.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 %} -<h2>{{ _("Edit project") }}</h2> -<p> +<div class="container edit-project"> + + <h2>{{ _("Edit project") }}</h2> <form class="form-horizontal" method="post"> - {{ forms.edit_project(edit_form) }} + {{ forms.edit_project(edit_form) }} + </form> + + + <h2>{{ _("Import JSON") }}</h2> + <form class="form-horizontal" method="post" enctype="multipart/form-data"> + {{ import_form.hidden_tag() }} + + <div class="custom-file"> + <div class="form-group"> + {{ import_form.file(class="custom-file-input") }} + <small class="form-text text-muted"> + {{ import_form.file.description }} + </small> + </div> + <label class="custom-file-label" for="customFile">{{ _('Choose file') }}</label> + </div> + + <div class="actions"> + {{ import_form.submit(class="btn btn-primary") }} + </div> </form> -</p> -<h2>{{ _("Download project's data") }}</h2> -<p> + <h2>{{ _("Download project's data") }}</h2> <div class="list-group download-project"> <div class="list-group-item list-group-item-action"> <h5 class="d-flex w-100 justify-content-between"> @@ -51,5 +76,5 @@ <p class="mb-1 text-muted">{{ _('Download the list of transactions needed to settle the current bills.') }}</p> </div> </div> -</p> +</div> {% 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 @@ <li class="nav-item{% if current_view == 'settle_bill' %} active{% endif %}"><a class="nav-link" href="{{ url_for("main.settle_bill") }}">{{ _("Settle") }}</a></li> <li class="nav-item{% if current_view == 'statistics' %} active{% endif %}"><a class="nav-link" href="{{ url_for("main.statistics") }}">{{ _("Statistics") }}</a></li> <li class="nav-item{% if current_view == 'edit_project' %} active{% endif %}"><a class="nav-link" href="{{ url_for("main.edit_project") }}">{{ _("Settings") }}</a></li> - <li class="nav-item{% if current_view == 'upload_json' %} active{% endif %}"><a class="nav-link" href="{{ url_for("main.upload_json") }}">{{ _("Import") }}</a></li> {% endblock %} {% endif %} </ul> 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 %}
- <h2>{{ _("Import JSON") }}</h2>
- <p>
- <form class="form-horizontal" method="post" enctype="multipart/form-data">
- {{ forms.upload_json(form) }}
- </form>
- </p>
-{% endblock %}
|
