diff options
Diffstat (limited to 'budget/templates/layout.html')
| -rw-r--r-- | budget/templates/layout.html | 106 |
1 files changed, 44 insertions, 62 deletions
diff --git a/budget/templates/layout.html b/budget/templates/layout.html index 293ce75..71ad5e8 100644 --- a/budget/templates/layout.html +++ b/budget/templates/layout.html @@ -5,9 +5,9 @@ <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.6.2.min.js") }}"></script> + <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/jquery.qtip.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(){ @@ -18,82 +18,64 @@ $(".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; - }); + $('.dropdown-toggle').dropdown() {% block js %}{% endblock %} }); </script> </head> <body> -{% macro translations() %} -<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> -{% endmacro %} -<div class="topbar"> - <div class="fill"><div class="container-fluid"> - <h3><a class="logo" href="{{ url_for(".home") }}">#! money?</a></h3> - {% if g.project %} - <ul class="menu"> - <li class="active"><a href="{{ url_for(".list_bills") }}">{{ _("Bills") }}</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> + +<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"> + <li class="active"><a href="{{ url_for(".list_bills") }}">{{ _("Bills") }}</a></li> + </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 %} - {% 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> - {{ translations() }} - </ul> - {% else %} - <ul class="nav secondary-nav"> - {{ translations() }} - </ul> - {% endif %} - </div></div> + <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 container %} + +{% block body %} <div class="container-fluid"> {% block sidebar %}{% endblock %} <div class="content"> - {% block content %} - {% endblock %} + {% block content %}{% endblock %} </div> </div> - {% for message in get_flashed_messages() %} - <div class="flash alert-message success"><p>{{ message }}</p></div> - {% endfor %} {% 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> |
