Skip to content

Commit 9d00c71

Browse files
committed
update changes. update docs WIP. Add defaults for sidebar_left_min_width and sidebar_right_min_width properties in DefaultLayoutConfig
1 parent 588a492 commit 9d00c71

4 files changed

Lines changed: 86 additions & 31 deletions

File tree

CHANGES.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,17 @@ Changes
44
2.0a1 (unreleased)
55
------------------
66

7-
- Remove no longer used ``mainmenu_fluid`` and ``columns_fluid`` properties
8-
from ``ILayoutConfig``. Replace with ``limit_content_width`` property.
7+
- Add ``sidebar_left_min_width`` and ``sidebar_right_min_width`` properties
8+
to ``ILayoutConfig`` (Integer / px value).
9+
[lenadax]
10+
11+
- Remove no longer used ``mainmenu_fluid``, ``columns_fluid``, ``content_grid_width``
12+
and ``sidebar_left_grid_width`` properties from ``ILayoutConfig``.
13+
Replace with ``limit_content_width`` property (Boolean).
14+
[lenadax]
15+
16+
- Add ``sidebar_left_mode`` and ``sidebar_right_mode`` properties
17+
to ``ILayoutConfig`` ('toggle'/'stacked').
918
[lenadax]
1019

1120
- Cleanup js widgets to prevent DOM memory leaks.

docs/source/layout.rst

Lines changed: 72 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
Layout
33
======
44

5+
.. version-added:: 2.0
6+
7+
Version 2.0 introduces a new, more flexible layout system and the ``sidebar_right``
8+
and ``personaltools`` elements.
9+
10+
There are new layout configuration settings available. See
11+
:ref:`layout_configuration` for details.
12+
513
.. _layout_main_template:
614

715
Main Template
@@ -36,6 +44,12 @@ is structured as follows.
3644
.. figure:: ../../artwork/layout.svg
3745
:width: 100%
3846

47+
48+
.. _layout_configuration:
49+
50+
Layout Configuration
51+
--------------------
52+
3953
The layout can be configured for each application node. Layout configuration
4054
is described in ``cone.app.interfaces.ILayoutConfig`` and is registered for
4155
one or more model classes with ``cone.app.layout_config`` decorator.
@@ -67,35 +81,65 @@ one or more model classes with ``cone.app.layout_config`` decorator.
6781
self.sidebar_left_min_width = 250
6882
self.sidebar_right_min_width = 250
6983
70-
Provided layout settings:
71-
72-
- **mainmenu**: Flag whether to display mainmenu.
73-
74-
- **livesearch**: Flag whether to display livesearch.
75-
76-
- **personaltools**: Flag whether to display personaltools.
77-
78-
- **limit_content_width**: Flag whether content width should be limited on large screens.
79-
80-
- **pathbar**: Flag whether to display pathbar.
81-
82-
- **sidebar_left**: List of tiles by name which should be rendered in left sidebar.
83-
84-
- **sidebar_left_min_width**: Minimum left sidebar width as integer (in px).
85-
86-
- **sidebar_right**: List of tiles by name which should be rendered in right sidebar.
87-
88-
- **sidebar_right_min_width**: Minimum right sidebar width as integer (in px).
89-
90-
.. note::
91-
92-
As of version 2.0, ``limit_content_width`` defaults to ``False``.
93-
94-
.. deprecated:: 2.0
9584
96-
``mainmenu_fluid`` and ``columns_fluid`` have been removed in ``cone.app 2.0``.
97-
The ``columns_fluid`` setting has been replaced with
98-
``limit_content_width``.
85+
.. list-table:: Layout Configuration Settings
86+
:widths: 20 60 20
87+
:header-rows: 1
88+
89+
* - Setting
90+
- Description
91+
- Default
92+
* - ``mainmenu``
93+
- Flag whether to display mainmenu.
94+
- True
95+
* - ``livesearch``
96+
- Flag whether to display livesearch.
97+
- True
98+
* - ``personaltools``
99+
- Flag whether to display personaltools.
100+
- True
101+
* - ``limit_content_width``
102+
- Flag whether content width should be limited on large screens.
103+
- True
104+
* - ``pathbar``
105+
- Flag whether to display pathbar.
106+
- True
107+
* - ``sidebar_left``
108+
- List of tiles by name which should be rendered in left sidebar.
109+
- ['navtree']
110+
* - ``sidebar_left_mode``
111+
- The mode of the left sidebar (``'stacked'`` or ``'toggle'``).
112+
- 'stacked'
113+
* - ``sidebar_left_min_width``
114+
- Minimum left sidebar width as integer (in px).
115+
- 150
116+
* - ``sidebar_right``
117+
- List of tiles by name which should be rendered in right sidebar.
118+
- []
119+
* - ``sidebar_right_mode``
120+
- The mode of the right sidebar (``'stacked'`` or ``'toggle'``).
121+
- 'stacked'
122+
* - ``sidebar_right_min_width``
123+
- Minimum right sidebar width as integer (in px).
124+
- 150
125+
126+
.. version-added:: 2.0
127+
128+
- The ``sidebar_left_min_width`` and ``sidebar_right_min_width`` settings have been
129+
added to specify minimum sidebar widths in px.
130+
- The ``sidebar_left_mode`` and ``sidebar_right_mode`` settings have been
131+
added to specify sidebar modes (either ``'stacked'`` or ``'toggle'``).
132+
- The ``limit_content_width`` setting has been added to replace the former
133+
``columns_fluid`` setting.
134+
- As of version 2.0, ``limit_content_width`` defaults to ``False``.
135+
136+
.. version-removed:: 2.0
137+
138+
``mainmenu_fluid``, ``columns_fluid``, ``sidebar_left_grid_width`` and
139+
``content_grid_width`` have been removed in ``cone.app 2.0`` in favor of a
140+
more flexible layout.
141+
Use the ``columns_fluid`` setting instead to limit content width on
142+
large screens.
99143

100144
.. deprecated:: 1.1
101145

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"rollup": "^2.79.2",
1313
"rollup-plugin-cleanup": "^3.2.1",
1414
"rollup-plugin-postcss": "^4.0.2",
15-
"sass": "^1.97.2",
15+
"sass": "^1.97.3",
1616
"web-test-runner-qunit": "^2.0.0"
1717
},
1818
"packageManager": "pnpm@9.3.0+sha512.ee7b93e0c2bd11409c6424f92b866f31d3ea1bef5fbe47d3c7500cdc3c9668833d2e55681ad66df5b640c61fa9dc25d546efa54d76d7f8bf54b13614ac293631"

src/cone/app/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ def __init__(self, model=None, request=None):
7373
self.limit_content_width = True
7474
self.pathbar = True
7575
self.sidebar_left_mode = 'stacked' # 'toggle' or 'stacked'
76+
self.sidebar_left_min_width = 150
7677
self.sidebar_left = ['navtree']
7778
self.sidebar_right = []
7879
self.sidebar_right_mode = 'stacked' # 'toggle' or 'stacked'
80+
self.sidebar_right_min_width = 150
7981

8082

8183
def import_from_string(path):

0 commit comments

Comments
 (0)