From 96a14e3d0d94da451073a00213b15315f66d40d4 Mon Sep 17 00:00:00 2001 From: fonfon Date: Wed, 26 Nov 2014 10:50:32 +0100 Subject: [PATCH] moved 'in-app menu' from the sidebar to the top of the content; some template block renaming --- doc/themes.mdwn | 17 ++- plinth/__main__.py | 1 + plinth/modules/apps/templates/apps.html | 3 +- plinth/modules/config/templates/config.html | 2 +- .../diagnostics/templates/diagnostics.html | 3 +- .../templates/diagnostics_test.html | 2 +- plinth/modules/expert_mode/expert_mode.py | 7 +- .../expert_mode/templates/expert_mode.html | 4 +- .../modules/firewall/templates/firewall.html | 3 +- .../templates/firstboot_sidebar.html | 2 +- .../templates/firstboot_state0.html | 4 +- .../templates/firstboot_state10.html | 4 +- plinth/modules/first_boot/views.py | 10 +- plinth/modules/help/help.py | 10 +- .../templates/{about.html => help_about.html} | 13 +- .../help/templates/help_detail.html} | 13 +- .../templates/{help.html => help_index.html} | 3 +- .../modules/owncloud/templates/owncloud.html | 12 +- .../modules/packages/templates/packages.html | 7 +- plinth/modules/pagekite/pagekite.py | 26 ++-- .../templates/pagekite_configure.html | 2 +- .../templates/pagekite_introduction.html | 3 +- plinth/modules/system/templates/system.html | 4 +- plinth/modules/tor/templates/tor.html | 30 ++--- plinth/modules/users/templates/users_add.html | 6 +- .../modules/users/templates/users_edit.html | 24 ++-- plinth/modules/users/urls.py | 8 +- plinth/modules/users/users.py | 37 +++--- plinth/modules/xmpp/templates/xmpp.html | 24 +++- .../xmpp/templates/xmpp_configure.html | 4 +- .../modules/xmpp/templates/xmpp_register.html | 18 ++- plinth/modules/xmpp/xmpp.py | 26 ++-- plinth/templates/404.html | 7 +- plinth/templates/500.html | 7 +- plinth/templates/base.html | 111 ++++++++++-------- plinth/templates/login.html | 2 +- plinth/templates/submenu.html | 37 ++++++ static/themes/default/css/plinth.css | 9 -- 38 files changed, 266 insertions(+), 239 deletions(-) rename plinth/modules/help/templates/{about.html => help_about.html} (89%) rename plinth/{templates/menu_block.html => modules/help/templates/help_detail.html} (79%) rename plinth/modules/help/templates/{help.html => help_index.html} (98%) create mode 100644 plinth/templates/submenu.html diff --git a/doc/themes.mdwn b/doc/themes.mdwn index 9d95cbc73..3f5ae78c4 100644 --- a/doc/themes.mdwn +++ b/doc/themes.mdwn @@ -40,13 +40,12 @@ the title field. ### Layout -Plinth expects a `main` block. This is where the meat of the content -goes. It is the center pain in the default layout. There is a -`title` block that the program will fill with text describing the -current page. `sidebar_left` contains the submenu navigation menu, -and `sidebar_right` is where we put all short text that helps the -admin fill out forms. They don't have to be sidebars, and they don't -have to go on the left and right. +Plinth expects a `content` block. This is where the meat of the +content goes. It is the center pane in the default layout. There +is a `title` block that the program will fill with text describing +the current page. There are two bars on the left side: `submenu` +for the menu and `sidebar` where short help texts go. +The lowest layer in the navigation is `subsubmenu`, displayed on top +of the content pane. -It is possible to override the `footer`, but I haven't yet found a -reason to do so. +All these items are inside of blocks and can be overwritten. diff --git a/plinth/__main__.py b/plinth/__main__.py index 58b6a0fae..aa4079161 100644 --- a/plinth/__main__.py +++ b/plinth/__main__.py @@ -144,6 +144,7 @@ def configure_django(): 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', + 'django.core.context_processors.request', 'django.core.context_processors.static', 'django.core.context_processors.tz', 'django.contrib.messages.context_processors.messages', diff --git a/plinth/modules/apps/templates/apps.html b/plinth/modules/apps/templates/apps.html index 9dd2a0df2..a7f56629f 100644 --- a/plinth/modules/apps/templates/apps.html +++ b/plinth/modules/apps/templates/apps.html @@ -18,8 +18,9 @@ # {% endcomment %} -{% block main_block %} +{% block content %} +

Apps

User Applications are web apps hosted on your {{ cfg.product_name }}.

diff --git a/plinth/modules/config/templates/config.html b/plinth/modules/config/templates/config.html index ea4ed51a3..f38411fda 100644 --- a/plinth/modules/config/templates/config.html +++ b/plinth/modules/config/templates/config.html @@ -20,7 +20,7 @@ {% load bootstrap %} -{% block main_block %} +{% block content %} {% if is_expert %} diff --git a/plinth/modules/diagnostics/templates/diagnostics.html b/plinth/modules/diagnostics/templates/diagnostics.html index d9d1908ee..fd91b7fa3 100644 --- a/plinth/modules/diagnostics/templates/diagnostics.html +++ b/plinth/modules/diagnostics/templates/diagnostics.html @@ -18,7 +18,8 @@ # {% endcomment %} -{% block main_block %} +{% block content %} +

{{ title }}

The system diagnostic test will run a number of checks on your system to confirm that network services are running and configured diff --git a/plinth/modules/diagnostics/templates/diagnostics_test.html b/plinth/modules/diagnostics/templates/diagnostics_test.html index 04f5b0036..4a9a2fc60 100644 --- a/plinth/modules/diagnostics/templates/diagnostics_test.html +++ b/plinth/modules/diagnostics/templates/diagnostics_test.html @@ -18,7 +18,7 @@ # {% endcomment %} -{% block main_block %} +{% block content %} {% if diagnostics_error %}

The diagnostic test encountered an error:

diff --git a/plinth/modules/expert_mode/expert_mode.py b/plinth/modules/expert_mode/expert_mode.py index 14a62ec13..05eebd8ac 100644 --- a/plinth/modules/expert_mode/expert_mode.py +++ b/plinth/modules/expert_mode/expert_mode.py @@ -28,13 +28,14 @@ from plinth.modules.lib.auth import get_or_create_group class ExpertsForm(forms.Form): # pylint: disable-msg=W0232 """Form to configure expert mode""" expert_mode = forms.BooleanField( - label=_('Expert Mode'), required=False) + label=_('Enable Expert Mode'), required=False) def init(): """Initialize the module""" menu = cfg.main_menu.get('system:index') - menu.add_urlname(_('Expert Mode'), 'glyphicon-wrench', 'expert_mode:index', 10) + menu.add_urlname(_('Expert Mode'), 'glyphicon-wrench', + 'expert_mode:index', 10) @login_required @@ -70,7 +71,7 @@ def _apply_changes(request, new_status): expert_group = get_or_create_group('Expert') if new_status['expert_mode']: - if not expert_group in request.user.groups.all(): + if expert_group not in request.user.groups.all(): request.user.groups.add(expert_group) message = (messages.success, _('Expert mode enabled')) else: diff --git a/plinth/modules/expert_mode/templates/expert_mode.html b/plinth/modules/expert_mode/templates/expert_mode.html index 4f2bc1dec..122228b85 100644 --- a/plinth/modules/expert_mode/templates/expert_mode.html +++ b/plinth/modules/expert_mode/templates/expert_mode.html @@ -20,7 +20,9 @@ {% load bootstrap %} -{% block main_block %} +{% block content %} + +

{{ title }}

The {{ cfg.box_name }} can be administered in two modes, 'basic' and 'expert'. Basic mode hides a lot of features and configuration diff --git a/plinth/modules/firewall/templates/firewall.html b/plinth/modules/firewall/templates/firewall.html index 7e07e3241..509a3e8d0 100644 --- a/plinth/modules/firewall/templates/firewall.html +++ b/plinth/modules/firewall/templates/firewall.html @@ -18,7 +18,8 @@ # {% endcomment %} -{% block main_block %} +{% block content %} +

{{ title }}

Firewall is a network security system that controls the incoming and outgoing network traffic on your {{ cfg.box_name }}. Keeping a diff --git a/plinth/modules/first_boot/templates/firstboot_sidebar.html b/plinth/modules/first_boot/templates/firstboot_sidebar.html index 664bbb984..d4d5decc3 100644 --- a/plinth/modules/first_boot/templates/firstboot_sidebar.html +++ b/plinth/modules/first_boot/templates/firstboot_sidebar.html @@ -17,7 +17,7 @@ # {% endcomment %} -