Minor fixes.
[wolnelektury.git] / src / wolnelektury / templates / board_base.html
index cadb6bb..29dff3c 100644 (file)
@@ -1,48 +1,55 @@
-{% extends "board_base.html" %}
+{% extends 'board_base.html' %}
 {% load i18n %}
+{% load static %}
+{% load stylesheet from pipeline %}
+
+{% block css %}
+   {{ block.super }}
+   {% stylesheet 'forum' %}
+{% endblock css %}
+
+
 
 {% block header %}
+<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
+  <a class="navbar-brand" href="{% url 'forum:index' %}">
+    {% block brand %}
+      <img src="{% static 'img/logo-neon-transp.png' %}" alt="Towarzystwo Przyjaciół Wolnych Lektur">
+    {% endblock %}
+  </a>
 
-<div class="navbar-fixed-top-spacing">&nbsp;</div>
-<div class="navbar navbar-default navbar-fixed-top machina-navbar" role="navigation" style="background:black; color: white;">
-  <div class="container">
-    <div class="navbar-header">
-      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
-        <span class="sr-only">Toggle navigation</span>
-        <span class="icon-bar"></span>
-        <span class="icon-bar"></span>
-        <span class="icon-bar"></span>
-      </button>
-      <a class="" href="/"><img src="https://static.wolnelektury.pl/img/logo-neon.71fa40570160.png" alt="Towarzystwo Przyjaciół Wolnych Lektur" style="height:50px"></a>
+  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
+    <span class="navbar-toggler-icon"></span>
+  </button>
+  <div class="collapse navbar-collapse" id="navbarSupportedContent">
+    {% block header_collapse %}
+    <form class="form-inline my-2 ml-3 my-lg-0" role="search" action="{% url 'forum_search:search' %}">
+      <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" name="q">
+      <button class="btn btn-outline-light my-2 my-sm-0" type="submit">{% trans "Search" %}</button>
+    </form>
+    <div class="navbar-nav mr-auto">
+      <a class="nav-item nav-link" href="{% url 'forum_search:search' %}">{% trans "Advanced search" %}</a>
     </div>
-    <div class="collapse navbar-collapse">
-      {% block header_collapse %}
-      <div class="col-sm-7 col-md-8 col-lg-7">
-        <form class="navbar-form form-inline" role="search" action="{% url 'forum_search:search' %}">
-          <div class="form-group col-sm-6 col-md-7">
-            <div class="input-group">
-              <input type="text" class="form-control" placeholder="{% trans 'Search...' %}" name="q">
-              <div class="input-group-btn">
-                <button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
-              </div>
-            </div>
-          </div>
-          <div class="form-group col-sm-5">
-            <a href="{% url 'forum_search:search' %}" class="btn btn-link">{% trans "Advanced search" %}</a>
-          </div>
-        </form>
-      </div>
-
-      <div class="col-sm-3 col-md-2 col-lg-2 navbar-right">
-          <div style="padding: 1em">
-             {{ user }}
-          </div>
-      </div>
-      {% endblock header_collapse %}
+    <div class="navbar-nav mr-auto">
+      {% if request.user.is_authenticated %}
+        <div class="nav-item">
+          <a class="nav-link disabled">
+            {{ request.user.username }}
+          </a>
+       </div>
+        {% if request.user.is_staff %}
+         <div class="nav-item">
+            <a class="nav-link" href="{% url 'admin:index' %}">
+              {% trans "Administration" %}
+            </a>
+         </div>
+        {% endif %}
+       <div class="nav-item">
+          <a class="nav-link" href="{% url 'logout' %}">{% trans "Logout" %}</a>
+       </div>
+      {% endif %}
     </div>
+    {% endblock header_collapse %}
   </div>
-</div>
-
-
-
+</nav>
 {% endblock header %}