aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/templates/edit_project.html
blob: 478b7b422f84b5f6ac843bbbc8871351eb9cb6e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{% extends "layout.html" %}

{% block js %}
    $('#delete-project').click(function ()
    {
        $(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 %}
<div class="container edit-project">

    <h2>{{ _("Edit project") }}</h2>
    <form class="form-horizontal" method="post">
        {{ 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>

    <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">
                <span class="mb-1">{{ _('Bill items') }}</span>
                <span>
                    <a href="{{ url_for('.export_project', file='bills', format='json') }}" download class="badge badge-secondary">
                        <i class="icon before-text">{{ static_include("images/file-alt.svg") | safe }}</i>
                        JSON
                    </a>
                    <a href="{{ url_for('.export_project', file='bills', format='csv') }}" download class="badge badge-secondary">
                        <i class="icon before-text">{{ static_include("images/file-csv-solid.svg") | safe }}</i>
                        CSV
                    </a>
                </span>
            </h5>
        <p class="mb-1 text-muted">{{ _('Download the list of bills with owner, amount, reason,... ') }}</p>
        </div>
        <div class="list-group-item list-group-item-action">
            <h5 class="d-flex w-100 justify-content-between">
                <span class="mb-1">{{ _('Settle plans') }}</span>
                <span>
                    <a href="{{ url_for('.export_project', file='transactions', format='json') }}" download class="badge badge-secondary">
                        <i class="icon before-text">{{ static_include("images/file-alt.svg") | safe }}</i>
                        JSON
                    </a>
                    <a href="{{ url_for('.export_project', file='transactions', format='csv') }}" download class="badge badge-secondary">
                        <i class="icon before-text">{{ static_include("images/file-csv-solid.svg") | safe }}</i>
                        CSV
                    </a>
                </span>
            </h5>
            <p class="mb-1 text-muted">{{ _('Download the list of transactions needed to settle the current bills.') }}</p>
        </div>
    </div>
</div>
{% endblock %}