From 333cd4e9772cf06d9f2c6447cd9ea6899fef2f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 17 Nov 2018 13:07:08 +0100 Subject: [PATCH] backoffice: move lateral view links to top actions (#28104) --- wcs/backoffice/management.py | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/wcs/backoffice/management.py b/wcs/backoffice/management.py index a9e0e72cc..de7b18f5c 100644 --- a/wcs/backoffice/management.py +++ b/wcs/backoffice/management.py @@ -494,9 +494,23 @@ class ManagementDirectory(Directory): if user.is_admin or formdef.is_of_concern_for_user(user): append_form_entry(formdef) + def top_action_links(r): + r += htmltext('') + if get_publisher().is_using_postgresql() and \ + get_publisher().get_site_option('postgresql_views') != 'false': + r += htmltext('%s') % _('Global View') + if get_publisher().has_site_option('per-user-view'): + r += htmltext(' %s') % _('Per User View') + for formdef in formdefs: + if formdef.geolocations: + r += htmltext(' %s') % _('Map View') + break + r += htmltext('') + if forms_with_pending_stuff: r += htmltext('
') r += htmltext('

%s

') % _('Forms in your care') + top_action_links(r) r += htmltext('
') r += htmltext('
') r += self.display_forms(forms_with_pending_stuff) @@ -505,30 +519,29 @@ class ManagementDirectory(Directory): if forms_without_pending_stuff: r += htmltext('
') r += htmltext('

%s

') % _('Other Forms') + if not forms_without_pending_stuff: + top_action_links(r) r += htmltext('
') r += htmltext('
') r += self.display_forms(forms_without_pending_stuff) r += htmltext('
') + if not (forms_with_pending_stuff or forms_without_pending_stuff): + r += htmltext('
') + r += htmltext('

%s

') % _('Forms') + top_action_links(r) + r += htmltext('
') + return r.getvalue() def get_sidebar(self, formdefs): r = TemplateIO(html=True) + r += self.get_lookup_sidebox() r += htmltext('
') r += htmltext('') r += htmltext('
') - r += self.get_lookup_sidebox() return r.getvalue() def lookup(self): -- 2.19.1