names: Use new setup mechanism

This commit is contained in:
Sunil Mohan Adapa 2016-02-12 16:05:28 +05:30
parent 41e730d7ac
commit 0568bf259c
No known key found for this signature in database
GPG Key ID: 36C361440C9BC971
3 changed files with 12 additions and 7 deletions

View File

@ -31,8 +31,14 @@ SERVICES = (
('ssh', _('SSH'), 22),
)
version = 1
is_essential = True
depends = ['system']
title = _('Name Services')
domain_types = {}
domains = {}
@ -42,8 +48,7 @@ logger = logging.getLogger(__name__)
def init():
"""Initialize the names module."""
menu = cfg.main_menu.get('system:index')
menu.add_urlname(_('Name Services'), 'glyphicon-tag',
'names:index', 19)
menu.add_urlname(title, 'glyphicon-tag', 'names:index', 19)
domain_added.connect(on_domain_added)
domain_removed.connect(on_domain_removed)
@ -54,6 +59,7 @@ def on_domain_added(sender, domain_type, name='', description='',
"""Add domain to global list."""
if not domain_type:
return
domain_types[domain_type] = description
if not name:

View File

@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "app.html" %}
{% comment %}
#
# This file is part of Plinth.
@ -21,9 +21,7 @@
{% load bootstrap %}
{% load i18n %}
{% block content %}
<h2>{{ title }}</h2>
{% block configuration %}
<div class="row">
<div class="col-sm-5">

View File

@ -24,6 +24,7 @@ from django.utils.translation import ugettext as _
from . import SERVICES, get_domain_types, get_description
from . import get_domain, get_services_status
from plinth.modules import names
def index(request):
@ -31,7 +32,7 @@ def index(request):
status = get_status()
return TemplateResponse(request, 'names.html',
{'title': _('Name Services'),
{'title': names.title,
'status': status})