Skip to content

Commit

Permalink
Fix mobile menu navigation links
Browse files Browse the repository at this point in the history
  • Loading branch information
punchagan committed Jul 8, 2020
1 parent 2bda987 commit f579764
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 56 deletions.
25 changes: 25 additions & 0 deletions akvo/templates/navigation/header-links.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{% load i18n bootstrap3 rsr_utils rules %}

{% if '/myrsr/' in request.path %}
<ul class="nav navbar-nav">
<li role="presentation">
{% has_perm 'rsr.user_management' user as can_manage_users %}
{% if can_manage_users %}
<a href="/my-rsr/users">
{% trans "Users" %}
</a>
{% endif %}
</li>
<li role="presentation" class="navIati">
<a class="{% if 'myrsr/iati' in request.path %}active{% endif %}"
href="{% url 'my_iati' %}">
{% trans "IATI" %}
</a>
</li>
<li role="presentation" class="navReports">
<a href="/my-rsr/reports">
{% trans 'Reports' %}
</a>
</li>
</ul>
{% endif %}
66 changes: 10 additions & 56 deletions akvo/templates/navigation/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,65 +24,19 @@ <h1>Akvo RSR</h1> {# Text is just a placeholder, svg from css #}
</a>
</div>
<div class="desktop-menu">
{% if '/myrsr/' in request.path %}
<ul class="nav navbar-nav">
<li role="presentation">
{% has_perm 'rsr.user_management' user as can_manage_users %}
{% if can_manage_users %}
<a href="/my-rsr/users">
{% trans "Users" %}
</a>
{% endif %}
</li>
{% has_perm 'rsr.project_management' user as can_manage_projects %}
<li role="presentation" class="navIati">
<a class="{% if 'myrsr/iati' in request.path %}active{% endif %}"
href="{% url 'my_iati' %}">
{% trans "IATI" %}
</a>
</li>
<li role="presentation" class="navReports">
<a href="/my-rsr/reports">
{% trans 'Reports' %}
</a>
</li>
</ul>
{% else %}
<div class="tagLine">
<h2>{% if page_tagline %}{{ page_tagline }}{% else %}{% trans 'Monitor, report and share with ease' %}{% endif %}</h2>
</div>
{% endif %}
{% include 'navigation/header-links.html' %}
{% if '/myrsr/' not in request.path %}
<div class="tagLine">
<h2>{% if page_tagline %}{{ page_tagline }}{% else %}{% trans 'Monitor, report and share with ease' %}{% endif %}</h2>
</div>
{% endif %}
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="navbar-collapsed">
<div class="mobile-menu">
{% if '/myrsr/' in request.path %}
<ul class="nav navbar-nav">
<li role="presentation">
{% has_perm 'rsr.user_management' user as can_manage_users %}
{% if can_manage_users %}
<a href="{% url 'user_management' %}">
{% trans "User management" %}
</a>
{% endif %}
</li>
{% has_perm 'rsr.project_management' user as can_manage_projects %}
<li role="presentation" class="navIati">
<a class="{% if 'myrsr/iati' in request.path %}active{% endif %}"
href="{% url 'my_iati' %}">
{% trans "IATI" %}
</a>
</li>
<li role="presentation" class="navReports">
<a href="{% url 'my_reports' %}"
class="{% if '/myrsr/reports/' in current_path %}active{% endif %}">
{% trans 'Organisation Reports' %}
</a>
</li>
</ul>
<hr />
{% endif %}
</div>
<div class="mobile-menu">
{% include 'navigation/header-links.html' %}
<hr />
</div>
<ul class="nav navbar-nav navbar-right">
{% if not user.is_authenticated %}
<li><a href="{% url 'register' %}">{% trans 'Register' %}</a></li>
Expand Down

0 comments on commit f579764

Please sign in to comment.