mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
app: Add donation links in dropdown menu
Signed-off-by: James Valleroy <jvalleroy@mailbox.org> [sunil: Undo a minor isort refactor in searx] [sunil: Change the menu label to 'Donate'] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
67eb6befd7
commit
f88ced9706
@ -264,7 +264,7 @@ class Info(FollowerComponent):
|
||||
def __init__(self, app_id, version, is_essential=False, depends=None,
|
||||
name=None, icon=None, icon_filename=None,
|
||||
short_description=None, description=None, manual_page=None,
|
||||
clients=None):
|
||||
clients=None, donation_url=None):
|
||||
"""Store the basic properties of an app as a component.
|
||||
|
||||
Each app must contain at least one component of this type to provide
|
||||
@ -331,6 +331,9 @@ class Info(FollowerComponent):
|
||||
compatible clients on desktop, web and mobile. This is a list of
|
||||
dictionaries who structure is documented in plinth.clients.
|
||||
|
||||
'donation_url' is a link to a webpage that describes how to
|
||||
donate to the upstream project.
|
||||
|
||||
"""
|
||||
self.component_id = app_id + '-info'
|
||||
self.app_id = app_id
|
||||
@ -344,3 +347,4 @@ class Info(FollowerComponent):
|
||||
self.description = description
|
||||
self.manual_page = manual_page
|
||||
self.clients = clients
|
||||
self.donation_url = donation_url
|
||||
|
||||
@ -45,10 +45,11 @@ class BackupsApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
depends=depends, name=_('Backups'),
|
||||
icon='fa-files-o', description=_description,
|
||||
manual_page='Backups')
|
||||
info = app_module.Info(
|
||||
app_id=self.app_id, version=version, depends=depends,
|
||||
name=_('Backups'), icon='fa-files-o', description=_description,
|
||||
manual_page='Backups',
|
||||
donation_url='https://www.borgbackup.org/support/fund.html')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-backups', info.name, None, info.icon,
|
||||
|
||||
@ -46,11 +46,12 @@ class DelugeApp(app_module.App):
|
||||
'bit-torrent': _('Download files using BitTorrent applications')
|
||||
}
|
||||
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Deluge'), icon_filename='deluge',
|
||||
short_description=_('BitTorrent Web Client'),
|
||||
description=_description, manual_page='Deluge',
|
||||
clients=clients)
|
||||
info = app_module.Info(
|
||||
app_id=self.app_id, version=version, name=_('Deluge'),
|
||||
icon_filename='deluge',
|
||||
short_description=_('BitTorrent Web Client'),
|
||||
description=_description, manual_page='Deluge', clients=clients,
|
||||
donation_url='https://www.patreon.com/deluge_cas')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-deluge', info.name, info.short_description,
|
||||
|
||||
@ -55,11 +55,11 @@ class I2PApp(app_module.App):
|
||||
|
||||
groups = {'i2p': _('Manage I2P application')}
|
||||
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('I2P'), icon_filename='i2p',
|
||||
short_description=_('Anonymity Network'),
|
||||
description=_description, manual_page='I2P',
|
||||
clients=clients)
|
||||
info = app_module.Info(
|
||||
app_id=self.app_id, version=version, name=_('I2P'),
|
||||
icon_filename='i2p', short_description=_('Anonymity Network'),
|
||||
description=_description, manual_page='I2P', clients=clients,
|
||||
donation_url='https://geti2p.net/en/get-involved/donate')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-i2p', info.name, info.short_description,
|
||||
|
||||
@ -52,7 +52,8 @@ class IkiwikiApp(app_module.App):
|
||||
name=_('ikiwiki'), icon_filename='ikiwiki',
|
||||
short_description=_('Wiki and Blog'),
|
||||
description=_description, manual_page='Ikiwiki',
|
||||
clients=clients)
|
||||
clients=clients,
|
||||
donation_url='https://ikiwiki.info/tipjar/')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-ikiwiki', info.name,
|
||||
|
||||
@ -65,7 +65,8 @@ class LetsEncryptApp(app_module.App):
|
||||
name=_('Let\'s Encrypt'), icon='fa-lock',
|
||||
short_description=_('Certificates'),
|
||||
description=_description,
|
||||
manual_page='LetsEncrypt')
|
||||
manual_page='LetsEncrypt',
|
||||
donation_url='https://letsencrypt.org/donate/')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-letsencrypt', info.name,
|
||||
|
||||
@ -56,11 +56,11 @@ class MinetestApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Minetest'), icon_filename='minetest',
|
||||
short_description=_('Block Sandbox'),
|
||||
description=_description,
|
||||
manual_page='Minetest', clients=clients)
|
||||
info = app_module.Info(
|
||||
app_id=self.app_id, version=version, name=_('Minetest'),
|
||||
icon_filename='minetest', short_description=_('Block Sandbox'),
|
||||
description=_description, manual_page='Minetest', clients=clients,
|
||||
donation_url='https://www.minetest.net/get-involved/#donate')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-minetest', info.name,
|
||||
|
||||
@ -46,11 +46,11 @@ class MumbleApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Mumble'), icon_filename='mumble',
|
||||
short_description=_('Voice Chat'),
|
||||
description=_description, manual_page='Mumble',
|
||||
clients=clients)
|
||||
info = app_module.Info(
|
||||
app_id=self.app_id, version=version, name=_('Mumble'),
|
||||
icon_filename='mumble', short_description=_('Voice Chat'),
|
||||
description=_description, manual_page='Mumble', clients=clients,
|
||||
donation_url='https://wiki.mumble.info/wiki/Donate')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-mumble', info.name, info.short_description,
|
||||
|
||||
@ -60,12 +60,12 @@ class PagekiteApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
depends=depends, name=_('PageKite'),
|
||||
icon='fa-flag',
|
||||
short_description=_('Public Visibility'),
|
||||
description=_description,
|
||||
manual_page='PageKite')
|
||||
info = app_module.Info(
|
||||
app_id=self.app_id, version=version, depends=depends,
|
||||
name=_('PageKite'), icon='fa-flag',
|
||||
short_description=_('Public Visibility'), description=_description,
|
||||
manual_page='PageKite',
|
||||
donation_url='https://pagekite.net/support/faq/#donate')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-pagekite', info.name,
|
||||
|
||||
@ -51,10 +51,11 @@ class PrivoxyApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Privoxy'), icon_filename='privoxy',
|
||||
short_description=_('Web Proxy'),
|
||||
description=_description, manual_page='Privoxy')
|
||||
info = app_module.Info(
|
||||
app_id=self.app_id, version=version, name=_('Privoxy'),
|
||||
icon_filename='privoxy', short_description=_('Web Proxy'),
|
||||
description=_description, manual_page='Privoxy',
|
||||
donation_url='https://www.privoxy.org/faq/general.html#DONATE')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-privoxy', info.name,
|
||||
|
||||
@ -58,11 +58,11 @@ class SambaApp(app_module.App):
|
||||
|
||||
groups = {'freedombox-share': _('Access to the private shares')}
|
||||
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Samba'), icon_filename='samba',
|
||||
short_description=_('Network File Storage'),
|
||||
manual_page='Samba', description=_description,
|
||||
clients=clients)
|
||||
info = app_module.Info(
|
||||
app_id=self.app_id, version=version, name=_('Samba'),
|
||||
icon_filename='samba', short_description=_('Network File Storage'),
|
||||
manual_page='Samba', description=_description, clients=clients,
|
||||
donation_url='https://www.samba.org/samba/donations.html')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-samba', info.name, info.short_description,
|
||||
|
||||
@ -44,11 +44,11 @@ class SearxApp(app_module.App):
|
||||
|
||||
groups = {'web-search': _('Search the web')}
|
||||
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Searx'), icon_filename='searx',
|
||||
short_description=_('Web Search'),
|
||||
description=_description, manual_page='Searx',
|
||||
clients=clients)
|
||||
info = app_module.Info(
|
||||
app_id=self.app_id, version=version, name=_('Searx'),
|
||||
icon_filename='searx', short_description=_('Web Search'),
|
||||
description=_description, manual_page='Searx', clients=clients,
|
||||
donation_url='https://searx.me/static/donate.html')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-searx', info.name, info.short_description,
|
||||
|
||||
@ -59,7 +59,8 @@ class SyncthingApp(app_module.App):
|
||||
name=_('Syncthing'), icon_filename='syncthing',
|
||||
short_description=_('File Synchronization'),
|
||||
description=_description,
|
||||
manual_page='Syncthing', clients=clients)
|
||||
manual_page='Syncthing', clients=clients,
|
||||
donation_url='https://syncthing.net/donations/')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-syncthing', info.name,
|
||||
|
||||
@ -55,7 +55,8 @@ class TorApp(app_module.App):
|
||||
name=_('Tor'), icon_filename='tor',
|
||||
short_description=_('Anonymity Network'),
|
||||
description=_description, manual_page='Tor',
|
||||
clients=clients)
|
||||
clients=clients,
|
||||
donation_url='https://donate.torproject.org/')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-tor', info.name, info.short_description,
|
||||
|
||||
@ -47,12 +47,12 @@ class TransmissionApp(app_module.App):
|
||||
groups = {
|
||||
'bit-torrent': _('Download files using BitTorrent applications')
|
||||
}
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Transmission'),
|
||||
icon_filename='transmission',
|
||||
short_description=_('BitTorrent Web Client'),
|
||||
description=_description,
|
||||
manual_page='Transmission', clients=clients)
|
||||
info = app_module.Info(
|
||||
app_id=self.app_id, version=version, name=_('Transmission'),
|
||||
icon_filename='transmission',
|
||||
short_description=_('BitTorrent Web Client'),
|
||||
description=_description, manual_page='Transmission',
|
||||
clients=clients, donation_url='https://transmissionbt.com/donate/')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-transmission', info.name,
|
||||
|
||||
@ -46,11 +46,12 @@ class WireguardApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('WireGuard'), icon_filename='wireguard',
|
||||
short_description=_('Virtual Private Network'),
|
||||
description=_description,
|
||||
manual_page='WireGuard', clients=clients)
|
||||
info = app_module.Info(
|
||||
app_id=self.app_id, version=version, name=_('WireGuard'),
|
||||
icon_filename='wireguard',
|
||||
short_description=_('Virtual Private Network'),
|
||||
description=_description, manual_page='WireGuard', clients=clients,
|
||||
donation_url='https://www.wireguard.com/donations/')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-wireguard', info.name,
|
||||
|
||||
@ -9,24 +9,36 @@
|
||||
<section class="toolbar">
|
||||
<div class="btn-toolbar" role="toolbar">
|
||||
|
||||
{% include "clients-button.html" with clients=app_info.clients enabled=is_enabled %}
|
||||
{% include "clients-button.html" with clients=app_info.clients enabled=is_enabled %}
|
||||
|
||||
{% if has_diagnostics %}
|
||||
<!-- Single button -->
|
||||
<div class="btn-group button-extra-actions">
|
||||
<button type="button" class="btn btn-default dropdown-toggle"
|
||||
data-toggle="dropdown" aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
<span class="fa fa-cog" aria-hidden="true"></span>
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{% if has_diagnostics or app_info.donation_url %}
|
||||
<!-- Single button -->
|
||||
<div class="btn-group button-extra-actions">
|
||||
<button type="button" class="btn btn-default dropdown-toggle"
|
||||
data-toggle="dropdown" aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
<span class="fa fa-cog" aria-hidden="true"></span>
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{% if has_diagnostics %}
|
||||
<li>
|
||||
{% include "diagnostics_button.html" with app_id=app_id enabled=is_enabled %}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if app_info.donation_url %}
|
||||
<li>
|
||||
<a target="_blank" rel="noopener noreferrer"
|
||||
href="{{ app_info.donation_url }}">
|
||||
{% trans "Donate" %}
|
||||
<span class="fa fa-external-link"></span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<div class="toolbar-collapsed-content">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user