system: Use new setup mechanism

This commit is contained in:
Sunil Mohan Adapa 2016-02-12 18:22:21 +05:30
parent 4066a2f8d6
commit ecad252653
No known key found for this signature in database
GPG Key ID: 36C361440C9BC971
4 changed files with 29 additions and 36 deletions

View File

@ -19,8 +19,29 @@
Plinth module for system section page
"""
from . import system
from .system import init
from django.utils.translation import ugettext_lazy as _
from plinth import cfg
from plinth.utils import format_lazy
__all__ = ['system', 'init']
version = 1
is_essential = 1
title = _('System Configuration')
description = [
format_lazy(
_('Here you can administrate the underlying system of your '
'{box_name}.'), box_name=_(cfg.box_name)),
format_lazy(
_('The options affect the {box_name} at its most general level, '
'so be careful!'), box_name=_(cfg.box_name))
]
def init():
"""Initialize the system module"""
cfg.main_menu.add_urlname(title, 'glyphicon-cog', 'system:index', 100)

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'app.html' %}
{% comment %}
#
# This file is part of Plinth.
@ -17,25 +17,3 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
{% endcomment %}
{% load i18n %}
{% block content %}
<h2>{% trans "System Configuration" %}</h2>
<p>
{% blocktrans trimmed %}
Here you can administrate the underlying system of your
{{ box_name }}.
{% endblocktrans %}
</p>
<p>
{% blocktrans trimmed %}
The options affect the {{ box_name }} at its most general level,
so be careful!
{% endblocktrans %}
</p>
{% endblock %}

View File

@ -21,7 +21,7 @@ URLs for the System module
from django.conf.urls import url
from . import system as views
from . import views
urlpatterns = [

View File

@ -16,18 +16,12 @@
#
from django.template.response import TemplateResponse
from django.utils.translation import ugettext_lazy as _
from plinth import cfg
def init():
"""Initialize the system module"""
cfg.main_menu.add_urlname(_('System'), 'glyphicon-cog', 'system:index',
100)
from plinth.modules import system
def index(request):
"""Serve the index page"""
return TemplateResponse(request, 'system.html',
{'title': _('System Configuration')})
{'title': system.title,
'description': system.description})