Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style ZMI using Bootstrap #249

Merged
merged 302 commits into from Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
302 commits
Select commit Hold shift + click to select a range
8e3f792
class prefixes added.
May 18, 2018
4ad8ae8
Rework of mainUser to use bootstrap
May 18, 2018
4108768
Rework of listLocalRoles to use bootstrap
May 18, 2018
e6b5609
make ImportExport page use boostrap.
May 18, 2018
ab741ec
make ImageAdd use boostrap
May 18, 2018
cad1590
make forms to add folders and ordered folders use bootrap
May 18, 2018
af8d873
make find forms use bootstrap
May 18, 2018
5dd3042
ZMI
drfho May 18, 2018
1caf099
Merge branch 'zmi-bootstrap' of https://github.com/zopefoundation/Zop…
drfho May 18, 2018
190d6e3
Switch to fontawesome icons
dwt May 22, 2018
8bd410f
Forgot one icon
dwt May 22, 2018
b45df0c
make fileEdit and imageEdit look more alike
May 24, 2018
0e7ee39
Rework userForms to use bootstrap
May 24, 2018
2b16912
finalize basic bootstrap usage for the main zmi forms in dtml
May 24, 2018
4897e20
rework zpt manage forms to use boostrap
May 24, 2018
8ba0e8b
fix docs
May 25, 2018
f961720
Add missing branch to sources.cfg
dwt May 28, 2018
001ca18
Merge branch 'zmi-bootstrap' of github.com:zopefoundation/Zope into z…
dwt May 28, 2018
4e35e5d
Merge branch 'zmi-bootstrap' of https://github.com/zopefoundation/Zop…
May 28, 2018
17a94c0
Switch to requiring the full repository path, so the requirements fil…
dwt May 29, 2018
7874941
Also require zctalog, as we're also working on restyling it.
dwt May 29, 2018
2a2a052
Disable ZCTextIndex as it’s empty anyway and seems to break my pip in…
dwt May 29, 2018
2323f24
ZMI
drfho Jun 1, 2018
d45ba77
ZMI
drfho Jun 1, 2018
dcd386f
new layout for the bindings page
Jun 4, 2018
d3243fb
make zpt manage pages container-fluid
Jun 4, 2018
b3a0885
ZMI: started aggregating find forms
drfho Jun 5, 2018
f4d1206
Merge branch 'zmi-bootstrap' of https://github.com/zopefoundation/Zop…
drfho Jun 5, 2018
71820bb
include fanstatic into wsgi pipeline
Jan 31, 2018
9d9deca
remove not needed js.jquery
Jan 31, 2018
ba399b4
Add bootstrap support.
Jan 31, 2018
61b4b2a
Require the bootstrap assets on each page via the header template.
Jan 31, 2018
7ce28ef
Style the tabs with bootstrap.
Jan 31, 2018
2fb6fbf
Switch back to tabs which are actually nicer.
Feb 2, 2018
1da4859
Convert to bootstrap.
Feb 2, 2018
e455ce8
Convert to bootstrap.
Feb 2, 2018
8d52658
use icons provided by zmi.icons package
Feb 2, 2018
8c5ca13
Finish styling of folder listing.
Feb 2, 2018
f983186
Re-implement template using ZPT instead of DTML.
Feb 5, 2018
63d7d04
Render breadcrumbs using bootstrap.
Feb 5, 2018
0945fe6
Fix condition for rendering copy/cut/paste buttons.
Feb 5, 2018
9a7abe2
Move the checkbox next to the icon.
Feb 5, 2018
cbd18c9
Add icons for all TTW installable types.
Feb 5, 2018
221233a
Style the message using Bootstrap.
Feb 5, 2018
3fdb488
Convert the property tab to bootstrap.
sallner Feb 6, 2018
62c97af
Add more packages which need a release after this branch is merged.
Feb 6, 2018
842c56d
Document usage of the new icons.
Feb 6, 2018
f9a59b3
Re-indent.
sallner Feb 6, 2018
91eaf6f
Reduce whitespaces.
sallner Feb 6, 2018
a09bbce
Convert to bootstrap.
sallner Feb 6, 2018
f3a2b8f
Add ability to add custom CSS and JavaScript to the ZMI.
Feb 6, 2018
201b803
Include a check all checkbox in folder listings.
sallner Feb 7, 2018
7437767
Remove old ZMI CSS.
Feb 7, 2018
dfea303
Sketch possible solution without fanstatic.
Feb 7, 2018
9d5ac0a
Render broken objects + allow to delete them.
Feb 9, 2018
3fb3027
Remove leftovers of fanstatic integration.
Feb 9, 2018
9535826
Clean-up.
Feb 9, 2018
34d7736
Remove one more fanstatic leftover.
Feb 9, 2018
ec7e07e
This is no longer needed.
Feb 9, 2018
a0d710c
Add ability to customise the CSS and JS in ZMI via Properties.
Feb 9, 2018
cfb0654
Add generic class to ease targeting only ZMI specific stuff via CSS
dwt May 16, 2018
76ba7a2
Rework Image manage_main html code to use bootstrap.
dwt May 16, 2018
53e2234
Fix test on python3 (now they insert unicode strings instead of b str…
dwt May 17, 2018
de5dd4b
Make Item a subclass of Navigation
dwt May 17, 2018
94faabc
Generify creation of describing classes to make it easy to target spe…
dwt May 17, 2018
2b6946c
Change requirements to reflect the versions actually required.
dwt May 17, 2018
60d9340
Update dependencies to ease working on the branch
dwt May 17, 2018
2c5404e
Comment double dependencies
dwt May 17, 2018
907b916
Update icon font to new prefix.
dwt May 17, 2018
176b93c
Simplify ‚Add type‘ popup in folder view.
dwt May 17, 2018
d87843e
Rework userFolderProps html code to use bootstrap
May 17, 2018
c49595b
Rework reportUserPermissions html code to use bootstrap
May 17, 2018
da44f34
Rework renameForm html code to use bootstrap
May 17, 2018
accd0c6
revised manage_access-Template according to bootstrap/css
May 17, 2018
9d49120
ZMI
drfho May 17, 2018
f21e30f
changed renameForm to the two column standard
May 18, 2018
d5d62a8
minor changes in the properties page to fit the standard
May 18, 2018
6704e39
Rework methodAdd Form to use bootstrap.
May 18, 2018
7da9a0d
ZMI
drfho May 18, 2018
c5d45ba
class prefixes added.
May 18, 2018
6f9e778
Rework of mainUser to use bootstrap
May 18, 2018
54da1c2
Rework of listLocalRoles to use bootstrap
May 18, 2018
90bf8fc
make ImportExport page use boostrap.
May 18, 2018
d24376d
make ImageAdd use boostrap
May 18, 2018
69e0a80
make forms to add folders and ordered folders use bootrap
May 18, 2018
e086d00
make find forms use bootstrap
May 18, 2018
da5cbe4
ZMI
drfho May 18, 2018
6f7b0d2
Switch to fontawesome icons
dwt May 22, 2018
9b5d4c3
Forgot one icon
dwt May 22, 2018
f71376e
make fileEdit and imageEdit look more alike
May 24, 2018
f0ff084
Rework userForms to use bootstrap
May 24, 2018
2a2aaa6
finalize basic bootstrap usage for the main zmi forms in dtml
May 24, 2018
7652dbf
rework zpt manage forms to use boostrap
May 24, 2018
149e0d3
fix docs
May 25, 2018
42cd290
Add missing branch to sources.cfg
dwt May 28, 2018
2fad729
Switch to requiring the full repository path, so the requirements fil…
dwt May 29, 2018
18f41c9
Also require zctalog, as we're also working on restyling it.
dwt May 29, 2018
4cb82a9
Disable ZCTextIndex as it’s empty anyway and seems to break my pip in…
dwt May 29, 2018
8481798
ZMI
drfho Jun 1, 2018
a1d64a7
ZMI
drfho Jun 1, 2018
119a5c4
new layout for the bindings page
Jun 4, 2018
47faf7b
make zpt manage pages container-fluid
Jun 4, 2018
cb4aa11
ZMI: started aggregating find forms
drfho Jun 5, 2018
e00982e
Regenerate dependency file and place extra dependencies into it’s own…
dwt Jun 5, 2018
f7bb2cd
started with menu
drfho Jun 7, 2018
59ecc12
proceeded with menu
drfho Jun 7, 2018
60d7e8a
improved spacing of objectItems list, object selection, locked icon
Jun 8, 2018
bb65a91
added name filter input element to objectItems list
Jun 8, 2018
c76ebe4
removed obsolete find-methods, revised TAL-Editor GUI
Jun 10, 2018
a83a5ea
added nicer file upload GUI
Jun 11, 2018
793db1d
reset breadcrumb nav to usual way
Jun 12, 2018
3802758
reset locked icon title to original
Jun 12, 2018
c20dd3b
include fanstatic into wsgi pipeline
Jan 31, 2018
a0d923f
remove not needed js.jquery
Jan 31, 2018
2358572
Add bootstrap support.
Jan 31, 2018
229363e
Require the bootstrap assets on each page via the header template.
Jan 31, 2018
773adba
Style the tabs with bootstrap.
Jan 31, 2018
32422ab
Switch back to tabs which are actually nicer.
Feb 2, 2018
acbe1ed
Convert to bootstrap.
Feb 2, 2018
fc495a5
Convert to bootstrap.
Feb 2, 2018
8fe2882
use icons provided by zmi.icons package
Feb 2, 2018
53bbb65
Finish styling of folder listing.
Feb 2, 2018
7172f07
Re-implement template using ZPT instead of DTML.
Feb 5, 2018
0ad2f9f
Render breadcrumbs using bootstrap.
Feb 5, 2018
3260777
Fix condition for rendering copy/cut/paste buttons.
Feb 5, 2018
a36d4c7
Move the checkbox next to the icon.
Feb 5, 2018
0b4a757
Add icons for all TTW installable types.
Feb 5, 2018
bdbb0ec
Style the message using Bootstrap.
Feb 5, 2018
2ab4841
Convert the property tab to bootstrap.
sallner Feb 6, 2018
82b3f9b
Add more packages which need a release after this branch is merged.
Feb 6, 2018
b2ed971
Document usage of the new icons.
Feb 6, 2018
d50747f
Re-indent.
sallner Feb 6, 2018
06db385
Reduce whitespaces.
sallner Feb 6, 2018
fb3a39e
Convert to bootstrap.
sallner Feb 6, 2018
13a11da
Add ability to add custom CSS and JavaScript to the ZMI.
Feb 6, 2018
ff9aadd
Include a check all checkbox in folder listings.
sallner Feb 7, 2018
c263311
Remove old ZMI CSS.
Feb 7, 2018
7b7e7dd
Sketch possible solution without fanstatic.
Feb 7, 2018
7ebdd63
Render broken objects + allow to delete them.
Feb 9, 2018
5710181
Remove leftovers of fanstatic integration.
Feb 9, 2018
1976d28
Clean-up.
Feb 9, 2018
af61cd5
Remove one more fanstatic leftover.
Feb 9, 2018
240eff0
This is no longer needed.
Feb 9, 2018
f800075
Add ability to customise the CSS and JS in ZMI via Properties.
Feb 9, 2018
03ada7e
Add generic class to ease targeting only ZMI specific stuff via CSS
dwt May 16, 2018
20ded23
Rework Image manage_main html code to use bootstrap.
dwt May 16, 2018
dc2e5b6
Fix test on python3 (now they insert unicode strings instead of b str…
dwt May 17, 2018
34982f1
Make Item a subclass of Navigation
dwt May 17, 2018
7c25681
Generify creation of describing classes to make it easy to target spe…
dwt May 17, 2018
2372aab
Change requirements to reflect the versions actually required.
dwt May 17, 2018
a2502de
Update dependencies to ease working on the branch
dwt May 17, 2018
c959d57
Comment double dependencies
dwt May 17, 2018
3e061d5
Update icon font to new prefix.
dwt May 17, 2018
b565958
Simplify ‚Add type‘ popup in folder view.
dwt May 17, 2018
5fb45f5
Rework userFolderProps html code to use bootstrap
May 17, 2018
cd6ab78
Rework reportUserPermissions html code to use bootstrap
May 17, 2018
7118226
Rework renameForm html code to use bootstrap
May 17, 2018
bbf7492
revised manage_access-Template according to bootstrap/css
May 17, 2018
dd45538
ZMI
drfho May 17, 2018
95733d8
changed renameForm to the two column standard
May 18, 2018
0f093dc
minor changes in the properties page to fit the standard
May 18, 2018
25f3bf3
Rework methodAdd Form to use bootstrap.
May 18, 2018
7bbe622
ZMI
drfho May 18, 2018
8cfcdf6
class prefixes added.
May 18, 2018
56d4aee
Rework of mainUser to use bootstrap
May 18, 2018
ab7018c
Rework of listLocalRoles to use bootstrap
May 18, 2018
b695fcb
make ImportExport page use boostrap.
May 18, 2018
9f4dece
make ImageAdd use boostrap
May 18, 2018
3eed77f
make forms to add folders and ordered folders use bootrap
May 18, 2018
6647a18
make find forms use bootstrap
May 18, 2018
e220d04
ZMI
drfho May 18, 2018
988ce63
Switch to fontawesome icons
dwt May 22, 2018
1908efe
Forgot one icon
dwt May 22, 2018
0f072b5
make fileEdit and imageEdit look more alike
May 24, 2018
a4c9904
Rework userForms to use bootstrap
May 24, 2018
2f0947b
finalize basic bootstrap usage for the main zmi forms in dtml
May 24, 2018
af04995
rework zpt manage forms to use boostrap
May 24, 2018
879ff6a
fix docs
May 25, 2018
727e225
Add missing branch to sources.cfg
dwt May 28, 2018
58c5fd8
Switch to requiring the full repository path, so the requirements fil…
dwt May 29, 2018
6f2034e
Also require zctalog, as we're also working on restyling it.
dwt May 29, 2018
4b7e141
Disable ZCTextIndex as it’s empty anyway and seems to break my pip in…
dwt May 29, 2018
4e8f4aa
ZMI
drfho Jun 1, 2018
d44ce35
ZMI
drfho Jun 1, 2018
02e72d4
new layout for the bindings page
Jun 4, 2018
a12f413
make zpt manage pages container-fluid
Jun 4, 2018
556d4b6
ZMI: started aggregating find forms
drfho Jun 5, 2018
4a07443
started with menu
drfho Jun 7, 2018
18a3d27
Regenerate dependency file and place extra dependencies into it’s own…
dwt Jun 5, 2018
7941e51
proceeded with menu
drfho Jun 7, 2018
f000b75
improved spacing of objectItems list, object selection, locked icon
Jun 8, 2018
fa475e2
added name filter input element to objectItems list
Jun 8, 2018
7752959
removed obsolete find-methods, revised TAL-Editor GUI
Jun 10, 2018
94ce61d
added nicer file upload GUI
Jun 11, 2018
7cec03f
reset breadcrumb nav to usual way
Jun 12, 2018
8d69461
reset locked icon title to original
Jun 12, 2018
19dd7f0
Merge branch 'zmi-bootstrap' of https://github.com/zopefoundation/Zop…
Jun 12, 2018
718463e
proceeded with manage_menu, added more monotony
Jun 13, 2018
828756f
added zmi_icons
Jun 13, 2018
21d99b9
zmi: added header-navbar
Jun 14, 2018
a7bd483
using modal dialog for adding objects
Jun 16, 2018
6ac52aa
cleaned/monotonized zmi-dtmls
Jun 18, 2018
b82f315
made database manager accessible/navigable
Jun 18, 2018
ffc32ef
added control panel link to navbar
Jun 18, 2018
52c1e54
monotonized broken-icon
Jun 18, 2018
477e139
Bootstrap has no longer Twitter in its name. Thank you @jcbrand for t…
Jun 19, 2018
718b81a
Using `lines` is – at least currently – broken.
Jun 19, 2018
4287c7f
Restore contents of `requirements.txt`, fix `versions-prod.cfg`, so i…
Jun 19, 2018
31e0fc3
zmi: added style quickfix for ancient forms
Jun 19, 2018
c40c2f6
Update link to bootstrap documentation to currently used version.
dwt Jun 19, 2018
d8901f6
cleaned HTML/icons, fixed object insertation url for modal dialog
Jun 19, 2018
12dee54
Remove personal preferences and ignore them.
Jun 20, 2018
5e58f45
Remove duplicate lines.
Jun 20, 2018
266e2e2
Fix typo.
Jun 20, 2018
94d3e96
Merge branch 'zmi-bootstrap' of github.com:zopefoundation/Zope into z…
dwt Jun 20, 2018
1738dfb
made object list table sortable
Jun 20, 2018
49deec4
UX: added simple combo-box like gui element to local role assignment
Jun 21, 2018
dedb548
added sorting markers to objectItems list
Jun 21, 2018
62966ad
UX: object list sorting gui; revised sorting key names
Jun 21, 2018
3994f83
fixed bootstrap file chooser gui element
Jun 21, 2018
5779518
Catch more specific exceptions.
Jun 22, 2018
07ca308
fix breadcrumbs, cleaned html
Jun 22, 2018
6f0ab8a
Merge branch 'zmi-bootstrap' of https://github.com/zopefoundation/Zop…
Jun 22, 2018
df25a31
added responsiveness to navbar and tabs-menu
Jun 24, 2018
e015949
phone view: tab menu as vertical overlay, added type names in
Jun 25, 2018
3cf76d8
phone view: tab menu as vertical overlay, added type names in
Jun 25, 2018
550a702
Merge branch 'zmi-bootstrap' of
Jun 25, 2018
f623ff1
made file uploader form element work with long names on small screens
Jun 26, 2018
eb68bf2
optimized db info page for small screens
Jun 27, 2018
a585a7f
added favicons, proceded with Zcatalog
Jun 28, 2018
bd380a5
Remove debugging code and fix tailing whitespace.
Jun 29, 2018
7a0bbb9
refactored python_script templates, cleaned white-space
Jun 29, 2018
855c7d6
optimized tab nav for phone view
Jul 1, 2018
ccb1a33
removed dtml artefact
Jul 6, 2018
381c76a
Don't trigger the search function when modifiers are pressed.
dwt Jul 10, 2018
3b02756
Simplify script tags (this is html5 after all)
dwt Jul 10, 2018
52f258f
Auto open the currently shown item on enter if there is only one item.
dwt Jul 10, 2018
f75ede6
added attr data-contenttype for code editor
Jul 11, 2018
c41a655
refined data-contenttype for code editor
Jul 11, 2018
35a04d6
fixed white-space, changed alert semantics
Jul 13, 2018
637d877
Merge branch 'master' into zmi-bootstrap
Aug 17, 2018
260140a
Fix HTML markup and tests.
Aug 17, 2018
8c116c4
Fix tailing whitespace.
Aug 17, 2018
de6f3b4
Fix NameError.
Aug 17, 2018
a1f8b50
Use master branches after merge.
Aug 17, 2018
c04a0b6
Clean-up and fix documentation.
Aug 17, 2018
00845e4
Clean up requirements.
Aug 17, 2018
95fd7ee
MailHost ist now ready, too.
Aug 17, 2018
47f75a2
Add more Products which needed releases together with the next Zope r…
Aug 17, 2018
27fb7e9
Add a version pin needed by BTreeFolder2 >= 4.0.1
Aug 17, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -5,6 +5,8 @@
.coverage.*
.installed*.cfg
.mr.developer.cfg
.project
.pydevproject
.tox
/bin/
/build/
Expand Down
12 changes: 11 additions & 1 deletion buildout.cfg
@@ -1,6 +1,5 @@
[buildout]
extensions = mr.developer

allow-picked-versions = false
develop = .
extends =
Expand All @@ -20,6 +19,17 @@ parts =
requirements
sources-dir = develop
auto-checkout =
zmi.styles
Persistence
AccessControl
Products.BTreeFolder2
Products.ZCatalog
RestrictedPython
Products.MailHost
Products.PythonScripts
Products.Sessions
Products.TemporaryFolder
Products.SiteErrorLog

[testenv]
PYTHONHASHSEED = random
Expand Down
8 changes: 8 additions & 0 deletions docs/WHATSNEW.rst
Expand Up @@ -143,3 +143,11 @@ Zope 4 depends on a new DateTime release. The new release has been optimized
for better memory use. Applications using a lot of DateTime values like the
Plone CMS have seen total memory usage to decrease by 10% to 20% for medium
to large deployments.


ZMI overhaul
------------

The ZMI (Zope Management Interface) is now styled with Bootstrap.
See :ref:`ZMI-label` for details how to adapt Zope add-on packages to the new
styling.
100 changes: 100 additions & 0 deletions docs/ZMI.rst
@@ -0,0 +1,100 @@
.. _ZMI-label:

ZMI
===

ZMI is an abbreviation for `Zope Management Interface`. This is the user
interface rendered when accessing Zope`s management screens using a web
browser.

Bootstrap ZMI
-------------

Since Zope 4.0b6 the ZMI is styled using Bootstrap. The previously used
GIF icons were replaced by font glyphs which are stored in the package
`zmi.styles`_ together with the CSS and JavaScript needed by Bootstrap.

The free Font Awesome glyphs are used as icons, see the table of
`available icons`_.

Update packages
+++++++++++++++

If you have a Product or package which contains types, which can be added via
the ZMI, the default icon will be shown.

To use one of the new icons add an attribute named ``zmi_icon`` to the class.
As value use a name listed on `available icons`_ prefixed by ``fas fa-``.
Example to use the info icon (i in a circle)::

zmi_icon = 'fas fa-info-circle'

.. _`zmi.styles` : https://github.com/zopefoundation/zmi.styles
.. _`available icons` : https://fontawesome.com/icons?d=gallery&m=free

Use custom icons and resources
++++++++++++++++++++++++++++++

To use custom icons (which are not part of `zmi.styles`) or load custom CSS resp. JavaScript, you have to:

1. create a directory and fill it with your assets
2. register this directory as resource directory
3. register a subscription adapter for :class:`App.interfaces.ICSSPaths` resp.
:class:`App.interfaces.IJSPaths`. This adapter has to return an iterable of
paths resp. URLs which should be loaded when rendering the ZMI.

Example taken from `zmi.styles`_:

* Register the resource directory via ZCML:

.. code-block:: XML

<browser:resourceDirectory
name="zmi"
directory="resources" />

* Create a subscription adapter returning the path to the CSS file
(`zmi.styles`_ has this code in `subscriber.py`.):


.. code-block:: Python

import zope.component
import zope.interface


@zope.component.adapter(zope.interface.Interface)
def css_paths(context):
"""Return paths to CSS files needed for the Zope 4 ZMI."""
return (
'/++resource++zmi/bootstrap-4.1.1/bootstrap.min.css',
'/++resource++zmi/fontawesome-free-5.1.0/css/all.css',
'/++resource++zmi/zmi_base.css',
)

* Register the subscriber via ZCML:

.. code-block:: XML

<subscriber
provides="App.interfaces.ICSSPaths"
factory=".subscriber.css_paths" />


Use custom resources via ZMI
++++++++++++++++++++++++++++

To add custom CSS or JavaScript resources via ZMI you have to add a property:

* ``zmi_additional_css_paths`` for additional CSS
* ``zmi_additional_js_paths`` for additional JavaScript

The properties can have one of the following types:

* ``string``
* ``ustring``
* ``ulines``

The value of the property has to be one or more paths/URLs to CSS resp.
JavaScript which will be included in the HTML of the ZMI. (Paths have to be
resolvable by the browser aka not simple file system paths.)
1 change: 1 addition & 0 deletions docs/index.rst
Expand Up @@ -11,6 +11,7 @@ Contents:
INSTALL-virtualenv
operation
USERS
ZMI
SECURITY
maintenance
changes
Expand Down
27 changes: 2 additions & 25 deletions docs/zdgbook/Products.rst
Expand Up @@ -833,31 +833,8 @@ When creating management views you should include the DTML variables
``manage_page_footer`` at the bottom. These variables are acquired
by your product and draw a standard management view header, tabs
widgets, and footer. The management header also includes CSS
information which you can take advantage of if you wish to add CSS
style information to your management views. The management CSS
information is defined in the
`lib/python/App/dtml/manage_page_style.css.dtml`` file. Here are the
CSS classes defined in this file and conventions for their use.

- 'form-help' -- Explanatory text related to forms. In the future,
users may have the option to hide this text.

- 'std-text' -- Declarative text unrelated to forms. You should
rarely use this class.

- 'form-title' -- Form titles.

- 'form-label' -- Form labels for required form elements.

- 'form-optional' -- Form labels for optional form elements.

- 'form-element' -- Form elements. Note, because of a Netscape bug,
you should not use this class on 'textarea' elements.

- 'form-text' -- Declarative text in forms.

- 'form-mono' -- Fixed width text in forms. You should rarely use
this class.
information which you can take advantage of. You can use any of the styles
Bootstrap 4 provides. (See http://getbootstrap.com/docs/4.1/)

Here's an example management view for your poll class. It allows you
to edit the poll question and responses (see ``editPollForm.dtml``)::
Expand Down
3 changes: 2 additions & 1 deletion requirements-full.txt
Expand Up @@ -3,7 +3,7 @@ AccessControl==4.0b4
Acquisition==4.4.4
AuthEncoding==4.0.0
BTrees==4.5.0
Chameleon==3.2
Chameleon==3.4
DateTime==4.2
DocumentTemplate==3.0b3
ExtensionClass==4.3.0
Expand Down Expand Up @@ -32,6 +32,7 @@ mock==2.0.0
pbr==4.0.3
persistent==4.2.4.2
pytz==2018.4
shutilwhich==1.1.0
six==1.11.0
transaction==2.2.1
waitress==1.1.0
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -77,6 +77,7 @@ def _read_file(filename):
'waitress',
'zExceptions >= 3.4',
'z3c.pt',
'zmi.styles',
'zope.browser',
'zope.browsermenu',
'zope.browserpage >= 4.0',
Expand Down
7 changes: 6 additions & 1 deletion sources.cfg
Expand Up @@ -4,7 +4,7 @@ github_push = git@github.com:zopefoundation

[sources]
# Zope-specific
AccessControl = git ${remotes:github}/AccessControl pushurl=${remotes:github_push}/AccessControl branch=master
AccessControl = git ${remotes:github}/AccessControl pushurl=${remotes:github_push}/AccessControl
Acquisition = git ${remotes:github}/Acquisition pushurl=${remotes:github_push}/Acquisition
AuthEncoding = git ${remotes:github}/AuthEncoding pushurl=${remotes:github_push}/AuthEncoding
DateTime = git ${remotes:github}/DateTime pushurl=${remotes:github_push}/DateTime
Expand All @@ -15,14 +15,19 @@ Persistence = git ${remotes:github}/Persistence pushurl=${remotes:github_push}/P
RestrictedPython = git ${remotes:github}/RestrictedPython pushurl=${remotes:github_push}/RestrictedPython
zExceptions = git ${remotes:github}/zExceptions pushurl=${remotes:github_push}/zExceptions
zope.globalrequest = git ${remotes:github}/zope.globalrequest pushurl=${remotes:github_push}/zope.globalrequest
zmi.styles = git ${remotes:github}/zmi.styles pushurl=${remotes:github_push}/zmi.styles

# Optional dependencies
five.localsitemanager = git ${remotes:github}/five.localsitemanager pushurl=${remotes:github_push}/five.localsitemanager
Missing = git ${remotes:github}/Missing pushurl=${remotes:github_push}/Missing
Products.BTreeFolder2 = git ${remotes:github}/Products.BTreeFolder2 pushurl=${remotes:github_push}/Products.BTreeFolder2
Products.MailHost = git ${remotes:github}/Products.MailHost pushurl=${remotes:github_push}/Products.MailHost
Products.PythonScripts = git ${remotes:github}/Products.PythonScripts pushurl=${remotes:github_push}/Products.PythonScripts
Products.ZCatalog = git ${remotes:github}/Products.ZCatalog pushurl=${remotes:github_push}/Products.ZCatalog
Products.ZCTextIndex = git ${remotes:github}/Products.ZCTextIndex pushurl=${remotes:github_push}/Products.ZCTextIndex
Products.Sessions = git ${remotes:github}/Products.Sessions pushurl=${remotes:github_push}/Products.Sessions
Products.TemporaryFolder = git ${remotes:github}/Products.TemporaryFolder pushurl=${remotes:github_push}/Products.TemporaryFolder
Products.SiteErrorLog = git ${remotes:github}/Products.SiteErrorLog pushurl=${remotes:github_push}/Products.SiteErrorLog
Record = git ${remotes:github}/Record pushurl=${remotes:github_push}/Record
ZServer = git ${remotes:github}/ZServer pushurl=${remotes:github_push}/ZServer

Expand Down
54 changes: 38 additions & 16 deletions src/App/Management.py
Expand Up @@ -18,11 +18,16 @@
from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import view_management_screens
from App.interfaces import INavigation
from App.interfaces import ICSSPaths
from App.interfaces import IJSPaths
from App.special_dtml import DTMLFile
from ExtensionClass import Base
from six.moves.urllib.parse import quote, unquote
from zExceptions import Redirect
from zope.interface import implementer
import itertools
import six
import zope.event

try:
from html import escape
Expand Down Expand Up @@ -87,20 +92,22 @@ def manage_workspace(self, REQUEST):
def tabs_path_default(self, REQUEST):
steps = REQUEST._steps[:-1]
script = REQUEST['BASEPATH1']
linkpat = '<a href="%s/manage_workspace">%s</a>'
out = []
url = linkpat % (escape(script, True), '&nbsp;/')
linkpat = '{}/manage_workspace'
yield {'url': linkpat.format(escape(script, True)),
'title': 'Root',
'last': not bool(steps)}
if not steps:
return url
return
last = steps.pop()
for step in steps:
script = '%s/%s' % (script, step)
out.append(linkpat % (escape(script, True), escape(unquote(step))))
yield {'url': linkpat.format(escape(script, True)),
'title': escape(unquote(step)),
'last': False}
script = '%s/%s' % (script, last)
out.append(
'<a class="strong-link" href="%s/manage_workspace">%s</a>' %
(escape(script, True), escape(unquote(last), False)))
return '%s%s' % (url, '/'.join(out))
yield {'url': linkpat.format(escape(script, True)),
'title': escape(unquote(last)),
'last': True}

def tabs_path_info(self, script, path):
out = []
Expand Down Expand Up @@ -141,9 +148,6 @@ class Navigation(Base):
security.declareProtected(view_management_screens, 'manage_menu')
manage_menu = DTMLFile('dtml/menu', globals())

security.declareProtected(view_management_screens, 'manage_page_header')
manage_page_header = DTMLFile('dtml/manage_page_header', globals())

security.declareProtected(view_management_screens, 'manage_page_footer')
manage_page_footer = DTMLFile('dtml/manage_page_footer', globals())

Expand All @@ -155,6 +159,21 @@ class Navigation(Base):
manage_form_title._setFuncSignature(
varnames=('form_title', 'help_product', 'help_topic'))

_manage_page_header = DTMLFile('dtml/manage_page_header', globals())
security.declareProtected(view_management_screens, 'manage_page_header')
def manage_page_header(self, *args, **kw):
"""manage_page_header."""
kw['css_urls'] = itertools.chain(
itertools.chain(*zope.component.subscribers((self,), ICSSPaths)),
self._get_zmi_additionals('zmi_additional_css_paths'))
kw['js_urls'] = itertools.chain(
itertools.chain(*zope.component.subscribers((self,), IJSPaths)),
self._get_zmi_additionals('zmi_additional_js_paths'))
return self._manage_page_header(*args, **kw)

security.declareProtected(view_management_screens, 'manage_navbar')
manage_navbar = DTMLFile('dtml/manage_navbar', globals())

security.declarePublic('manage_zmi_logout')
def manage_zmi_logout(self, REQUEST, RESPONSE):
"""Logout current user"""
Expand All @@ -175,11 +194,14 @@ def manage_zmi_logout(self, REQUEST, RESPONSE):
</html>""")
return

def _get_zmi_additionals(self, attrib):
# Get additional assets for styling ZMI defined on properties in ZMI.
additionals = getattr(self, attrib, ()) or ()
if isinstance(additionals, six.string_types):
additionals = (additionals, )
return additionals

# Navigation doesn't have an inherited __class_init__ so doesn't get
# initialized automatically.

file = DTMLFile('dtml/manage_page_style.css', globals())
Navigation.security.declarePublic('manage_page_style.css')
setattr(Navigation, 'manage_page_style.css', file)

InitializeClass(Navigation)