Browse Source

Handle navigation items opening new tab

master
Brandon Cornejo 2 years ago
parent
commit
647f1f001c
  1. 46
      acks/templates/base.html
  2. 2
      acks/templates/lair_gallery.html

46
acks/templates/base.html

@ -1,23 +1,23 @@
{% set player_bar = [
('/npc/spells', 'spells', 'Spells'),
('/worldmap', 'worldmap', 'Maps'),
('https://reddit.com/r/PalismaACKS/wiki', 'redditwiki', 'Wiki'),
('/npc/spells', 'spells', 'Spells', false),
('/worldmap', 'worldmap', 'Maps', false),
('https://reddit.com/r/PalismaACKS/wiki', 'redditwiki', 'Wiki', true),
] %}
{% set judge_bar = [
('/lairs', 'lairs', 'Lairs'),
('http://autarch.co/treasure', 'treasure', 'Treasure'),
('/quest/list', 'questlist', 'Quests'),
('/npc/party', 'npcparty', 'Generate Party'),
('/npc/single', 'npcsingle', 'Generate NPC'),
('/wiki', 'wiki', 'Wiki'),
('/lairs', 'lairs', 'Lairs', false),
('http://autarch.co/treasure', 'treasure', 'Treasure', true),
('/quest/list', 'questlist', 'Quests', false),
('/npc/party', 'npcparty', 'Generate Party', false),
('/npc/single', 'npcsingle', 'Generate NPC', false),
('/wiki', 'wiki', 'Wiki', false),
]%}
{% set navigation_bar = [
('/', 'index', 'Home'),
('/handbook', 'handbook', 'Handbook'),
(player_bar, 'section', 'Player Resources'),
(judge_bar, 'section', 'Judge Resources'),
('https://reddit.com/r/PalismaACKS', 'subreddit', '/r/PalismaACKS'),
('/', 'index', 'Home', false),
('/handbook', 'handbook', 'Handbook', false),
(player_bar, 'section', 'Player Resources', false),
(judge_bar, 'section', 'Judge Resources', false),
('https://reddit.com/r/PalismaACKS', 'subreddit', '/r/PalismaACKS', true),
] %}
{% set active_page = active_page|default('index') %}
@ -62,15 +62,15 @@
</div>
<div class="uk-navbar-center uk-visible@m">
<ul class="uk-navbar-nav">
{% for href, id, label in navigation_bar %}
{% for href, id, label, blank in navigation_bar %}
{% if id == 'section' %}
<li>
<a href="">{{ label|e }}</a>
<a href="" {% if blank is sameas true %} target="_blank" {% endif %}>{{ label|e }}</a>
<div class="uk-navbar-dropdown">
<ul class="uk-nav uk-navbar-dropdown-nav">
{% for phref, pid, plabel in href %}
{% for phref, pid, plabel, pblank in href %}
<li>
<a href="{{ phref|e }}">{{ plabel|e }}</a>
<a href="{{ phref|e }}" {% if pblank is sameas true %} target="_blank" {% endif %}>{{ plabel|e }}</a>
</li>
{% endfor %}
</ul>
@ -78,7 +78,7 @@
</li>
{% else %}
<li {% if id == active_page %} class="uk-active" {% endif %}>
<a href="{{ href|e }}">{{ label|e }}</a>
<a href="{{ href|e }}" {% if blank is sameas true %} target="_blank" {% endif %}>{{ label|e }}</a>
</li>
{% endif %}
{% endfor %}
@ -88,18 +88,18 @@
<div id="offcanvas-nav" uk-offcanvas="overlay: true">
<div class="uk-offcanvas-bar uk-flex uk-flex-column">
<ul class="uk-nav uk-nav-primary uk-nav-center uk-margin-auto-vertical">
{% for href, id, label in navigation_bar %}
{% for href, id, label, blank in navigation_bar %}
{% if id == 'section' %}
<li class="uk-nav-header uk-margin-large-top">{{ label|e }}</li>
{% for phref, pid, plabel in href %}
{% for phref, pid, plabel, pblank in href %}
<li {% if pid == active_page %} class="uk-active" {% endif %}>
<a href="{{ phref|e }}">{{ plabel|e }}</a>
<a href="{{ phref|e }}" {% if pblank is sameas true %} target="_blank" {% endif %}>{{ plabel|e }}</a>
</li>
{% endfor %}
<li class="uk-margin-large-bottom"/>
{% else %}
<li {% if id == active_page %} class="uk-active" {% endif %}>
<a href="{{ href|e }}">{{ label|e }}</a>
<a href="{{ href|e }}" {% if blank is sameas true %} target="_blank" {% endif %}>{{ label|e }}</a>
</li>
{% endif %}
{% endfor %}

2
acks/templates/lair_gallery.html

@ -26,7 +26,7 @@
</div>
<!-- Humanoid Lairs -->
<h2 class="uk-text-center"><strong>Humanoid Lairs</strong></h2>
<h2 class="uk-text-center uk-margin-xlarge-top"><strong>Humanoid Lairs</strong></h2>
<div uk-slider>
<ul class="uk-slider-nav uk-dotnav uk-flex-center uk-margin"></ul>
<div class="uk-position-relative">

Loading…
Cancel
Save