@@ -135,15 +135,15 @@ def has_permission_membership(page):
135
135
is_setting_public_staff and request .user .is_staff )
136
136
):
137
137
# authenticated user, no restriction and public for all
138
- # or
138
+ # or
139
139
# authenticated staff user, no restriction and public for staff
140
140
to_add = True
141
141
# check group and user memberships to restricted pages
142
142
elif is_restricted and has_permission_membership (page ):
143
143
to_add = True
144
144
elif has_global_perm ():
145
145
to_add = True
146
- # anonymous user, no restriction
146
+ # anonymous user, no restriction
147
147
elif not is_restricted and is_setting_public_all :
148
148
to_add = True
149
149
# store it
@@ -176,7 +176,7 @@ def page_to_node(page, home, cut):
176
176
#if parent_id and not page.parent.get_calculated_status():
177
177
# parent_id = None # ????
178
178
179
- if page .limit_visibility_in_menu == None :
179
+ if page .limit_visibility_in_menu is None :
180
180
attr ['visible_for_authenticated' ] = True
181
181
attr ['visible_for_anonymous' ] = True
182
182
else :
@@ -311,7 +311,7 @@ def modify(self, request, nodes, namespace, root_id, post_cut, breadcrumb):
311
311
if node .namespace == menu [0 ]:
312
312
removed .append (node )
313
313
if breadcrumb :
314
- # if breadcrumb and home not in navigation add node
314
+ # if breadcrumb and home not in navigation add node
315
315
if breadcrumb and home and not home .visible :
316
316
home .visible = True
317
317
if request .path_info == home .get_absolute_url ():
@@ -330,26 +330,26 @@ def modify(self, request, nodes, namespace, root_id, post_cut, breadcrumb):
330
330
class SoftRootCutter (Modifier ):
331
331
"""
332
332
Ask evildmp/superdmp if you don't understand softroots!
333
-
333
+
334
334
Softroot description from the docs:
335
-
335
+
336
336
A soft root is a page that acts as the root for a menu navigation tree.
337
-
337
+
338
338
Typically, this will be a page that is the root of a significant new
339
339
section on your site.
340
-
340
+
341
341
When the soft root feature is enabled, the navigation menu for any page
342
342
will start at the nearest soft root, rather than at the real root of
343
343
the site’s page hierarchy.
344
-
344
+
345
345
This feature is useful when your site has deep page hierarchies (and
346
346
therefore multiple levels in its navigation trees). In such a case, you
347
347
usually don’t want to present site visitors with deep menus of nested
348
348
items.
349
-
349
+
350
350
For example, you’re on the page -Introduction to Bleeding-?, so the menu
351
351
might look like this:
352
-
352
+
353
353
School of Medicine
354
354
Medical Education
355
355
Departments
@@ -375,12 +375,12 @@ class SoftRootCutter(Modifier):
375
375
Administration
376
376
Contact us
377
377
Impressum
378
-
378
+
379
379
which is frankly overwhelming.
380
-
380
+
381
381
By making -Department of Mediaeval Surgery-? a soft root, the menu
382
382
becomes much more manageable:
383
-
383
+
384
384
Department of Mediaeval Surgery
385
385
Theory
386
386
Cures
0 commit comments