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
+++ /dev/null
-<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 %}
"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,
"format_phone_number_location" : self.format_phone_number_location,
"grouper" : grouper,
},
+
+ # UI Modules
"ui_modules" : {
# Blog
"BlogHistoryNavigation": blog.HistoryNavigationModule,
"BootMenuHeader" : boot.MenuHeaderModule,
"BootMenuSeparator" : boot.MenuSeparatorModule,
- # Location
- "Map" : ui_modules.MapModule,
-
- # Talk
+ # People
"AccountsList" : people.AccountsListModule,
"CDR" : people.CDRModule,
"Channels" : people.ChannelsModule,
"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
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)