MDL-55074 theme_boost: Make sections different in flat nav

This commit is contained in:
Damyon Wiese
2016-10-21 12:37:33 +08:00
parent 8a2ab5f72d
commit 598b3f095f
2 changed files with 26 additions and 7 deletions
+8
View File
@@ -3610,6 +3610,14 @@ class flat_navigation_node extends navigation_node {
$this->indent = $indent;
}
/**
* Does this node represent a course section link.
* @return boolean
*/
public function is_section() {
return $this->type == navigation_node::TYPE_SECTION;
}
/**
* Getter for "showdivider"
* @return boolean
+18 -7
View File
@@ -1,19 +1,30 @@
<nav class="nav nav-stacked nav-pills">
<nav class="list-group">
{{# flatnavigation }}
{{#showdivider}}
</nav>
<nav class="list-group m-t-1">
{{/showdivider}}
{{#get_smscreenonly}}
<div class="hidden-lg-up">
{{/get_smscreenonly}}
{{#showdivider}}
<div class="nav-item"><hr></div>
{{/showdivider}}
{{#action}}
<div class="nav-item"><a class="nav-link {{#isactive}}active{{/isactive}} m-l-{{get_indent}}" href="{{{action}}}">{{text}}</a></div>
<a class="list-group-item list-group-item-action {{#isactive}}active{{/isactive}}" href="{{{action}}}"><span class="m-l-{{get_indent}}">
{{#is_section}}
{{#pix}}i/folder{{/pix}}
{{/is_section}}
{{text}}
</span></a>
{{/action}}
{{^action}}
<div class="nav-item"><span class="nav-link m-l-{{get_indent}}">{{text}}</span></div>
<div class="list-group-item"><span class="m-l-{{get_indent}}">
{{#is_section}}
{{#pix}}i/folder{{/pix}}
{{/is_section}}
{{text}}
</span></div>
{{/action}}
{{#get_smscreenonly}}
</div>
{{/get_smscreenonly}}
{{/ flatnavigation }}
</div>
</nav>