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