Skip to content

Commit

Permalink
MDL-55074 theme_boost: Make sections different in flat nav
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Oct 21, 2016
1 parent 8a2ab5f commit 598b3f0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
8 changes: 8 additions & 0 deletions lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3610,6 +3610,14 @@ public function __construct($navnode, $indent) {
$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
Expand Down
25 changes: 18 additions & 7 deletions theme/boost/templates/flat_navigation.mustache
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 598b3f0

Please sign in to comment.