ihatemoney/ihatemoney/templates/layout.html
Brice Maron 92ce7d4d48 Improve usability specially for small screen
- add buttons class to fix alignments
- add responsive info to big tables
- use visibility instead of display to avoid jumping rows
- reorganize menu in responsive
2019-07-25 13:26:46 +02:00

108 lines
5 KiB
HTML

{% 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(){
setTimeout(function(){
$(".flash").fadeOut("slow", function () {
$(".flash").remove();
});
}, 4000);
$('.dropdown-toggle').dropdown();
{% block js %}{% endblock %}
});
</script>
</head>
<body>
<div class="container">
<nav class="navbar navbar-expand-sm fixed-top navbar-dark bg-dark">
<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>
<h1><a class="navbar-brand" href="{{ url_for("main.home") }}">#! money?</a></h1>
{% if g.project %}<strong class="d-block d-sm-none text-white">{{ g.project.name }}</strong>{% endif %}
<div class="collapse navbar-collapse" id="navbarToggler">
<ul class="navbar-nav ml-auto mr-auto">
{% if g.project %}
<li class="nav-item">
</li>
{% block navbar %}
<li class="nav-item{% if current_view == 'list_bills' %} active{% endif %}"><a class="nav-link" href="{{ url_for("main.list_bills") }}">{{ _("Bills") }}</a></li>
<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>
{% endblock %}
{% endif %}
{% 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 class="d-none d-sm-inline">{{ 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("main.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("main.list_bills", project_id=id) }}">{{ _("switch to") }} {{ name }}</a></li>
{% endif %}
{% endfor %}
<li><a class="dropdown-item" href="{{ url_for("main.create_project") }}">{{ _("Start a new project") }}</a></li>
{% if g.show_admin_dashboard_link %}
<li class="dropdown-divider"></li>
<li class="nav-item{% if request.url_rule.endpoint == "main.dashboard" %} active{% endif %}">
<a class="dropdown-item" href="{{ url_for("main.dashboard") }}">{{ _("Dashboard") }}</a>
</li>
{% endif %}
<li class="dropdown-divider"></li>
<li><a class="dropdown-item" href="{{ url_for("main.exit") }}">{{ _("Logout") }}</a></li>
</ul>
</li>
{% endif %}
</ul>
<ul class="navbar-nav secondary-nav">
<li class="nav-item{% if g.lang == "fr" %} active{% endif %}"><a class="nav-link" href="{{ url_for("main.change_lang", lang="fr") }}">fr</a></li>
<li class="nav-item{% if g.lang == "en" %} active{% endif %}"><a class="nav-link" href="{{ url_for("main.change_lang", lang="en") }}">en</a></li>
</ul>
</div>
</nav>
</div>
<div class="container-fluid">
{% block body %}
<main class="content offset-1 col-10">
{% block content %}{% endblock %}
</main>
</div>
{% endblock %}
<div class="messages">
{% for message in get_flashed_messages() %}
<div class="flash alert alert-success">{{ message }}</div>
{% endfor %}
</div>
{% block footer %}
<footer>
<p>
<a href="https://github.com/spiral-project/ihatemoney">{{ _("This is a free software") }}</a><span class="d-none d-sm-inline">,
{{ _("you can contribute and improve it!") }}</span>
</p>
</footer>
{% endblock %}
</body>
</html>