forked from sio2project/oioioi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(SIO-2082) Improved portal navigation
I have added breadcrumbs and modified left menu navigation and navbar menu nabigation on portals both on small and large devices. Change-Id: I322c286915e1fe0755b56c6918f430d14a4565a1
- Loading branch information
Showing
4 changed files
with
46 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% load i18n portal_url simple_tags %} | ||
|
||
<!-- https://stackoverflow.com/questions/12194573/bootstrap-dropdown-within-breadcrumb --> | ||
|
||
<ol class="breadcrumb"> | ||
{% for node in current_node.get_ancestors_including_self %} | ||
<li class="breadcrumb-item {% if node == current_node %}active{% endif %}"> | ||
{% if node != current_node %} | ||
<a href="{% portal_url node=node %}"> | ||
{% endif %} | ||
{{ node.full_name }} | ||
{% if node != current_node %} | ||
</a> | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,15 @@ | ||
{% load i18n portal_url simple_tags %} | ||
|
||
<div class="panel panel-default"> | ||
<div class="panel-heading">{% trans "Navigation" %}</div> | ||
<div class="list-group"> | ||
{% if current_node.is_root_node and current_node.is_leaf_node %} | ||
<a class="list-group-item active" href="{% portal_url node=current_node %}">{{ current_node.full_name }}</a> | ||
{% else %} | ||
{% for node in current_node.get_ancestors_including_self %} | ||
{% if not node.is_leaf_node %} | ||
{% if node.get_siblings %} | ||
<div class="list-group-item dropdown"> | ||
<button class="btn dropdown-toggle {% if node == current_node %}btn-primary{% else %}btn-default{% endif %}" | ||
type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> | ||
{{ node.full_name }} <span class="glyphicon glyphicon-chevron-right pull-right"></span> | ||
</button> | ||
<ul class="dropdown-menu dropdown-menu-right"> | ||
{% for sibling in node.get_siblings_including_self %} | ||
<li><a href="{% portal_url node=sibling %}">{{ sibling.full_name }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% else %} | ||
<a href="{% portal_url node=node %}" class="list-group-item {% if node == current_node %}active{% endif %}"> | ||
{{ node.full_name }} | ||
</a> | ||
{% endif %} | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
<div class="panel panel-default"> | ||
{% if not current_node.is_leaf_node %} | ||
<div class="panel-heading">{{ current_node.full_name }}</div> | ||
<div class="list-group"></div> | ||
{% for node in current_node.get_children %} | ||
<a class="list-group-item" href="{% portal_url node=node %}">{{ node.full_name }}</a> | ||
{% endfor %} | ||
{% else %} | ||
<div class="panel-heading">{{ current_node.parent.full_name }}</div> | ||
<div class="list-group"></div> | ||
{% for node in current_node.get_siblings_including_self %} | ||
<a class="list-group-item {% if node == current_node %}active{% endif %}" | ||
href="{% portal_url node=node %}">{{ node.full_name }}</a> | ||
{% endfor %} | ||
{% endif %} | ||
<div class="panel-heading">Menu</div> | ||
{% if current_node.is_leaf_node %} | ||
<p class="text-center"> | ||
<small><em>no child nodes</em></small> | ||
</p> | ||
{% else %} | ||
<div class="list-group"></div> | ||
{% for node in current_node.get_children %} | ||
<a class="list-group-item" href="{% portal_url node=node %}">{{ node.full_name }}</a> | ||
{% endfor %} | ||
{% endif %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters