]> git.ipfire.org Git - ipfire.org.git/commitdiff
analytics: Add an empty index page
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 7 Jan 2024 18:17:14 +0000 (18:17 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 7 Jan 2024 18:17:14 +0000 (18:17 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/templates/analytics/index.html [new file with mode: 0644]
src/web/__init__.py
src/web/analytics.py

index 1ec48d59d1b64052701d861f83e913a26a204eec..3856bdacd28798f9b2b59da311e667f90e635470 100644 (file)
@@ -115,6 +115,9 @@ templates_DATA = \
 
 templatesdir = $(datadir)/templates
 
+templates_analytics_DATA = \
+       src/templates/analytics/index.html
+
 templates_analyticsdir = $(templatesdir)/analytics
 
 templates_analytics_modules_DATA = \
diff --git a/src/templates/analytics/index.html b/src/templates/analytics/index.html
new file mode 100644 (file)
index 0000000..73b5437
--- /dev/null
@@ -0,0 +1,24 @@
+{% extends "../base.html" %}
+
+{% block title %}{{ _("Analytics") }}{% end block %}
+
+{% block container %}
+       <section class="hero is-primary">
+               <div class="hero-body">
+                       <div class="container">
+                               <nav class="breadcrumb" aria-label="breadcrumbs">
+                                       <ul>
+                                               <li>
+                                                       <a href="/">{{ _("Home") }}</a>
+                                               </li>
+                                               <li class="is-active">
+                                                       <a href="#" aria-current="page">{{ _("Analytics") }}</a>
+                                               </li>
+                                       </ul>
+                               </nav>
+
+                               <h1 class="title">{{ _("Analytics") }}</h1>
+                       </div>
+               </div>
+       </section>
+{% end block %}
index 7ca4087f3a76885de18281ed77dce11d989871f6..59429c0d419285b42c24404d6e1af0e2792edc54 100644 (file)
@@ -122,6 +122,9 @@ class Application(tornado.web.Application):
                        # Entry site that lead the user to index
                        (r"/", IndexHandler),
 
+                       # Analytics
+                       (r"/analytics", analytics.IndexHandler),
+
                        # Authentication
                        (r"/join", auth.JoinHandler),
                        (r"/login", auth.LoginHandler),
index 66c694a6d04a59cc7c1bc088c9bee859351f490c..a5f13704de8a15233a26cbe623dc1db1451368aa 100644 (file)
@@ -1,9 +1,17 @@
 #!/usr/bin/python3
 
 import datetime
+import tornado.web
 
+from . import base
 from . import ui_modules
 
+class IndexHandler(base.BaseHandler):
+       @tornado.web.authenticated
+       def get(self):
+               self.render("analytics/index.html")
+
+
 class SummaryModule(ui_modules.UIModule):
        def render(self, host=None, uri=None):
                if host is None: