]> git.ipfire.org Git - ipfire.org.git/commitdiff
fireinfo: Redesign index page
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Oct 2018 10:10:04 +0000 (10:10 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Oct 2018 10:10:04 +0000 (10:10 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/fireinfo/index.html
src/web/fireinfo.py

index 619582c422046621e128b7c9aedaf625f4fcca3d..86376d9a4e89185f78d6c4797ea63d9236d78060 100644 (file)
@@ -1,44 +1,30 @@
 {% extends "../base.html" %}
 
-{% block title %}Fireinfo{% end block %}
+{% block title %}{{ _("Fireinfo") }}{% end block %}
 
-{% block body %}
-<div class="container">
-       <section class="features-content col-12">
-               <h2 class="display-2 text-center mb-0">{{ _("Fireinfo") }}</h2>
+{% block container %}
+       <section>
+               <div class="container">
+                       <div class="row">
+                               <div class="col col-lg-8">
+                                       <h1 class="display-2">{{ _("Fireinfo") }}</h1>
 
-               <p class="lead text-center">
-                       <strong>Fireinfo</strong> is a tool that anonymously collects statistical
-                       data from IPFire systems.
-               </p>
-
-               <p>
-                       These data should help the developers to learn
-                       which hardware is used most often to run an IPFire system, but is also
-                       handy when it comes to debugging hardware problems.
-               </p>
-               
-               <div class="row mt-6">
-                       <div class="col">
-                               <p>
-                                       Please enter the profile ID of your system, which can be found
-                                       on the fireinfo page on the web interface, to see your profile:
-                               </p>
+                                       <p>
+                                               <strong>Fireinfo</strong> is a tool that anonymously collects statistical
+                                               data from IPFire systems
+                                       </p>
+                               </div>
                        </div>
-                       <div class="col">
-                               <form class="form-inline" method="POST" action="" role="form">
-                                       <div class="form-group">
-                                               <label class="sr-only" for="profileId">{{ _("Profile ID") }}</label>
-                                               <input type="text" class="form-control" name="profile_id" id="profileId"
-                                                       value="" placeholder="{{ _("Profile ID") }}">
-                                               <button type="submit" class="btn btn-default">{{ _("Show") }}</button>
-                                       </div>
-                                       {% raw xsrf_form_html() %}
-                               </form>
+               </div>
+       </section>
 
-                               <p><a href="/profile/random" class="text-muted">{{ _("Random profile") }}</a></p>
+       <div class="container">
+               <div class="row justify-content-center">
+                       <div class="col-12 col-sm-8 col-lg-6 col-xl-4">
+                               <a class="btn btn-primary btn-lg btn-block" href="/profile/random">
+                                       {{ _("Show a Random Profile") }}
+                               </a>
                        </div>
                </div>
-       </section>
-</div>
+       </div>
 {% end block %}
index 19f001ca630e71a036192a62adc1843899521941..7d81e08d99b4979e4c2201fc2a24088a40e4a8f1 100644 (file)
@@ -153,24 +153,9 @@ class ProfileSendHandler(BaseHandler):
 
 
 class IndexHandler(BaseHandler):
-       def _profile_not_found(self, profile_id):
-               self.set_status(404)
-               self.render("fireinfo/profile-notfound.html", profile_id=profile_id)
-
        def get(self):
                self.render("fireinfo/index.html")
 
-       def post(self):
-               profile_id = self.get_argument("profile_id", None)
-               if not profile_id:
-                       raise tornado.web.HTTPError(400, "No profile ID was given.")
-
-               if not self.fireinfo.profile_exists(profile_id):
-                       self._profile_not_found(profile_id)
-                       return
-
-               self.redirect("/profile/%s" % profile_id)
-
 
 class ProfileDetailHandler(BaseHandler):
        def get(self, profile_id):