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:
James Valleroy committed 2016-11-21 19:13:23 -05:00
1 parent 8f147e4c7f
commit 69332a903d
9 files changed
+19 -27

No files matched your search

+2 -3
View 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)
+2 -4
View File
@@ -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)
+2 -3
View File
@@ -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)
+2 -3
View File
@@ -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)
+2 -3
View File
@@ -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)
+2 -3
View File
@@ -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)
+2 -4
View File
@@ -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)