8000 [IMP] documentation-user: restructuring submenu · asantos82/documentation-user@4316470 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4316470

Browse files
stefanoriganomart-e
authored andcommitted
[IMP] documentation-user: restructuring submenu
— Layout * Create html templates to print breadcrumb's and submenu's lists. * Remove ‘o_main_back’ ( no longer needed) * Minimum mobile support for submenu. Note: The default website submenu should be refactored in order to support mobile by default — Style * Create a less mixin to handle all doc’s dropdowns * Add a specific style for breadcrumb when it’s placed inside the submenu.
1 parent cc7c259 commit 4316470

File tree

6 files changed

+374
-102
lines changed

6 files changed

+374
-102
lines changed

_extensions/odoo/breadcrumb_list.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{# warning: if doc structure change, these rules may have to change as well #}
2+
3+
{# ===== VARIABLES ====== #}
4+
{% set master_doc_short_name = 'User Doc' %}
5+
6+
{% if pagename == master_doc %}
7+
<li><a href="{{ pathto(master_doc) }}" class="active">{{ master_doc_short_name }}</a></li>
8+
{% else %}
9+
{% for parent in parents %}
10+
{% if loop.length > 1%}
11+
{% if loop.first %}
12+
<li><a href="{{ pathto(master_doc) }}">{{ master_doc_short_name }}</a></li>
13+
{% else %}
14+
{% if loop.index == 2 %}
15+
<li><a href="{{ parent.link|e }}">{{parent.title}}</a></li>
16+
{% endif %}
17+
{% endif %}
18+
{% else %}
19+
<li><a href="{{ pathto(master_doc) }}">{{ master_doc_short_name }}</a></li>
20+
{% endif %}
21+
{% endfor %}
22+
<li class="active"><a href="#">{{ meta.get('main-title', title) }}</a></li>
23+
{% endif %}

_extensions/odoo/layout.html

Lines changed: 36 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -162,55 +162,47 @@
162162
</div>
163163
<nav class="navbar o_sub_nav">
164164
<div class="container">
165-
<span class="o_main_back">
166-
{# warning: if doc structure change, these rules may have
167-
to change as well #}
168-
{% if pagename.count('/') %}
169-
{# If the current document is an application's content,
170-
link to the application root #}
171-
{% set updoc, _ = pagename.split('/', 1) %}
172-
{% else %}
173-
{# otherwise link to master_doc #}
174-
{% set updoc = master_doc %}
175-
{% endif %}
176-
<a href="{{ pathto(updoc) }}" class="mdi-navigation-arrow-back"></a>
177-
</span>
178-
<a href="#" class="navbar-header">
179-
<span id="o_doc_title" class="o_app_name_title">{{ meta.get('main-title', title) }}</span>
180-
</a>
181-
<div class="collapse navbar-collapse">
182-
<div class="call-to-action navbar-right">
165+
<div class="navbar-header visible-xs">
166+
<button type="button" class="navbar-toggle collapsed text-left btn-block" data-toggle="collapse" data-target="#o_sub-menu" aria-expanded="false">
167+
Navigate
168+
<span class="mdi-hardware-keyboard-arrow-down pull-right"></span>
169+
</button>
170+
</div>
171+
172+
<div class="collapse navbar-collapse" id="o_sub-menu">
173+
<ol class="o_breadcrumb breadcrumb nav navbar-left">
174+
{% block breadcrumb_desktop %}
175+
{% include "breadcrumb_list.html" %}
176+
{% endblock %}
177+
</ol>
178+
179+
<div class="call-to-action navbar-right hidden-xs">
183180
<a href="http://www.odoo.com/trial" class="btn btn-primary">Start Now</a>
184181
</div>
185-
{% if languages %}
186-
<ul class="navbar-nav navbar-right nav">
187-
<li class="languages dropdown">
188-
<a class="dropdown-toggle" data-toggle="dropdown">
189-
{{ language }}
190-
</a>
191-
<ul class="dropdown-menu" role="menu">
192-
{% for name, url in languages %}
193-
<li><a href="{{ url }}">{{ name }}</a></li>
194-
{% endfor %}
195-
</ul>
196-
</li>
182+
183+
<ul class="navbar-nav navbar-right nav o_sub_nav_actions">
184+
{% if pagename != master_doc %}
185+
<li class="divider"></li>
186+
{% endif%}
187+
188+
{% block switchers_desktop %}
189+
{% include "switchers_list.html" %}
190+
{% endblock %}
197191
</ul>
198-
{% endif %}
199-
{% if versions %}
192+
200193
<ul class="nav navbar-nav navbar-right">
201-
<li class="versions dropdown">
202-
<a class="dropdown-toggle" data-toggle="dropdown">
203-
{{ version }}
204-
</a>
205-
<ul class="dropdown-menu" role="menu">
206-
{% for name, url in versions %}
207-
<li><a href="{{ url }}">{{ name }}</a></li>
208-
{% endfor %}
209-
</ul>
210-
</li>
194+
{% if languages or versions %}
195+
<li class="divider"></li>
196+
{% endif %}
197+
198+
{% block sub_menu_desktop %}
199+
{% include "sub-menu_list.html" %}
200+
{% endblock %}
201+
202+
{% if languages or versions %}
203+
<li class="divider"></li>
204+
{% endif %}
211205
</ul>
212-
{% endif %}
213-
{{ toctree(titles_only=True, maxdepth=2, includehidden=True, collapse=False, navbar='main') }}
214206
</div>
215207
</div>
216208
</nav>

_extensions/odoo/static/mixins.less

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,104 @@
216216
@keyframes @name { @arguments(); }
217217
}
218218

219+
//-- Documentation Dropdown style
220+
.o-doc-dropdown {
221+
> a.dropdown-toggle {
222+
padding: 0 5px 0 10px;
223+
&:after {
224+
.mdi-icon( "\e7c1");
225+
226+
@media screen and (max-width: @screen-xs-max) {
227+
font-size: 1.5em
228+
}
229+
}
230+
}
231+
232+
&.open {
233+
z-index: 1;
234+
position: relative;
235+
background-color: @gray-light;
236+
color: @header-link-normal;
237+
238+
@media screen and (min-width: @screen-sm-min){
239+
background-color: @w-header-white;
240+
}
241+
242+
.dropdown-toggle {
243+
color: @header-link-normal;
244+
245+
&:hover {
246+
color: @headings-color;
247+
}
248+
}
249+
250+
.dropdown-menu {
251+
margin-top: 0;
252+
border: none;
253+
border-radius: 0;
254+
text-align: left;
255+
min-width: 100%;
256+
background-color: @w-header-white;
257+
padding-bottom: @w-header-height/4;
258+
.deep-1();
259+
260+
> li > a {
261+
font-size: 12px;
262+
display: block;
263+
color: @header-link-normal;
264+
float: none;
265+
text-transform: none;
266+
font-weight: @fw_medium;
267+
268+
@media screen and (max-width: @screen-xs-max) {
269+
padding-left: 10px;
270+
}
271+
}
272+
> li.active > a {
273+
color: white;
274+
background-color: desaturate(@brand-primary, 40%);
275+
}
276+
277+
@media screen and (max-width: @screen-xs-max) {
278+
position: static;
279+
}
280+
@media screen and (min-width: @screen-sm-min) {
281+
background-color: @w-header-white;
282+
}
283+
}
284+
}
285+
286+
&.o_dropdown_mobile_nav {
287+
margin-left: 0;
288+
289+
> .dropdown-toggle {
290+
&:after {
291+
.o-position-absolute(0, 0);
292+
}
293+
}
294+
295+
.o_breadcrumb_dropdown_menu > li{
296+
> a {
297+
white-space: nowrap;
298+
overflow: hidden;
299+
text-overflow: ellipsis;
300+
}
301+
> a:before {
302+
content: "|";
303+
margin-right: 0.5em;
304+
}
305+
&:nth-child(1) > a:before {
84F5
306+
display: none;
307+
}
308+
&:nth-child(2) > a:before {
309+
padding-left: 0.5em;
310+
}
311+
&:nth-child(3) > a:before {
312+
padding-left: 1em;
313+
}
314+
}
315+
}
316+
}
219317

220318

221319
// Shadows

0 commit comments

Comments
 (0)
0