mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
Minor changes for frontpage configure button
Remove unneeded gettext around configure URLs. Remove module-level variables for configure URLs. Just use it directly in add_shortcut(). Use reverse lookup for configure URLs. Check that configure_url is set before displaying. Change appearance of Configure link to a button.
This commit is contained in:
parent
8f147e4c7f
commit
69332a903d
@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
|
||||
- Added screenshots to Readme.
|
||||
- repro: Open up RTP ports.
|
||||
- Allow modules to register steps for first_boot.
|
||||
- frontpage: Show Configure button in service details, when user is logged in.
|
||||
|
||||
### Fixed
|
||||
- Upstream patch from Debian bug #837206 to fix DB and log file
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
Plinth module for minetest.
|
||||
"""
|
||||
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import actions
|
||||
@ -51,8 +52,6 @@ description = [
|
||||
'is needed.'), box_name=_(cfg.box_name)),
|
||||
]
|
||||
|
||||
configure_url = _('apps/minetest')
|
||||
|
||||
|
||||
def init():
|
||||
"""Initialize the module."""
|
||||
@ -77,7 +76,7 @@ def setup(helper, old_version=None):
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut('minetest', title, None, 'glyphicon-th-large',
|
||||
description, configure_url,
|
||||
description, reverse('minetest:index'),
|
||||
login_required=False)
|
||||
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
Plinth module to configure Mumble server
|
||||
"""
|
||||
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import actions
|
||||
@ -51,9 +52,6 @@ description = [
|
||||
]
|
||||
|
||||
|
||||
configure_url = _('apps/mumble')
|
||||
|
||||
|
||||
def init():
|
||||
"""Intialize the Mumble module."""
|
||||
menu = cfg.main_menu.get('apps:index')
|
||||
@ -83,7 +81,7 @@ def setup(helper, old_version=None):
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut('mumble', title, None, 'glyphicon-headphones',
|
||||
description, configure_url,
|
||||
description, reverse('mumble:index'),
|
||||
login_required=False)
|
||||
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
Plinth module to configure Privoxy.
|
||||
"""
|
||||
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import actions
|
||||
@ -58,8 +59,6 @@ description = [
|
||||
box_name=_(cfg.box_name)),
|
||||
]
|
||||
|
||||
configure_url = _('apps/privoxy')
|
||||
|
||||
service = None
|
||||
|
||||
|
||||
@ -87,7 +86,7 @@ def setup(helper, old_version=None):
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut('privoxy', title, None, 'glyphicon-cloud-upload',
|
||||
description, configure_url,
|
||||
description, reverse('privoxy:index'),
|
||||
login_required=True)
|
||||
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
Plinth module for Quassel.
|
||||
"""
|
||||
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import actions
|
||||
@ -58,8 +59,6 @@ description = [
|
||||
'are available.'),
|
||||
]
|
||||
|
||||
configure_url = _('apps/quassel')
|
||||
|
||||
|
||||
def init():
|
||||
"""Initialize the quassel module."""
|
||||
@ -90,7 +89,7 @@ def setup(helper, old_version=None):
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut('quassel', title, None, 'glyphicon-retweet',
|
||||
description, configure_url,
|
||||
description, reverse('quassel:index'),
|
||||
login_required=True)
|
||||
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ Plinth module for radicale.
|
||||
"""
|
||||
|
||||
import augeas
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import actions
|
||||
@ -51,8 +52,6 @@ description = [
|
||||
'login.'), box_name=_(cfg.box_name)),
|
||||
]
|
||||
|
||||
configure_url = _('apps/radicale')
|
||||
|
||||
CONFIG_FILE = '/etc/radicale/config'
|
||||
|
||||
|
||||
@ -80,7 +79,7 @@ def setup(helper, old_version=None):
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut('radicale', title, None, 'glyphicon-calendar',
|
||||
description, configure_url,
|
||||
description, reverse('radicale:index'),
|
||||
login_required=True)
|
||||
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
Plinth module for repro.
|
||||
"""
|
||||
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import actions
|
||||
@ -59,8 +60,6 @@ description = [
|
||||
'service and re-enable it.'),
|
||||
]
|
||||
|
||||
configure_url = _('apps/repro')
|
||||
|
||||
service = None
|
||||
|
||||
|
||||
@ -94,7 +93,7 @@ def setup(helper, old_version=None):
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut('repro', title, None, 'glyphicon-phone-alt',
|
||||
description, configure_url,
|
||||
description, reverse('repro:index'),
|
||||
login_required=True)
|
||||
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
Plinth module to configure XMPP server
|
||||
"""
|
||||
|
||||
from django.urls import reverse_lazy
|
||||
from django.urls import reverse, reverse_lazy
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
import logging
|
||||
import socket
|
||||
@ -52,8 +52,6 @@ description = [
|
||||
'>XMPP client</a>.'),
|
||||
]
|
||||
|
||||
configure_url = _('apps/xmpp')
|
||||
|
||||
service = None
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -96,7 +94,7 @@ def add_shortcut():
|
||||
reverse_lazy('xmpp:jsxc'), 'glyphicon-comment',
|
||||
None, login_required=True)
|
||||
frontpage.add_shortcut('xmpp', title, None, 'glyphicon-comment',
|
||||
description, configure_url,
|
||||
description, reverse('xmpp:index'),
|
||||
login_required=True)
|
||||
|
||||
|
||||
|
||||
@ -71,10 +71,10 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
<div class="panel-body">
|
||||
<a href="{{ configure_url }}">Configure</a>
|
||||
</div>
|
||||
{% if user.is_authenticated and configure_url %}
|
||||
<a class="btn btn-default btn-sm"
|
||||
href="{{ configure_url }}">
|
||||
{% trans "Configure »" %}</a>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user