]> git.ipfire.org Git - ipfire.org.git/commitdiff
Some tidying up
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Nov 2018 13:47:28 +0000 (13:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Nov 2018 13:47:28 +0000 (13:47 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/templates/fireinfo/modules/table-geo.html [deleted file]
src/web/__init__.py
src/web/fireinfo.py

index 9cd40b721a36968df15fff5c70558d56b3da9ef6..48a2ec4f8d7c2dead7093b6a6ec6f325398f7a01 100644 (file)
@@ -151,8 +151,7 @@ templates_fireinfodir = $(templatesdir)/fireinfo
 
 templates_fireinfo_modules_DATA = \
        src/templates/fireinfo/modules/table-devices-and-groups.html \
-       src/templates/fireinfo/modules/table-devices.html \
-       src/templates/fireinfo/modules/table-geo.html
+       src/templates/fireinfo/modules/table-devices.html
 
 templates_fireinfo_modulesdir = $(templates_fireinfodir)/modules
 
diff --git a/src/templates/fireinfo/modules/table-geo.html b/src/templates/fireinfo/modules/table-geo.html
deleted file mode 100644 (file)
index 80a70d5..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<dl class="dl-horizontal">
-       {% for country in countries %}
-               <dt>
-                       {{ country.name }}
-                       {% if country.code and not country.code in ("A1", "A2") %}
-                               <img src="{{ static_url("images/flags/%s.png" % country.code.lower()) }}" />
-                       {% end %}
-               </dt>
-               <dd>
-                       {% module ProgressBar(country.value) %}
-               </dd>
-       {% end %}
-</dl>
-
-{% if other_countries %}
-       {{ _("IPFire is also running in %s.") % locale.list(other_countries) }}
-{% end %}
index 85b58a5c99ae2403ccfd93a6030c6df0aaea8415..15c76dc8312e629e4b5b871ee9373246c0becd51 100644 (file)
@@ -46,7 +46,7 @@ class Application(tornado.web.Application):
                        "static_path"   : self.backend.config.get("global", "static_dir"),
                        "template_path" : self.backend.config.get("global", "templates_dir"),
 
-                       # UI Modules
+                       # UI Methods
                        "ui_methods" : {
                                "format_country_name"          : self.format_country_name,
                                "format_month_name"            : self.format_month_name,
@@ -55,6 +55,8 @@ class Application(tornado.web.Application):
                                "format_phone_number_location" : self.format_phone_number_location,
                                "grouper"                      : grouper,
                        },
+
+                       # UI Modules
                        "ui_modules" : {
                                # Blog
                                "BlogHistoryNavigation": blog.HistoryNavigationModule,
@@ -67,10 +69,7 @@ class Application(tornado.web.Application):
                                "BootMenuHeader"       : boot.MenuHeaderModule,
                                "BootMenuSeparator"    : boot.MenuSeparatorModule,
 
-                               # Location
-                               "Map"                  : ui_modules.MapModule,
-
-                               # Talk
+                               # People
                                "AccountsList"         : people.AccountsListModule,
                                "CDR"                  : people.CDRModule,
                                "Channels"             : people.ChannelsModule,
@@ -83,10 +82,13 @@ class Application(tornado.web.Application):
                                "Code"                 : nopaste.CodeModule,
 
                                # Fireinfo
-                               "ProgressBar"          : ui_modules.ProgressBarModule,
                                "FireinfoDeviceTable"  : fireinfo.DeviceTableModule,
-                               "FireinfoDeviceAndGroupsTable" : fireinfo.DeviceAndGroupsTableModule,
-                               "FireinfoGeoTable"     : fireinfo.GeoTableModule,
+                               "FireinfoDeviceAndGroupsTable"
+                                                      : fireinfo.DeviceAndGroupsTableModule,
+
+                               # Misc
+                               "Map"                  : ui_modules.MapModule,
+                               "ProgressBar"          : ui_modules.ProgressBarModule,
                        },
 
                        # Call this when a page wasn't found
index a00eaaac8958064c90c5183adfd2096e4f3b6b90..cbb1518da0ac19aac9153c38e607094029e53508 100644 (file)
@@ -287,30 +287,3 @@ class DeviceAndGroupsTableModule(ui_modules.UIModule):
 
                return self.render_string("fireinfo/modules/table-devices-and-groups.html",
                                groups=groups)
-
-
-class GeoTableModule(ui_modules.UIModule):
-       def render(self, items):
-               countries = []
-               other_countries = []
-               for code, value in items:
-                       # Skip the satellite providers in this ranking
-                       if code in (None, "A1", "A2"):
-                               continue
-
-                       name = self.backend.geoip.get_country_name(code)
-
-                       # Don't add countries with a small share on the list
-                       if value < 0.01:
-                               other_countries.append(name)
-                               continue
-
-                       country = database.Row({
-                               "code"  : code,
-                               "name"  : name,
-                               "value" : value,
-                       })
-                       countries.append(country)
-
-               return self.render_string("fireinfo/modules/table-geo.html",
-                       countries=countries, other_countries=other_countries)