From eb646151206a0b8ee61ecf1945a6af2eab1ab505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 6 May 2015 18:17:13 +0200 Subject: [PATCH] backoffice: replace navigational tabs by a sidepage (#7284) --- data/print-html-as-pdf.js | 2 + wcs/backoffice/root.py | 6 +- wcs/qommon/static/css/dc2/gadjo.css | 111 +++++++++++++++++- .../css/dc2/small-icon-categories-hover.png | Bin 0 -> 360 bytes .../static/css/dc2/small-icon-categories.png | Bin 0 -> 359 bytes .../static/css/dc2/small-icon-forms-hover.png | Bin 0 -> 797 bytes .../static/css/dc2/small-icon-forms.png | Bin 0 -> 784 bytes .../static/css/dc2/small-icon-home-hover.png | Bin 0 -> 598 bytes wcs/qommon/static/css/dc2/small-icon-home.png | Bin 0 -> 608 bytes .../css/dc2/small-icon-management-hover.png | Bin 0 -> 635 bytes .../static/css/dc2/small-icon-management.png | Bin 0 -> 576 bytes .../static/css/dc2/small-icon-roles-hover.png | Bin 0 -> 669 bytes .../static/css/dc2/small-icon-roles.png | Bin 0 -> 658 bytes .../css/dc2/small-icon-settings-hover.png | Bin 0 -> 843 bytes .../static/css/dc2/small-icon-settings.png | Bin 0 -> 655 bytes .../css/dc2/small-icon-submission-hover.png | Bin 0 -> 487 bytes .../static/css/dc2/small-icon-submission.png | Bin 0 -> 447 bytes .../static/css/dc2/small-icon-users-hover.png | Bin 0 -> 467 bytes .../static/css/dc2/small-icon-users.png | Bin 0 -> 421 bytes .../css/dc2/small-icon-workflows-hover.png | Bin 0 -> 703 bytes .../static/css/dc2/small-icon-workflows.png | Bin 0 -> 646 bytes wcs/qommon/static/css/dc2/texture.png | Bin 0 -> 2418 bytes wcs/qommon/static/js/gadjo.sidepage.js | 19 +++ wcs/qommon/template.py | 10 +- 24 files changed, 141 insertions(+), 7 deletions(-) create mode 100644 wcs/qommon/static/css/dc2/small-icon-categories-hover.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-categories.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-forms-hover.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-forms.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-home-hover.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-home.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-management-hover.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-management.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-roles-hover.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-roles.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-settings-hover.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-settings.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-submission-hover.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-submission.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-users-hover.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-users.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-workflows-hover.png create mode 100644 wcs/qommon/static/css/dc2/small-icon-workflows.png create mode 100644 wcs/qommon/static/css/dc2/texture.png create mode 100644 wcs/qommon/static/js/gadjo.sidepage.js diff --git a/data/print-html-as-pdf.js b/data/print-html-as-pdf.js index d8ab46198..71b3491f1 100644 --- a/data/print-html-as-pdf.js +++ b/data/print-html-as-pdf.js @@ -12,7 +12,9 @@ page.paperSize = { page.open(system.args[1], function() { x = page.evaluate(function() { $('#top, #header, #sidebar, #sidebar-toggle, #breadcrumb, a.back').hide(); + $('#sidepage, #main').removeClass('sidepage-expanded'); $('html').css('background', 'white').css('font-size', '8pt'); + $('div#main').css('width', '95%'); $('div#main-content').css('width', '95%').css('border', 'none'); }); page.render(system.args[1] + '.pdf'); diff --git a/wcs/backoffice/root.py b/wcs/backoffice/root.py index f6b7706d1..e973a12c2 100644 --- a/wcs/backoffice/root.py +++ b/wcs/backoffice/root.py @@ -68,7 +68,7 @@ class RootDirectory(BackofficeRootDirectory): ] def _q_traverse(self, path): - get_response().add_javascript(['jquery.js']) + get_response().add_javascript(['jquery.js', 'gadjo.sidepage.js']) return super(RootDirectory, self)._q_traverse(path) @classmethod @@ -139,7 +139,7 @@ class RootDirectory(BackofficeRootDirectory): return _('''Welcome.''') def generate_header_menu(self, selected=None): - s = ['