diff options
| author | Brice Maron <b.maron@whatever-company.com> | 2019-07-24 15:45:57 +0200 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2019-07-25 13:26:46 +0200 |
| commit | 92ce7d4d4806fa4b707334d1179e156570e3cde9 (patch) | |
| tree | 40d58397901e7447c1964a49219370f51c17b761 | |
| parent | 773fbec5b2b44ab22b68b6284fbc246de2f363fb (diff) | |
| download | ihatemoney-mirror-92ce7d4d4806fa4b707334d1179e156570e3cde9.zip ihatemoney-mirror-92ce7d4d4806fa4b707334d1179e156570e3cde9.tar.gz ihatemoney-mirror-92ce7d4d4806fa4b707334d1179e156570e3cde9.tar.bz2 | |
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
| -rw-r--r-- | ihatemoney/static/css/main.css | 10 | ||||
| -rw-r--r-- | ihatemoney/templates/forms.html | 10 | ||||
| -rw-r--r-- | ihatemoney/templates/home.html | 2 | ||||
| -rw-r--r-- | ihatemoney/templates/layout.html | 36 | ||||
| -rw-r--r-- | ihatemoney/templates/list_bills.html | 4 |
5 files changed, 40 insertions, 22 deletions
diff --git a/ihatemoney/static/css/main.css b/ihatemoney/static/css/main.css index 3c905a0..57e1c29 100644 --- a/ihatemoney/static/css/main.css +++ b/ihatemoney/static/css/main.css @@ -20,7 +20,9 @@ body { .navbar .secondary-nav { text-align: right; flex-direction: row-reverse; - +} +.secondary-nav .nav-link { + padding: .5rem 1rem; } .navbar-brand{ font-family: 'Lobster', arial, serif; } @@ -116,7 +118,7 @@ footer{ margin-top: 30px; position: fixed; bottom: 0px; - height: 20px; + height: 2em; width: 100%; text-align: center; background-color: #fff; @@ -254,12 +256,12 @@ tr.payer_line .balance-name { .balance.table .action, .extra-info { - display: none; + visibility: hidden; } .balance.table tr:hover .action, tr:hover .extra-info { - display: initial; + visibility: visible; } /* Fluid Offsets for Boostrap */ diff --git a/ihatemoney/templates/forms.html b/ihatemoney/templates/forms.html index 2a5e0a2..57f9440 100644 --- a/ihatemoney/templates/forms.html +++ b/ihatemoney/templates/forms.html @@ -24,10 +24,10 @@ <div class="actions"> <button type="submit" class="btn btn-primary">{{ field.name }}</button> {% if home %} - <a href="{{ url_for(".remind_password") }}">{{ _("Can't remember the password?") }}</a> + <a href="{{ url_for(".remind_password") }}" class="btn btn-link">{{ _("Can't remember the password?") }}</a> {% endif %} {% if cancel %} - <button type="reset" class="btn">{{ _("Cancel") }}</button> + <button type="reset" class="btn btn-light">{{ _("Cancel") }}</button> {% endif %} </div> {% endmacro %} @@ -110,7 +110,7 @@ </fieldset> <div class="actions"> {{ form.submit(class="btn btn-primary") }} - {% if not edit %} {{ form.submit2(class="btn") }}{% endif %} + {% if not edit %} {{ form.submit2(class="btn btn-light") }}{% endif %} </div> {% endmacro %} @@ -121,7 +121,9 @@ <div class="input-group"> <label class="sr-only" for="name">_("Type user name here")</label> {{ form.name(placeholder=_("Type user name here"), class="form-control") }} - <button class=" input-group-addon btn">{{ _("Add") }}</button> + <div class="input-group-append"> + <button class="btn btn-outline-secondary input-group-addon" type="submit">{{ _("Add") }}</button> + </div> </div> {% endmacro %} diff --git a/ihatemoney/templates/home.html b/ihatemoney/templates/home.html index 512f780..4e32995 100644 --- a/ihatemoney/templates/home.html +++ b/ihatemoney/templates/home.html @@ -35,7 +35,7 @@ {{ forms.create_project(project_form, home=True) }} </fieldset> <div class="controls"> - <button class="btn" type="submit">{{ _("let's get started") }}</button> + <button class="btn btn-primary" type="submit">{{ _("let's get started") }}</button> </div> </form> {% else %} diff --git a/ihatemoney/templates/layout.html b/ihatemoney/templates/layout.html index f96e8b2..2cb17da 100644 --- a/ihatemoney/templates/layout.html +++ b/ihatemoney/templates/layout.html @@ -31,40 +31,51 @@ <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"> - <h1><a class="navbar-brand" href="{{ url_for("main.home") }}">#! money?</a></h1> <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 %} - </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> + <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 %} + {% 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> - {% if g.show_admin_dashboard_link %} - <li class="nav-item{% if request.url_rule.endpoint == "main.dashboard" %} active{% endif %}"><a class="nav-link" href="{{ url_for("main.dashboard") }}">{{ _("Dashboard") }}</a></li> - {% endif %} </ul> </div> </nav> @@ -86,7 +97,10 @@ {% 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> + <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 %} diff --git a/ihatemoney/templates/list_bills.html b/ihatemoney/templates/list_bills.html index 718009b..98ff683 100644 --- a/ihatemoney/templates/list_bills.html +++ b/ihatemoney/templates/list_bills.html @@ -79,7 +79,7 @@ {% endblock %} {% block content %} -<div class="identifier"><a href="{{ url_for(".invite") }}">{{ _("Invite people to join this project!") }}</a></div> +<div class="identifier"><a class="btn btn-link" href="{{ url_for(".invite") }}">{{ _("Invite people to join this project!") }}</a></div> <a id="new-bill" href="{{ url_for(".add_bill") }}" class="btn btn-primary" data-toggle="modal" data-target="#bill-form">{{ _("Add a new bill") }}</a> <div id="bill-form" class="modal fade show" role="dialog"> @@ -97,7 +97,7 @@ </div> {% if bills.count() > 0 %} - <table id="bill_table" class="col table table-striped table-hover"> + <table id="bill_table" class="col table table-striped table-hover table-responsive-sm"> <thead><tr><th>{{ _("Added on") }}</th><th>{{ _("When?") }}</th><th>{{ _("Who paid?") }}</th><th>{{ _("For what?") }}</th><th>{{ _("For whom?") }}</th><th>{{ _("How much?") }}</th><th>{{ _("Actions") }}</th></tr></thead> <tbody> {% for bill in bills %} |
