mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
power: Use new setup mechanism
This commit is contained in:
parent
5e094934b0
commit
a33f68f051
@ -23,11 +23,20 @@ from django.utils.translation import ugettext_lazy as _
|
|||||||
|
|
||||||
from plinth import cfg
|
from plinth import cfg
|
||||||
|
|
||||||
|
version = 1
|
||||||
|
|
||||||
|
is_essential = True
|
||||||
|
|
||||||
depends = ['system']
|
depends = ['system']
|
||||||
|
|
||||||
|
title = _('Power')
|
||||||
|
|
||||||
|
description = [
|
||||||
|
_('Restart or shut down the system.')
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
"""Initialize the power module."""
|
"""Initialize the power module."""
|
||||||
menu = cfg.main_menu.get('system:index')
|
menu = cfg.main_menu.get('system:index')
|
||||||
menu.add_urlname(_('Power'), 'glyphicon-off',
|
menu.add_urlname(title, 'glyphicon-off', 'power:index', 1000)
|
||||||
'power:index', 1000)
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "app.html" %}
|
||||||
{% comment %}
|
{% comment %}
|
||||||
#
|
#
|
||||||
# This file is part of Plinth.
|
# This file is part of Plinth.
|
||||||
@ -21,13 +21,7 @@
|
|||||||
{% load bootstrap %}
|
{% load bootstrap %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block content %}
|
{% block configuration %}
|
||||||
|
|
||||||
<h2>{{ title }}</h2>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
{% blocktrans trimmed %}Restart or shut down the system.{% endblocktrans %}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a class="btn btn-default btn-md" href="{% url 'power:restart' %}">
|
<a class="btn btn-default btn-md" href="{% url 'power:restart' %}">
|
||||||
|
|||||||
@ -26,11 +26,14 @@ from django.template.response import TemplateResponse
|
|||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
from plinth import actions
|
from plinth import actions
|
||||||
|
from plinth.modules import power
|
||||||
|
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
"""Serve power controls page."""
|
"""Serve power controls page."""
|
||||||
return TemplateResponse(request, 'power.html', {'title': _('Power')})
|
return TemplateResponse(request, 'power.html',
|
||||||
|
{'title': power.title,
|
||||||
|
'description': power.description})
|
||||||
|
|
||||||
|
|
||||||
def restart(request):
|
def restart(request):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user