{% 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 %}
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):