]> git.ipfire.org Git - ipfire.org.git/commitdiff
fireinfo: Add nicer error page if profile was not found or was disabled.
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Jan 2011 17:02:38 +0000 (18:02 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Jan 2011 17:10:28 +0000 (18:10 +0100)
www/templates/stasy-profile-notfound.html [new file with mode: 0644]
www/translations/de_DE.csv
www/webapp/handlers_stasy.py

diff --git a/www/templates/stasy-profile-notfound.html b/www/templates/stasy-profile-notfound.html
new file mode 100644 (file)
index 0000000..07ee767
--- /dev/null
@@ -0,0 +1,38 @@
+{% extends "base-1.html" %}
+
+{% block title %}{{ _("Profile not found") }}}{% end block %}
+
+{% block content %}
+       <h3>404 - {{ _("Profile not found") }}</h3>
+       <img class="floatTL" src="{{ static_url("images/error/404.png") }}"
+               alt="{{ _("Error") }}" />
+       <p>
+               {% if lang == "de" %}
+                       Es wurden keine Daten für das Profil <em>{{ profile_id }}</em>
+                       gefunden.
+               {% else %}
+                       There was no profile data found for profile
+                       <em>{{ profile_id }}</em>.
+               {% end %}
+       </p>
+       <p>
+               {% if lang == "de" %}
+                       Der Eigentümer dieses Profils hat möglicherweise der Veröffentlichung
+                       der Daten nicht zugestimmt oder diese abgeschaltet.
+               {% else %}
+                       Apparently, the profile owner has not submitted any data or disabled
+                       it recently.
+               {% end %}
+       </p>
+       <p>
+               {% if lang == "de" %}
+                       Falls dieses Profile Ihr eigenes ist, so können Sie die Veröffentlichung
+                       im Web-Interface
+                       <a href="http://wiki.ipfire.org/de/fireinfo/my_profile" target="_blank">einschalten</a>.
+               {% else %}
+                       If this is your own profile, you can
+                       <a href="http://wiki.ipfire.org/en/fireinfo/my_profile" target="_blank">enable</a>
+                       the submission on the web user interface.
+               {% end %}
+       </p>
+{% end block %}
index 6741200fed19c1c59497535da29ba9fb1bcfd073..cbaa0d34fe22b576ef209dc9d877f6d41dca14ef 100644 (file)
 "Mirror servers nearby","Mirror-Server in der Nähe"
 "Worldwide mirror servers","Weltweite Mirror-Server"
 "Preferred for","Bevorzugt für"
+"Profile not found","Profil nicht gefunden"
index c67497a280adf49f82654b978e9bc07477a8b029..e069812e4e040214faee1640840e79c026fe02d4 100644 (file)
@@ -40,6 +40,10 @@ class StasyBaseHandler(BaseHandler):
 
 
 class StasyIndexHandler(StasyBaseHandler):
+       def _profile_not_found(self, profile_id):
+               self.set_status(404)
+               self.render("stasy-profile-notfound.html", profile_id=profile_id)
+
        def get(self):
                self.render("stasy-index.html")
 
@@ -49,16 +53,18 @@ class StasyIndexHandler(StasyBaseHandler):
                        raise tornado.web.HTTPError(400, "No profile ID was given.")
 
                if not self.stasy.profile_exists(profile_id):
-                       raise tornado.web.HTTPError(404, "Profile does not exist.")
+                       self._profile_not_found(profile_id)
+                       return
 
                self.redirect("/profile/%s" % profile_id)
 
 
-class StasyProfileDetailHandler(StasyBaseHandler):
+class StasyProfileDetailHandler(StasyIndexHandler):
        def get(self, profile_id):
                profile = self.stasy.get_profile(profile_id)
                if not profile:
-                       raise tornado.web.HTTPError(404, "Profile not found: %s" % profile_id)
+                       self._profile_not_found(profile_id)
+                       return
 
                self.render("stasy-profile-detail.html", profile=profile)