mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
use single variable for referencing icon filename
- add and use "icon_filename" property to almost all of the modules being displayed in the apps page - sharing and tor modules do not seem to be using setup.html template file and so the variable is not added to their __init__.py files, therefore the icon will not be displayed on these app pages. Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
f004939f50
commit
fa74a26042
@ -38,6 +38,8 @@ managed_packages = ['deluged', 'deluge-web']
|
||||
|
||||
name = _('Deluge')
|
||||
|
||||
icon_filename = 'deluge'
|
||||
|
||||
short_description = _('BitTorrent Web Client')
|
||||
|
||||
description = [
|
||||
@ -71,7 +73,7 @@ class DelugeApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-deluge', name,
|
||||
short_description=short_description,
|
||||
url='/deluge', icon='deluge',
|
||||
url='/deluge', icon=icon_filename,
|
||||
clients=clients, login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
@ -49,6 +49,8 @@ managed_paths = [pathlib.Path('/etc/ejabberd/')]
|
||||
|
||||
name = _('ejabberd')
|
||||
|
||||
icon_filename = 'ejabberd'
|
||||
|
||||
short_description = _('Chat Server')
|
||||
|
||||
description = [
|
||||
@ -96,7 +98,7 @@ class EjabberdApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-ejabberd', name, short_description=short_description,
|
||||
icon='ejabberd', description=description,
|
||||
icon=icon_filename, description=description,
|
||||
configure_url=reverse_lazy('ejabberd:index'), clients=clients,
|
||||
login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
@ -38,6 +38,7 @@ class EjabberdAppView(AppView):
|
||||
form_class = EjabberdForm
|
||||
manual_page = ejabberd.manual_page
|
||||
port_forwarding_info = ejabberd.port_forwarding_info
|
||||
icon_filename = ejabberd.icon_filename
|
||||
|
||||
def get_initial(self):
|
||||
initdict = super().get_initial()
|
||||
|
||||
@ -42,6 +42,8 @@ managed_packages = ['gitweb', 'highlight']
|
||||
|
||||
name = _('Gitweb')
|
||||
|
||||
icon_filename = 'gitweb'
|
||||
|
||||
short_description = _('Simple Git Hosting')
|
||||
|
||||
description = [
|
||||
@ -78,7 +80,7 @@ class GitwebApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-gitweb', name, short_description=short_description,
|
||||
icon='gitweb', url='/gitweb/', clients=clients,
|
||||
icon=icon_filename, url='/gitweb/', clients=clients,
|
||||
login_required=True, allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
|
||||
@ -41,6 +41,8 @@ managed_packages = ['i2p']
|
||||
|
||||
name = _('I2P')
|
||||
|
||||
icon_filename = 'i2p'
|
||||
|
||||
short_description = _('Anonymity Network')
|
||||
|
||||
description = [
|
||||
@ -89,7 +91,7 @@ class I2PApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-i2p', name, short_description=short_description,
|
||||
icon='i2p', url='/i2p/', clients=clients, login_required=True,
|
||||
icon=icon_filename, url='/i2p/', clients=clients, login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
|
||||
@ -40,6 +40,8 @@ managed_packages = [
|
||||
|
||||
name = _('ikiwiki')
|
||||
|
||||
icon_filename = 'ikiwiki'
|
||||
|
||||
short_description = _('Wiki and Blog')
|
||||
|
||||
description = [
|
||||
@ -89,7 +91,8 @@ class IkiwikiApp(app_module.App):
|
||||
def add_shortcut(self, site, title):
|
||||
"""Add an ikiwiki shortcut to frontpage."""
|
||||
shortcut = frontpage.Shortcut('shortcut-ikiwiki-' + site, title,
|
||||
icon='ikiwiki', url='/ikiwiki/' + site,
|
||||
icon=icon_filename,
|
||||
url='/ikiwiki/' + site,
|
||||
clients=clients)
|
||||
self.add(shortcut)
|
||||
return shortcut
|
||||
|
||||
@ -41,6 +41,8 @@ manual_page = 'Infinoted'
|
||||
|
||||
name = _('infinoted')
|
||||
|
||||
icon_filename = 'infinoted'
|
||||
|
||||
short_description = _('Gobby Server')
|
||||
|
||||
description = [
|
||||
@ -74,7 +76,7 @@ class InfinotedApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-infinoted', name, short_description=short_description,
|
||||
icon='infinoted', description=description,
|
||||
icon=icon_filename, description=description,
|
||||
configure_url=reverse_lazy('infinoted:index'), clients=clients,
|
||||
login_required=False)
|
||||
self.add(shortcut)
|
||||
@ -104,7 +106,7 @@ class InfinotedAppView(AppView):
|
||||
description = description
|
||||
clients = clients
|
||||
port_forwarding_info = port_forwarding_info
|
||||
|
||||
icon_filename = icon_filename
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
|
||||
@ -35,6 +35,8 @@ managed_packages = ['libjs-jsxc']
|
||||
|
||||
name = _('JSXC')
|
||||
|
||||
icon_filename = 'jsxc'
|
||||
|
||||
short_description = _('Chat Client')
|
||||
|
||||
description = [
|
||||
@ -63,7 +65,8 @@ class JSXCApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-jsxc', name=name, short_description=short_description,
|
||||
icon='jsxc', url=reverse_lazy('jsxc:jsxc'), clients=clients)
|
||||
icon=icon_filename,
|
||||
url=reverse_lazy('jsxc:jsxc'), clients=clients)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-jsxc', name, ports=['http', 'https'],
|
||||
|
||||
@ -46,6 +46,8 @@ managed_paths = [pathlib.Path('/etc/matrix-synapse/')]
|
||||
|
||||
name = _('Matrix Synapse')
|
||||
|
||||
icon_filename = 'matrixsynapse'
|
||||
|
||||
short_description = _('Chat Server')
|
||||
|
||||
description = [
|
||||
@ -91,7 +93,7 @@ class MatrixSynapseApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-matrixsynapse', name,
|
||||
short_description=short_description, icon='matrixsynapse',
|
||||
short_description=short_description, icon=icon_filename,
|
||||
description=description,
|
||||
configure_url=reverse_lazy('matrixsynapse:index'), clients=clients,
|
||||
login_required=True)
|
||||
|
||||
@ -37,6 +37,8 @@ managed_services = ['mediawiki-jobrunner']
|
||||
|
||||
name = _('MediaWiki')
|
||||
|
||||
icon_filename = 'mediawiki'
|
||||
|
||||
short_description = _('Wiki')
|
||||
|
||||
description = [
|
||||
@ -78,7 +80,7 @@ class MediaWikiApp(app_module.App):
|
||||
|
||||
shortcut = Shortcut('shortcut-mediawiki', name,
|
||||
short_description=short_description,
|
||||
icon='mediawiki', url='/mediawiki',
|
||||
icon=icon_filename, url='/mediawiki',
|
||||
clients=clients, login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
|
||||
@ -50,6 +50,8 @@ managed_packages = ['minetest-server'] + mods
|
||||
|
||||
name = _('Minetest')
|
||||
|
||||
icon_filename = 'minetest'
|
||||
|
||||
short_description = _('Block Sandbox')
|
||||
|
||||
description = [
|
||||
@ -90,7 +92,7 @@ class MinetestApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-minetest', name, short_description=short_description,
|
||||
icon='minetest', description=description,
|
||||
icon=icon_filename, description=description,
|
||||
configure_url=reverse_lazy('minetest:index'), clients=clients,
|
||||
login_required=False)
|
||||
self.add(shortcut)
|
||||
|
||||
@ -39,6 +39,8 @@ managed_packages = ['mldonkey-server']
|
||||
|
||||
name = _('MLDonkey')
|
||||
|
||||
icon_filename = 'mldonkey'
|
||||
|
||||
short_description = _('Peer-to-peer File Sharing')
|
||||
|
||||
description = [
|
||||
@ -80,7 +82,7 @@ class MLDonkeyApp(app_module.App):
|
||||
|
||||
shortcuts = frontpage.Shortcut(
|
||||
'shortcut-mldonkey', name, short_description=short_description,
|
||||
icon='mldonkey', url='/mldonkey/', login_required=True,
|
||||
icon=icon_filename, url='/mldonkey/', login_required=True,
|
||||
clients=clients, allowed_groups=[group[0]])
|
||||
self.add(shortcuts)
|
||||
|
||||
|
||||
@ -34,6 +34,8 @@ version = 1
|
||||
|
||||
name = _('Mumble')
|
||||
|
||||
icon_filename = 'mumble'
|
||||
|
||||
short_description = _('Voice Chat')
|
||||
|
||||
managed_services = ['mumble-server']
|
||||
@ -76,7 +78,7 @@ class MumbleApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-mumble', name, short_description=short_description,
|
||||
icon='mumble', description=description,
|
||||
icon=icon_filename, description=description,
|
||||
configure_url=reverse_lazy('mumble:index'), clients=clients)
|
||||
self.add(shortcut)
|
||||
|
||||
@ -106,7 +108,7 @@ class MumbleAppView(AppView):
|
||||
clients = clients
|
||||
manual_page = manual_page
|
||||
port_forwarding_info = port_forwarding_info
|
||||
|
||||
icon_filename = icon_filename
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
|
||||
@ -38,6 +38,8 @@ managed_packages = ['openvpn', 'easy-rsa']
|
||||
|
||||
name = _('OpenVPN')
|
||||
|
||||
icon_filename = 'openvpn'
|
||||
|
||||
short_description = _('Virtual Private Network')
|
||||
|
||||
description = [
|
||||
@ -79,7 +81,7 @@ class OpenVPNApp(app_module.App):
|
||||
link=reverse_lazy('openvpn:profile'))
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-openvpn', name, short_description=short_description,
|
||||
icon='openvpn', description=description + [download_profile],
|
||||
icon=icon_filename, description=description + [download_profile],
|
||||
configure_url=reverse_lazy('openvpn:index'), login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
|
||||
@ -41,6 +41,8 @@ managed_packages = ['privoxy']
|
||||
|
||||
name = _('Privoxy')
|
||||
|
||||
icon_filename = 'privoxy'
|
||||
|
||||
short_description = _('Web Proxy')
|
||||
|
||||
description = [
|
||||
@ -80,7 +82,7 @@ class PrivoxyApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-privoxy', name, short_description=short_description,
|
||||
icon='privoxy', description=description,
|
||||
icon=icon_filename, description=description,
|
||||
configure_url=reverse_lazy('privoxy:index'), login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
@ -115,7 +117,7 @@ class PrivoxyAppView(AppView):
|
||||
name = name
|
||||
description = description
|
||||
manual_page = manual_page
|
||||
|
||||
icon_filename = icon_filename
|
||||
|
||||
def diagnose():
|
||||
"""Run diagnostics and return the results."""
|
||||
|
||||
@ -44,6 +44,8 @@ managed_paths = [pathlib.Path('/var/lib/quassel/')]
|
||||
|
||||
name = _('Quassel')
|
||||
|
||||
icon_filename = 'quassel'
|
||||
|
||||
short_description = _('IRC Client')
|
||||
|
||||
description = [
|
||||
@ -88,7 +90,7 @@ class QuasselApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-quassel', name, short_description=short_description,
|
||||
icon='quassel', description=description,
|
||||
icon=icon_filename, description=description,
|
||||
configure_url=reverse_lazy('quassel:index'), clients=clients,
|
||||
login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
@ -44,6 +44,8 @@ managed_packages = ['radicale', 'uwsgi', 'uwsgi-plugin-python3']
|
||||
|
||||
name = _('Radicale')
|
||||
|
||||
icon_filename = 'radicale'
|
||||
|
||||
short_description = _('Calendar and Addressbook')
|
||||
|
||||
description = [
|
||||
@ -88,7 +90,7 @@ class RadicaleApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-radicale', name,
|
||||
short_description=short_description,
|
||||
icon='radicale', url='/radicale/',
|
||||
icon=icon_filename, url='/radicale/',
|
||||
clients=clients, login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
|
||||
@ -34,6 +34,8 @@ managed_packages = ['sqlite3', 'roundcube', 'roundcube-sqlite3']
|
||||
|
||||
name = _('Roundcube')
|
||||
|
||||
icon_filename = 'roundcube'
|
||||
|
||||
short_description = _('Email Client')
|
||||
|
||||
description = [
|
||||
@ -78,7 +80,8 @@ class RoundcubeApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-roundcube', name,
|
||||
short_description=short_description,
|
||||
icon='roundcube', url='/roundcube/',
|
||||
icon=icon_filename,
|
||||
url='/roundcube/',
|
||||
clients=clients, login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
|
||||
@ -39,6 +39,8 @@ managed_packages = ['searx', 'uwsgi', 'uwsgi-plugin-python3']
|
||||
|
||||
name = _('Searx')
|
||||
|
||||
icon_filename = 'searx'
|
||||
|
||||
short_description = _('Web Search')
|
||||
|
||||
description = [
|
||||
@ -69,7 +71,7 @@ class SearxApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-searx', name, short_description=short_description,
|
||||
icon='searx', url='/searx/', clients=clients,
|
||||
icon=icon_filename, url='/searx/', clients=clients,
|
||||
login_required=(not is_public_access_enabled()),
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
@ -34,6 +34,8 @@ version = 1
|
||||
|
||||
name = _('Shadowsocks')
|
||||
|
||||
icon_filename = 'shadowsocks'
|
||||
|
||||
short_description = _('Socks5 Proxy')
|
||||
|
||||
managed_services = ['shadowsocks-libev-local@freedombox']
|
||||
@ -74,7 +76,7 @@ class ShadowsocksApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-shadowsocks', name, short_description=short_description,
|
||||
icon='shadowsocks', description=description,
|
||||
icon=icon_filename, description=description,
|
||||
configure_url=reverse_lazy('shadowsocks:index'),
|
||||
login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
@ -39,6 +39,8 @@ managed_packages = ['syncthing']
|
||||
|
||||
name = _('Syncthing')
|
||||
|
||||
icon_filename = 'syncthing'
|
||||
|
||||
short_description = _('File Synchronization')
|
||||
|
||||
description = [
|
||||
@ -80,7 +82,7 @@ class SyncthingApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-syncthing', name,
|
||||
short_description=short_description,
|
||||
icon='syncthing', url='/syncthing/',
|
||||
icon=icon_filename, url='/syncthing/',
|
||||
clients=clients, login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
@ -42,6 +42,8 @@ managed_packages = ['tahoe-lafs']
|
||||
|
||||
name = _('Tahoe-LAFS')
|
||||
|
||||
icon_filename = 'tahoe-lafs'
|
||||
|
||||
short_description = _('Distributed File Storage')
|
||||
|
||||
port_forwarding_info = [
|
||||
@ -76,7 +78,7 @@ class TahoeApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-tahoe', name, short_description=short_description,
|
||||
icon='tahoe-lafs', url=None, login_required=True)
|
||||
icon=icon_filename, url=None, login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-tahoe', name, ports=['tahoe-plinth'],
|
||||
|
||||
@ -57,6 +57,7 @@ class TahoeAppView(AppView):
|
||||
description = tahoe.description
|
||||
diagnostics_module_name = 'tahoe'
|
||||
port_forwarding_info = tahoe.port_forwarding_info
|
||||
icon_filename = tahoe.icon_filename
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
if not tahoe.is_setup():
|
||||
|
||||
@ -40,6 +40,8 @@ managed_packages = ['transmission-daemon']
|
||||
|
||||
name = _('Transmission')
|
||||
|
||||
icon_filename = 'transmission'
|
||||
|
||||
short_description = _('BitTorrent Web Client')
|
||||
|
||||
description = [
|
||||
@ -74,7 +76,7 @@ class TransmissionApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-transmission', name,
|
||||
short_description=short_description,
|
||||
icon='transmission', url='/transmission',
|
||||
icon=icon_filename, url='/transmission',
|
||||
clients=clients, login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
@ -42,6 +42,8 @@ managed_packages = [
|
||||
|
||||
name = _('Tiny Tiny RSS')
|
||||
|
||||
icon_filename = 'ttrss'
|
||||
|
||||
short_description = _('News Feed Reader')
|
||||
|
||||
description = [
|
||||
@ -81,7 +83,7 @@ class TTRSSApp(app_module.App):
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-ttrss', name,
|
||||
short_description=short_description,
|
||||
icon='ttrss', url='/tt-rss',
|
||||
icon=icon_filename, url='/tt-rss',
|
||||
clients=clients, login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
@ -35,8 +35,9 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
||||
{% if setup_helper.module.icon_filename %}
|
||||
|
||||
<header class="app-header">
|
||||
<figure>
|
||||
<img src="{% static 'theme/icons/' %}{{ setup_helper.module.icon_filename }}.svg"/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user