aboutsummaryrefslogtreecommitdiff
path: root/budget/templates/layout.html
blob: ccf958f5042be1e05b03dc8e1e33059eb43b6f0f (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{% import "forms.html" as forms %}
<!DOCTYPE html>
<html>
<head>
    <title>{{ _("Account manager") }}{% block title %}{% endblock %}</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <link rel=stylesheet type=text/css href="{{ url_for("static", filename='css/main.css') }}">
    <script src="{{ url_for("static", filename="js/jquery-1.7.2.min.js") }}"></script>
    <script src="{{ url_for("static", filename="js/ihatemoney.js") }}"></script>
    <script src="{{ url_for("static", filename="js/bootstrap.min.js") }}"></script>
    <script src="{{ url_for("static", filename="js/bootstrap-datepicker.js") }}"></script>
    {% block head %}{% endblock %}
    <script type="text/javascript" charset="utf-8">
        $(document).ready(function(){
            var left = window.innerWidth/2-$('.flash').width()/2;
            $(".flash").css({ "left": left+"px", "top":"45px" });
            setTimeout(function(){
                $(".flash").fadeOut("slow", function () {
                    $(".flash").remove();
                });
            }, 4000);

            $('.datepicker').datepicker({
                format: 'yyyy-mm-dd',
                weekStart: 1,
                autoclose: true,
                language: '{{ g.lang }}'
            });

            $('.dropdown-toggle').dropdown();

            {% block js %}{% endblock %}
        });
    </script>
</head>
<body>

<div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container-fluid">
            <h1><a class="brand" href="{{ url_for(".home") }}">#! money?</a></h1>
            {% if g.project %}
            <ul class="nav primary-nav">
                {% block navbar %}
                <li class="nav-item{% if current_view == 'list_bills' %} active{% endif %}"><a class="nav-link" href="{{ url_for(".list_bills") }}">{{ _("Bills") }}</a></li>
                <li class="nav-item{% if current_view == 'settle_bill' %} active{% endif %}"><a class="nav-link" href="{{ url_for(".settle_bill") }}">{{ _("Settle") }}</a></li>
                {% endblock %}
            </ul>
            {% endif %}
            <ul class="nav pull-right secondary-nav">
            {% if g.project %}
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><strong>{{ g.project.name }}</strong> {{ _("options") }} <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li><a href="{{ url_for(".edit_project") }}">{{ _("Project settings") }}</a></li>
                        <li class="divider"></li>
                        {% for id, name in session['projects'] %}
                        {% if id != g.project.id %}
                        <li><a href="{{ url_for(".list_bills", project_id=id) }}">{{ _("switch to") }} {{ name }}</a></li>
                        {% endif %}
                        {% endfor %}
                        <li><a href="{{ url_for(".create_project") }}">{{ _("Start a new project") }}</a></li>
                        <li class="divider"></li>
                        <li><a href="{{ url_for(".exit") }}">{{ _("Logout") }}</a></li>
                    </ul>
                </li>
            {% endif %}
                <li{% if g.lang == "fr" %} class="active"{% endif %}><a href="{{ url_for(".change_lang", lang="fr") }}">fr</a></li>
                <li{% if g.lang == "en" %} class="active"{% endif %}><a href="{{ url_for(".change_lang", lang="en") }}">en</a></li>
            </ul>
        </div>
    </div>
</div>

{% block header %}{% endblock %}

{% block body %}
<div class="container-fluid">
    {% block sidebar %}{% endblock %}
    <div class="content">
    {% block content %}{% endblock %}
    </div>
</div>
{% endblock %}

{% for message in get_flashed_messages() %}
<div class="flash alert alert-success"><p>{{ message }}</p></div>
{% endfor %}

{% block footer %}
<div id="footer">
    <p><a href="https://github.com/spiral-project/ihatemoney">{{ _("This is a free software") }}</a>, {{ _("you can contribute and improve it!") }}</p>
</div>
{% endblock %}

</body>
</html>