mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
names: Use new setup mechanism
This commit is contained in:
parent
41e730d7ac
commit
0568bf259c
@ -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:
|
||||
|
||||
@ -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">
|
||||
|
||||
@ -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})
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user