You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
4.2 KiB

  1. {% set navigation_bar = [
  2. ('/', 'index', 'Home'),
  3. ('/handbook', 'handbook', 'Handbook'),
  4. ('/worldmap', 'worldmap', 'World Map'),
  5. ('.header', 'generate', 'Generate'),
  6. ('.header', 'other', 'Other'),
  7. ('/npc/spells', 'spells', 'Spells'),
  8. ('/api/schema', 'api', 'API'),
  9. ] %}
  10. {% set generation_bar = [
  11. ('/npc/party', 'npcparty', 'NPC Party'),
  12. ('/npc/single', 'npcsingle', 'Single NPC'),
  13. ('http://autarch.co/treasure', 'treasure', 'Treasure'),
  14. ] %}
  15. {% set active_page = active_page|default('index') %}
  16. <!doctype html>
  17. <html>
  18. <head>
  19. <title>{% block title %}{% endblock %} - Palisma ACKS</title>
  20. <meta charset="utf-8">
  21. <meta name="viewport" contents="width=device-width, initial-scale=1">
  22. <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
  23. <!-- UIkit CSS -->
  24. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.2.4/dist/css/uikit.min.css" />
  25. <!-- UIkit JS -->
  26. <script src="https://cdn.jsdelivr.net/npm/uikit@3.2.4/dist/js/uikit.min.js"></script>
  27. <script src="https://cdn.jsdelivr.net/npm/uikit@3.2.4/dist/js/uikit-icons.min.js"></script>
  28. {% block head %} {% endblock %}
  29. </head>
  30. <body>
  31. <nav class="uk-navbar-container" uk-navbar>
  32. <div class="uk-navbar-left">
  33. <a href="" class="uk-hidden@m uk-button-default uk-margin-small-left uk-margin-small-right" uk-toggle="target: #offcanvas-nav" uk-icon="menu"></a>
  34. <a href="" class="uk-navbar-item uk-logo">Palisma ACKS</a>
  35. </div>
  36. <div class="uk-navbar-center uk-visible@m">
  37. <ul class="uk-navbar-nav">
  38. {% for href, id, label in navigation_bar %}
  39. <li {% if id == active_page %} class="uk-active" {% endif %}>
  40. {% if id == 'generate' %}
  41. <a href="">{{ label |e }}</a>
  42. <div class="uk-navbar-dropdown">
  43. <ul class="uk-nav uk-navbar-dropdown-nav">
  44. {% for ghref, gid, glabel in generation_bar %}
  45. <li>
  46. <a href="{{ ghref | e }}" {% if gid == 'treasure' %}target="_blank"{% endif %}>
  47. {{ glabel|e }}
  48. </a>
  49. </li>
  50. {% endfor %}
  51. </ul>
  52. </div>
  53. {% else %}
  54. {% if href != '.header' %}
  55. <a href="{{ href|e }}">{{ label|e }}</a>
  56. {% endif %}
  57. {% endif %}
  58. </li>
  59. {% endfor %}
  60. </ul>
  61. </div>
  62. </nav>
  63. <div id="offcanvas-nav" uk-offcanvas="overlay: true">
  64. <div class="uk-offcanvas-bar uk-flex uk-flex-column">
  65. <ul class="uk-nav uk-nav-primary uk-nav-center uk-margin-auto-vertical">
  66. {% for href, id, label in navigation_bar %}
  67. {% if href == '.header' %}
  68. <li class="uk-nav-header">{{ label|e }}</li>
  69. {% if id == 'generate' %}
  70. {% for ghref, gid, glabel in generation_bar %}
  71. <li {% if gid == active_page %} class="uk-active" {% endif %}>
  72. <a href="{{ ghref | e }}" {% if gid == 'treasure' %}target="_blank"{% endif %}>
  73. {{ glabel|e }}
  74. </a>
  75. </li>
  76. {% endfor %}
  77. {% endif %}
  78. {% else %}
  79. <li {% if id == active_page %} class="uk-active" {% endif %}>
  80. <a href="{{ href|e }}">{{ label|e }}</a>
  81. </li>
  82. {% endif %}
  83. {% endfor %}
  84. </ul>
  85. </div>
  86. </div>
  87. <div class="uk-container">
  88. {% block content %}{% endblock %}
  89. </div>
  90. </body>
  91. </html>