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
|
||||
|
||||
version = 1
|
||||
|
||||
is_essential = True
|
||||
|
||||
depends = ['system']
|
||||
|
||||
title = _('Power')
|
||||
|
||||
description = [
|
||||
_('Restart or shut down the system.')
|
||||
]
|
||||
|
||||
|
||||
def init():
|
||||
"""Initialize the power module."""
|
||||
menu = cfg.main_menu.get('system:index')
|
||||
menu.add_urlname(_('Power'), 'glyphicon-off',
|
||||
'power:index', 1000)
|
||||
menu.add_urlname(title, 'glyphicon-off', 'power:index', 1000)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{% extends "base.html" %}
|
||||
{% extends "app.html" %}
|
||||
{% comment %}
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
@ -21,13 +21,7 @@
|
||||
{% load bootstrap %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h2>{{ title }}</h2>
|
||||
|
||||
<p>
|
||||
{% blocktrans trimmed %}Restart or shut down the system.{% endblocktrans %}
|
||||
</p>
|
||||
{% block configuration %}
|
||||
|
||||
<p>
|
||||
<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 plinth import actions
|
||||
from plinth.modules import power
|
||||
|
||||
|
||||
def index(request):
|
||||
"""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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user