messages of 404.html defined in main program, template moved in common directory
authorReimar Bauer <rb.proj AT googlemail DOT com>
Sun, 19 Jan 2014 10:11:38 +0100
changeset 157750903e3cfc0
parent 156 f05d0e9abd23
child 158 49422e3977aa
messages of 404.html defined in main program, template moved in common directory
pymove3d.py
templates/404.html
templates/de/404.html
templates/en/404.html
     1.1 --- a/pymove3d.py	Sun Jan 19 10:09:19 2014 +0100
     1.2 +++ b/pymove3d.py	Sun Jan 19 10:11:38 2014 +0100
     1.3 @@ -109,7 +109,9 @@
     1.4  
     1.5  @app.errorhandler(404)
     1.6  def page_not_found(e):
     1.7 -    return render_template(get_locale() + "/404.html")
     1.8 +    msg = _(u"Url: %(url)s not found" , url=request.url)
     1.9 +    info = _(u"This information is not available!")
    1.10 +    return render_template("404.html", msg=msg, info=info)
    1.11  
    1.12  if __name__ == "__main__":
    1.13      app.run(host='localhost', port=5014, debug=True)
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/templates/404.html	Sun Jan 19 10:11:38 2014 +0100
     2.3 @@ -0,0 +1,5 @@
     2.4 +{% extends "theme.html" %} 
     2.5 +{% block body %}
     2.6 +<h1>{{ msg }}</h1>
     2.7 +<p>{{ info }}<p>
     2.8 +{% endblock %}
     3.1 --- a/templates/de/404.html	Sun Jan 19 10:09:19 2014 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,5 +0,0 @@
     3.4 -{% extends "theme.html" %} 
     3.5 -{% block body %}
     3.6 -<h1>Page Not Found</h1> 
     3.7 -<p>_('This information is not available!')<p><a href="{{ url_for('index') }}">_('Home')</a>
     3.8 -{% endblock %}
     4.1 --- a/templates/en/404.html	Sun Jan 19 10:09:19 2014 +0100
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,5 +0,0 @@
     4.4 -{% extends "theme.html" %} 
     4.5 -{% block body %}
     4.6 -<h1>Page Not Found</h1> 
     4.7 -<p>_('This information is not available!')<p><a href="{{ url_for('index') }}">_('Home')</a>
     4.8 -{% endblock %}
Impressum Datenschutzerklärung