mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
upgrades: Remove unnecessary subsubmenu
- Prefer toolbar button style instead of tabs. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
ad0552adf6
commit
1b86414488
@ -1,4 +1,4 @@
|
|||||||
{% extends 'app-subsubmenu.html' %}
|
{% extends 'base.html' %}
|
||||||
{% comment %}
|
{% comment %}
|
||||||
#
|
#
|
||||||
# This file is part of FreedomBox.
|
# This file is part of FreedomBox.
|
||||||
@ -32,7 +32,9 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
{% block configuration %}
|
{% block content %}
|
||||||
|
|
||||||
|
<h2>{{ title }}</h2>
|
||||||
|
|
||||||
{% if not is_busy %}
|
{% if not is_busy %}
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{% extends "app-subsubmenu.html" %}
|
{% extends "app.html" %}
|
||||||
{% comment %}
|
{% comment %}
|
||||||
#
|
#
|
||||||
# This file is part of FreedomBox.
|
# This file is part of FreedomBox.
|
||||||
@ -21,15 +21,9 @@
|
|||||||
{% load bootstrap %}
|
{% load bootstrap %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block configuration %}
|
{% block status %}
|
||||||
|
<a href="{% url 'upgrades:upgrade' %}" class="btn btn-default"
|
||||||
<form class="form" method="post">
|
role="button" title="{% trans 'Manual update' %}">
|
||||||
{% csrf_token %}
|
{% trans 'Manual update' %}
|
||||||
|
</a>
|
||||||
{{ form|bootstrap }}
|
|
||||||
|
|
||||||
<input type="submit" class="btn btn-primary btn-md"
|
|
||||||
value="{% trans "Update setup" %}"/>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -22,39 +22,26 @@ from django.contrib import messages
|
|||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
from django.utils.translation import ugettext_lazy
|
|
||||||
from django.views.generic.edit import FormView
|
from django.views.generic.edit import FormView
|
||||||
|
|
||||||
from plinth import actions
|
from plinth import actions
|
||||||
from plinth.errors import ActionError
|
from plinth.errors import ActionError
|
||||||
from plinth.modules import upgrades
|
from plinth.modules import upgrades
|
||||||
|
from plinth.views import AppView
|
||||||
|
|
||||||
from .forms import ConfigureForm
|
from .forms import ConfigureForm
|
||||||
|
|
||||||
subsubmenu = [{
|
|
||||||
'url': reverse_lazy('upgrades:index'),
|
|
||||||
'text': ugettext_lazy('Auto-update')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'url': reverse_lazy('upgrades:upgrade'),
|
|
||||||
'text': ugettext_lazy('Manual update')
|
|
||||||
}]
|
|
||||||
|
|
||||||
|
class UpgradesConfigurationView(AppView):
|
||||||
class UpgradesConfigurationView(FormView):
|
|
||||||
"""Serve configuration page."""
|
"""Serve configuration page."""
|
||||||
form_class = ConfigureForm
|
form_class = ConfigureForm
|
||||||
success_url = reverse_lazy('upgrades:index')
|
success_url = reverse_lazy('upgrades:index')
|
||||||
template_name = "upgrades_configure.html"
|
template_name = "upgrades_configure.html"
|
||||||
|
app_id = 'upgrades'
|
||||||
def get_context_data(self, *args, **kwargs):
|
name = upgrades.name
|
||||||
"""Return the context data for rendering the template view."""
|
description = upgrades.description
|
||||||
context = super().get_context_data(*args, **kwargs)
|
manual_page = upgrades.manual_page
|
||||||
context['subsubmenu'] = subsubmenu
|
show_status_block = False
|
||||||
context['title'] = upgrades.name
|
|
||||||
context['description'] = upgrades.description
|
|
||||||
context['manual_page'] = upgrades.manual_page
|
|
||||||
return context
|
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
return {'auto_upgrades_enabled': upgrades.is_enabled()}
|
return {'auto_upgrades_enabled': upgrades.is_enabled()}
|
||||||
@ -87,7 +74,7 @@ class UpgradesConfigurationView(FormView):
|
|||||||
else:
|
else:
|
||||||
messages.info(self.request, _('Settings unchanged'))
|
messages.info(self.request, _('Settings unchanged'))
|
||||||
|
|
||||||
return super().form_valid(form)
|
return FormView.form_valid(self, form)
|
||||||
|
|
||||||
|
|
||||||
def is_package_manager_busy():
|
def is_package_manager_busy():
|
||||||
@ -116,12 +103,8 @@ def upgrade(request):
|
|||||||
except ActionError:
|
except ActionError:
|
||||||
messages.error(request, _('Starting upgrade failed.'))
|
messages.error(request, _('Starting upgrade failed.'))
|
||||||
|
|
||||||
return TemplateResponse(
|
return TemplateResponse(request, 'upgrades.html', {
|
||||||
request, 'upgrades.html', {
|
'title': _('Manual update'),
|
||||||
'title': upgrades.name,
|
'is_busy': is_busy,
|
||||||
'description': upgrades.description,
|
'log': get_log()
|
||||||
'manual_page': upgrades.manual_page,
|
})
|
||||||
'subsubmenu': subsubmenu,
|
|
||||||
'is_busy': is_busy,
|
|
||||||
'log': get_log()
|
|
||||||
})
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user