diff options
| author | Alexis Metaireau <alexis@notmyidea.org> | 2018-09-03 20:54:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-03 20:54:07 +0200 |
| commit | 6ab92ddbac84f87dc598016de45845a26818dd52 (patch) | |
| tree | 727f25e6a9feb8b5411d5c48f1d7bc8b9ca5f703 /ihatemoney/templates | |
| parent | 24e0d8348fb5855d0255b41ec1ca9beaf233d9a6 (diff) | |
| download | ihatemoney-mirror-6ab92ddbac84f87dc598016de45845a26818dd52.zip ihatemoney-mirror-6ab92ddbac84f87dc598016de45845a26818dd52.tar.gz ihatemoney-mirror-6ab92ddbac84f87dc598016de45845a26818dd52.tar.bz2 | |
Add a handler when pages aren't found. (#379)
Fixes #356
Diffstat (limited to 'ihatemoney/templates')
| -rw-r--r-- | ihatemoney/templates/404.html | 13 | ||||
| -rw-r--r-- | ihatemoney/templates/layout.html | 22 |
2 files changed, 24 insertions, 11 deletions
diff --git a/ihatemoney/templates/404.html b/ihatemoney/templates/404.html new file mode 100644 index 0000000..7e282c2 --- /dev/null +++ b/ihatemoney/templates/404.html @@ -0,0 +1,13 @@ +{% extends "layout.html" %} + +{% block body %} + <header id="header" class="row"> + <div class="col-xs-12 col-sm-5 offset-md-2"> + <h2>{{ _("Sorry, we were unable to find the page you've asked for.") }}</h2> + </div> + </header> + <main class="row home"> + <div class="col-xs-12 col-sm-5 col-md-4 offset-md-2"> + <a href='{{ url_for("main.home") }}'>{{ _("The best thing to do is probably to get back to the main page.")}}</a> + </div> +{% endblock %} diff --git a/ihatemoney/templates/layout.html b/ihatemoney/templates/layout.html index cb36a6f..3523ef7 100644 --- a/ihatemoney/templates/layout.html +++ b/ihatemoney/templates/layout.html @@ -32,13 +32,13 @@ <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> + <h1><a class="navbar-brand" href="{{ url_for("main.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> - <li class="nav-item{% if current_view == 'statistics' %} active{% endif %}"><a class="nav-link" href="{{ url_for(".statistics") }}">{{ _("Statistics") }}</a></li> + <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> @@ -47,23 +47,23 @@ <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><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(".list_bills", project_id=id) }}">{{ _("switch to") }} {{ name }}</a></li> + <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(".create_project") }}">{{ _("Start a new project") }}</a></li> + <li><a class="dropdown-item" href="{{ url_for("main.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> + <li><a class="dropdown-item" href="{{ url_for("main.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> + <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(".dashboard") }}">{{ _("Dashboard") }}</a></li> + <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> |
