From ec7ae92d899d9d5253c5bf1142340c339daee516 Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Wed, 13 Feb 2019 08:41:54 +0530 Subject: [PATCH] ikiwiki: Move subsubmenu below description Signed-off-by: Joseph Nuthalapati Reviewed-by: Sunil Mohan Adapa --- .../ikiwiki/templates/ikiwiki_configure.html | 42 +++++++++++++++++++ .../ikiwiki/templates/ikiwiki_create.html | 5 ++- .../ikiwiki/templates/ikiwiki_delete.html | 6 +-- .../ikiwiki/templates/ikiwiki_manage.html | 19 +++++---- plinth/modules/ikiwiki/views.py | 35 +++++++++++----- 5 files changed, 82 insertions(+), 25 deletions(-) create mode 100644 plinth/modules/ikiwiki/templates/ikiwiki_configure.html diff --git a/plinth/modules/ikiwiki/templates/ikiwiki_configure.html b/plinth/modules/ikiwiki/templates/ikiwiki_configure.html new file mode 100644 index 000000000..8b085396e --- /dev/null +++ b/plinth/modules/ikiwiki/templates/ikiwiki_configure.html @@ -0,0 +1,42 @@ +{% extends "service-subsubmenu.html" %} +{% comment %} +# +# This file is part of FreedomBox. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +{% endcomment %} + +{% load bootstrap %} +{% load i18n %} + +{% block configuration %} +

{% trans "Configuration" %}

+ + {% block diagnostics %} + {% if diagnostics_module_name %} + {% include "diagnostics_button.html" with module=diagnostics_module_name enabled=service.is_enabled %} + {% endif %} + {% endblock %} + +
+ {% csrf_token %} + + {{ form|bootstrap }} + + +
+ +{% endblock %} diff --git a/plinth/modules/ikiwiki/templates/ikiwiki_create.html b/plinth/modules/ikiwiki/templates/ikiwiki_create.html index 8194f4096..64eb28ba4 100644 --- a/plinth/modules/ikiwiki/templates/ikiwiki_create.html +++ b/plinth/modules/ikiwiki/templates/ikiwiki_create.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "service-subsubmenu.html" %} {% comment %} # # This file is part of FreedomBox. @@ -21,7 +21,8 @@ {% load bootstrap %} {% load i18n %} -{% block content %} +{% block configuration %} +

{% trans "Create Wiki or Blog" %}

{% csrf_token %} diff --git a/plinth/modules/ikiwiki/templates/ikiwiki_delete.html b/plinth/modules/ikiwiki/templates/ikiwiki_delete.html index 79c560a41..aa01065d8 100644 --- a/plinth/modules/ikiwiki/templates/ikiwiki_delete.html +++ b/plinth/modules/ikiwiki/templates/ikiwiki_delete.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "service-subsubmenu.html" %} {% comment %} # # This file is part of FreedomBox. @@ -21,7 +21,7 @@ {% load bootstrap %} {% load i18n %} -{% block content %} +{% block configuration %}

{% blocktrans trimmed %} @@ -40,7 +40,7 @@ {% csrf_token %} - - .wiki-label { - display: inline-block; - width: 40%; - } - .list-group-item .btn { - margin: -5px 0; - } + .wiki-label { + display: inline-block; + width: 40%; + } + .list-group-item .btn { + margin: -5px 0; + } {% endblock %} -{% block content %} +{% block configuration %} +

{% trans "Manage Wikis and Blogs" %}

diff --git a/plinth/modules/ikiwiki/views.py b/plinth/modules/ikiwiki/views.py index b6f7eba69..e4adfd238 100644 --- a/plinth/modules/ikiwiki/views.py +++ b/plinth/modules/ikiwiki/views.py @@ -48,12 +48,15 @@ class IkiwikiServiceView(views.ServiceView): description = ikiwiki.description diagnostics_module_name = "ikiwiki" show_status_block = False + template_name = "ikiwiki_configure.html" def get_context_data(self, **kwargs): """Return the context data for rendering the template view.""" context = super().get_context_data(**kwargs) + context['title'] = ikiwiki.name context['subsubmenu'] = subsubmenu context['clients'] = ikiwiki.clients + context['manual_page'] = ikiwiki.manual_page return context @@ -64,7 +67,10 @@ def manage(request): return TemplateResponse( request, 'ikiwiki_manage.html', { - 'title': _('Manage Wikis and Blogs'), + 'title': ikiwiki.name, + 'clients': ikiwiki.clients, + 'description': ikiwiki.description, + 'manual_page': ikiwiki.manual_page, 'subsubmenu': subsubmenu, 'sites': sites }) @@ -97,10 +103,12 @@ def create(request): return TemplateResponse( request, 'ikiwiki_create.html', { - 'title': _('Create Wiki or Blog'), + 'title': ikiwiki.name, + 'clients': ikiwiki.clients, + 'description': ikiwiki.description, 'form': form, - 'subsubmenu': subsubmenu, 'manual_page': ikiwiki.manual_page, + 'subsubmenu': subsubmenu, }) @@ -142,14 +150,19 @@ def delete(request, name): messages.success(request, _('{name} deleted.').format(name=name)) frontpage.remove_shortcut('ikiwiki_' + name) except actions.ActionError as error: - messages.error(request, - _('Could not delete {name}: {error}').format( - name=name, error=error)) + messages.error( + request, + _('Could not delete {name}: {error}').format( + name=name, error=error)) return redirect(reverse_lazy('ikiwiki:manage')) - return TemplateResponse(request, 'ikiwiki_delete.html', { - 'title': _('Delete Wiki or Blog'), - 'subsubmenu': subsubmenu, - 'name': name - }) + return TemplateResponse( + request, 'ikiwiki_delete.html', { + 'title': ikiwiki.name, + 'clients': ikiwiki.clients, + 'description': ikiwiki.description, + 'manual_page': ikiwiki.manual_page, + 'subsubmenu': subsubmenu, + 'name': name + })