mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
manual: Link to manual from each service
Closes #930 - Make targets to download wiki pages of each service - Add post-processor script for DocBook file processing Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
c6bccaaac0
commit
4064d6e231
128 files changed
+14994
-1539
No files matched your search
@@ -18,13 +18,13 @@
|
||||
FreedomBox app to configure system date and time.
|
||||
"""
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
import subprocess
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import service as service_module
|
||||
from plinth.menu import main_menu
|
||||
|
||||
|
||||
version = 1
|
||||
|
||||
is_essential = True
|
||||
@@ -40,6 +40,8 @@ description = [
|
||||
'in synchronization with servers on the Internet.')
|
||||
]
|
||||
|
||||
manual_page = 'DateTime'
|
||||
|
||||
service = None
|
||||
|
||||
|
||||
@@ -51,8 +53,8 @@ def init():
|
||||
global service
|
||||
setup_helper = globals()['setup_helper']
|
||||
if setup_helper.get_state() != 'needs-setup':
|
||||
service = service_module.Service(
|
||||
managed_services[0], name, ports=['ntp'], is_external=False)
|
||||
service = service_module.Service(managed_services[0], name,
|
||||
ports=['ntp'], is_external=False)
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
@@ -60,8 +62,8 @@ def setup(helper, old_version=None):
|
||||
helper.install(managed_packages)
|
||||
global service
|
||||
if service is None:
|
||||
service = service_module.Service(
|
||||
managed_services[0], name, ports=['ntp'], is_external=False)
|
||||
service = service_module.Service(managed_services[0], name,
|
||||
ports=['ntp'], is_external=False)
|
||||
helper.call('post', service.notify_enabled, None, True)
|
||||
|
||||
|
||||
|
||||
@@ -18,15 +18,17 @@
|
||||
FreedomBox app for configuring date and time.
|
||||
"""
|
||||
|
||||
from django.contrib import messages
|
||||
from django.utils.translation import ugettext as _
|
||||
import logging
|
||||
|
||||
from .forms import DateTimeForm
|
||||
from django.contrib import messages
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from plinth import actions
|
||||
from plinth.modules import datetime
|
||||
from plinth.views import ServiceView
|
||||
|
||||
from .forms import DateTimeForm
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -35,11 +37,14 @@ class DateTimeServiceView(ServiceView):
|
||||
form_class = DateTimeForm
|
||||
service_id = datetime.managed_services[0]
|
||||
diagnostics_module_name = "datetime"
|
||||
manual_page = datetime.manual_page
|
||||
|
||||
def get_initial(self):
|
||||
return {'is_enabled': self.service.is_enabled(),
|
||||
'is_running': self.service.is_running(),
|
||||
'time_zone': self.get_current_time_zone()}
|
||||
return {
|
||||
'is_enabled': self.service.is_enabled(),
|
||||
'is_running': self.service.is_running(),
|
||||
'time_zone': self.get_current_time_zone()
|
||||
}
|
||||
|
||||
def get_current_time_zone(self):
|
||||
"""Get current time zone."""
|
||||
@@ -53,12 +58,12 @@ class DateTimeServiceView(ServiceView):
|
||||
if old_status['time_zone'] != new_status['time_zone'] and \
|
||||
new_status['time_zone'] != 'none':
|
||||
try:
|
||||
actions.superuser_run(
|
||||
'timezone-change', [new_status['time_zone']])
|
||||
actions.superuser_run('timezone-change',
|
||||
[new_status['time_zone']])
|
||||
except Exception as exception:
|
||||
messages.error(
|
||||
self.request, _('Error setting time zone: {exception}')
|
||||
.format(exception=exception))
|
||||
messages.error(self.request,
|
||||
_('Error setting time zone: {exception}')
|
||||
.format(exception=exception))
|
||||
else:
|
||||
messages.success(self.request, _('Time zone set'))
|
||||
|
||||
|
||||
Reference in new issue
Block a user