aboutsummaryrefslogtreecommitdiff
path: root/budget/templates/layout.html
blob: 2b7c11ef6f21cdf32258f548d90b3b35cc09827c (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
{% import "forms.html" as forms %}
<!DOCTYPE html>
<html>
<head>
    <title>Account manager</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <link rel=stylesheet type=text/css href="{{ url_for("static", filename='main.css') }}">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    <script type="text/javascript" charset="utf-8">
        $(document).ready(function(){
            setTimeout(function(){
                $(".flash").fadeOut("slow", function () {
                    $(".flash").remove();
                });
            }, 4000);
            $("body").bind("click", function(e) {
                $("ul.menu-dropdown").hide();
                $('a.menu').parent("li").removeClass("open").children("ul.menu-dropdown").hide();
            });

            $("a.menu").click(function(e) {
                var $target = $(this);
                var $parent = $target.parent("li");
                var $siblings = $target.siblings("ul.menu-dropdown");
                var $parentSiblings = $parent.siblings("li");
                if ($parent.hasClass("open")) {
                    $parent.removeClass("open");
                    $siblings.hide();
                } else {
                    $parent.addClass("open");
                    $siblings.show();
                }
                $parentSiblings.children("ul.menu-dropdown").hide();
                $parentSiblings.removeClass("open");
                return false;
            });

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

<div class="topbar">
    <h3><a class="logo" href="{% if g.project %}{{ url_for(".list_bills") }}{% endif %}">#! money?</a></h3>
    {% if g.project %}
    <ul>
      <li class="active"><a href="">Bills</a></li>
      <li><a href="">Archives</a></li>
    </ul>
    <ul class="nav secondary-nav">
      <li class="menu">
      <a href="#" class="menu"><strong>{{ g.project.name }}</strong> options</a>
        <ul class="menu-dropdown" style="display: none; ">
            <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>
    </ul>
    {% endif %}
</div>
{% block header %}{% endblock %}
{% block container %}
<div class="container-fluid" style="margin-top: 40px">
    <div class="sidebar">{% block sidebar %}{% endblock %}</div>
    <div class="content">
    {% for message in get_flashed_messages() %}
        <div class="flash alert-message info"><p>{{ message }}</p></div>
    {% endfor %}
    {% block content %}
    {% endblock %}
    </div>
</div>
{% endblock %}
{% block footer %}
<div id="footer">
    <p><a href="https://github.com/ametaireau/budget-manager">This is a free software</a>, you can contribute and improve it!</p>
</div>
{% endblock %}

</body>
</html>