aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/templates/layout.html
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2017-07-07 00:06:56 +0200
committerGitHub <noreply@github.com>2017-07-07 00:06:56 +0200
commit3a4282fd75e3b3317b2b08b4aa2e6ac154310e73 (patch)
tree9470c907ba1f884246af87d26d55c3aaac6d6dc5 /ihatemoney/templates/layout.html
parent0e374cd5e0ef5a9be67084365f91de2ab84f636c (diff)
downloadihatemoney-mirror-3a4282fd75e3b3317b2b08b4aa2e6ac154310e73.zip
ihatemoney-mirror-3a4282fd75e3b3317b2b08b4aa2e6ac154310e73.tar.gz
ihatemoney-mirror-3a4282fd75e3b3317b2b08b4aa2e6ac154310e73.tar.bz2
Absolute imports & some other improvements (#243)
* Use absolute imports and rename package to ihatemoney * Add a ihatemoney command * Factorize application creation logic * Refactor the tests * Update the wsgi.py module with the new create_app() function * Fix some styling thanks to Flake8. * Automate Flake8 check in the CI.
Diffstat (limited to 'ihatemoney/templates/layout.html')
-rw-r--r--ihatemoney/templates/layout.html98
1 files changed, 98 insertions, 0 deletions
diff --git a/ihatemoney/templates/layout.html b/ihatemoney/templates/layout.html
new file mode 100644
index 0000000..6ecff41
--- /dev/null
+++ b/ihatemoney/templates/layout.html
@@ -0,0 +1,98 @@
+{% 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">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel=stylesheet type=text/css href="{{ url_for("static", filename='css/main.css') }}">
+ <script src="{{ url_for("static", filename="js/jquery-3.1.1.min.js") }}"></script>
+ <script src="{{ url_for("static", filename="js/ihatemoney.js") }}"></script>
+ <script src="{{ url_for("static", filename="js/tether.min.js") }}"></script>
+ <script src="{{ url_for("static", filename="js/bootstrap.min.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":"0.6rem" });
+ 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="container">
+ <nav class="navbar navbar-toggleable-sm fixed-top navbar-inverse bg-inverse">
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggler" aria-controls="navbarToggler" aria-expanded="false" aria-label="Toggle navigation">
+ <span class="navbar-toggler-icon"></span>
+ </button>
+ <div class="collapse navbar-collapse" id="navbarToggler">
+ <h1><a class="navbar-brand" href="{{ url_for(".home") }}">#! money?</a></h1>
+ <ul class="navbar-nav ml-auto mr-auto">
+ {% if g.project %}
+ {% 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 %}
+ {% endif %}
+ </ul>
+ <ul class="navbar-nav secondary-nav">
+ {% if g.project %}
+ <li class="nav-item dropdown">
+ <a href="#" class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><strong>{{ g.project.name }}</strong> {{ _("options") }} <b class="caret"></b></a>
+ <ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
+ <li><a class="dropdown-item" href="{{ url_for(".edit_project") }}">{{ _("Project settings") }}</a></li>
+ <li class="dropdown-divider"></li>
+ {% for id, name in session['projects'] %}
+ {% if id != g.project.id %}
+ <li><a class="dropdown-item" href="{{ url_for(".list_bills", project_id=id) }}">{{ _("switch to") }} {{ name }}</a></li>
+ {% endif %}
+ {% endfor %}
+ <li><a class="dropdown-item" href="{{ url_for(".create_project") }}">{{ _("Start a new project") }}</a></li>
+ <li class="dropdown-divider"></li>
+ <li><a class="dropdown-item" href="{{ url_for(".exit") }}">{{ _("Logout") }}</a></li>
+ </ul>
+ </li>
+ {% endif %}
+ <li class="nav-item{% if g.lang == "fr" %} active{% endif %}"><a class="nav-link" href="{{ url_for(".change_lang", lang="fr") }}">fr</a></li>
+ <li class="nav-item{% if g.lang == "en" %} active{% endif %}"><a class="nav-link" href="{{ url_for(".change_lang", lang="en") }}">en</a></li>
+ </ul>
+ </div>
+ </nav>
+ </div>
+
+<div class="container-fluid">
+{% block body %}
+ {% block sidebar %}{% endblock %}
+ <main class="content offset-1 col-10">
+ {% block content %}{% endblock %}
+ </main>
+</div>
+{% endblock %}
+
+{% for message in get_flashed_messages() %}
+<div class="flash alert alert-success">{{ message }}</div>
+{% endfor %}
+
+{% block footer %}
+<footer>
+ <p><a href="https://github.com/spiral-project/ihatemoney">{{ _("This is a free software") }}</a>, {{ _("you can contribute and improve it!") }}</p>
+</footer>
+{% endblock %}
+
+</body>
+</html>