forked from ckan/ckan
-
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.
Merge branch 'midnight_blue-header' of https://github.com/aleeexgreee…
…n/ckan into aleeexgreeen-midnight_blue-header
- Loading branch information
Showing
6 changed files
with
35 additions
and
19 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
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
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 |
---|---|---|
@@ -1,25 +1,28 @@ | ||
{# | ||
Builds links for navigation | ||
|
||
nav_item - the name of the defined nav item defined in config/routing as the named route of the same name | ||
title - text used for the link | ||
icon - icon name used for link | ||
|
||
Example: | ||
|
||
{% import 'macros/nav_link.html' as nav %} | ||
{{ nav.link('home.about', _('About')") }} | ||
|
||
#} | ||
{% macro link(nav_item, title, icon="") %} | ||
{% set active_page = h.page_is_active(nav_item) %} | ||
{% macro link(nav_item, title, active_blueprints=[], icon="", url="") %} | ||
|
||
{% set active_page = h.page_is_active(nav_item, active_blueprints=active_blueprints) %} | ||
|
||
{% set url = url if url else h.url_for(nav_item, id) %} | ||
|
||
<li {% if active_page %}class="active"{% endif %}> | ||
<a {% if active_page %}aria-current="page"{% endif %} href="{{ h.url_for(nav_item) }}"> | ||
<a {% if active_page %}aria-current="page"{% endif %} href="{{ url }}"> | ||
{% if icon %} | ||
<i class="fa fa-{{ icon }}"></i> | ||
{% endif %} | ||
{{ title }} | ||
</a> | ||
</li> | ||
{% endmacro %} | ||
{% endmacro %} |