Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed the main menu creation view using the plone standard method

  • Loading branch information...
commit e25d11ccc220fc5c16a7b28289009a72120723af 1 parent 8688cdf
@libargutxi libargutxi authored
View
8 plonetheme/bootstrap/browser/configure.zcml
@@ -10,14 +10,6 @@
directory="templates" />
<browser:page
- name="bootstrap_utils"
- for="*"
- permission="zope.Public"
- class=".utils.BootstrapUtils"
- allowed_interface=".interfaces.IBootstrapUtils"
- />
-
- <browser:page
name="bootstrapview"
for="*"
class=".utils.BootstrapView"
View
45 plonetheme/bootstrap/browser/templates/plone.app.layout.viewlets.sections.pt
@@ -1,4 +1,4 @@
-<tal:sections tal:define="nav context/@@bootstrap_utils/navigation;
+<tal:sections tal:define="nav view/portal_tabs;
selected_tab python:view.selected_portal_tab"
tal:condition="nav"
i18n:domain="plone">
@@ -19,47 +19,26 @@
<div class="nav-collapse collapse">
<ul class="nav" id="navigation">
- <li id="portaltab-index_html">
- <a title="" i18n:translate="Home" tal:attributes="href context/@@plone_portal_state/navigation_root_url">Home</a>
- </li>
+
+
<tal:tabs tal:repeat="tab nav">
- <tal:define tal:define="item tab/item;
- children tab/children;">
- <li tal:define="tid item/id"
- tal:condition="not: item/exclude_from_nav"
+
+ <li tal:define="tid tab/id"
tal:attributes="id string:portaltab-${tid};
- class python:selected_tab==tid and 'active' or '';
- data-dropdown python: children and 'dropdown' or '';">
+ class python:selected_tab==tid and 'active' or ''">
<a href=""
- tal:content="item/Title"
- tal:attributes="href item/getURL;
- title item/Description|nothing;
- class python: children and 'dropdown-toggle' or '';">
+ tal:content="tab/name"
+ tal:attributes="href tab/url;
+ title item/description|nothing">
Tab Name
</a>
- <ul class="dropdown-menu" tal:condition="children">
- <tal:tabs tal:repeat="tab children">
- <tal:define tal:define="item tab/item;
- children tab/children;">
- <li tal:define="tid item/id"
- tal:attributes="id string:portaltab-${tid};
- class python:selected_tab==tid and 'active' or ''">
- <a href=""
- tal:content="item/Title"
- tal:attributes="href item/getURL;
- title item/Description|nothing;">
- Tab Name
- </a>
- </li>
- </tal:define>
- </tal:tabs>
- </ul>
+
</li>
- </tal:define>
+
</tal:tabs>
</ul>
</div>
</div>
</div>
</nav>
-</tal:sections>
+</tal:sections>
View
16 plonetheme/bootstrap/browser/utils.py
@@ -6,22 +6,6 @@
from interfaces import IBootstrapUtils, IBootstrapView
-class BootstrapUtils(BrowserView):
- implements(IBootstrapUtils)
-
- def navigation(self):
- portal_state = getMultiAdapter((self.context, self.request),
- name='plone_portal_state')
- portal = portal_state.portal()
- queryBuilder = NavtreeQueryBuilder(portal)
- query = queryBuilder()
- query['path']['depth'] = 2
-
- tree = buildFolderTree(portal, obj=portal, query=query)['children']
-# for
- return tree
-
-
class BootstrapView(BrowserView):
implements(IBootstrapView)
Please sign in to comment.
Something went wrong with that request. Please try again.