|
| 1 | +<!doctype html> |
| 2 | + |
| 3 | +<html lang="en"> |
| 4 | + <head> |
| 5 | + <!-- Required meta tags --> |
| 6 | + <meta charset="utf-8"> |
| 7 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 8 | + |
| 9 | + |
| 10 | + <!-- Bootstrap CSS --> |
| 11 | + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> |
| 12 | + <title>{% block title %} Simple site {% endblock %}</title> |
| 13 | + </head> |
| 14 | + <body > |
| 15 | + |
| 16 | + {%block body%} |
| 17 | + <header class = "header fixed-top"> |
| 18 | + |
| 19 | + |
| 20 | + <nav class="navbar navbar-expand-lg navbar-light bg-light"> |
| 21 | + <div class="container-fluid"> |
| 22 | + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="true" aria-label="Toggle navigation"> |
| 23 | + <span class="navbar-toggler-icon"></span> |
| 24 | + </button> |
| 25 | + <div class="collapse navbar-collapse" id="navbarResponsive"> |
| 26 | + {% if user.is_authenticated%} |
| 27 | + <ul class="navbar-nav ms-auto"> |
| 28 | + <li class="nav-item active"> |
| 29 | + |
| 30 | + <li class="nav-item"> |
| 31 | + <a class="nav-item nav-link dropdown-toggle mr-md-2" href="#" id="userMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{user.username}}</a> |
| 32 | + </li> |
| 33 | + <li class="nav-item"> |
| 34 | + <a class="btn btn-primary ml-auto"href="{% url 'logout'%}">Log out<span class="sr-only"></span></a> |
| 35 | + |
| 36 | + </li> |
| 37 | + |
| 38 | + </ul> |
| 39 | + |
| 40 | + </div> |
| 41 | + </div> |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + {%else%} |
| 47 | + <button type="button" class="navbar-toggler" |
| 48 | + data-toggle="collapse" data-target="#mainMenu" aria-controls="mainMenu" aria-expanded="false" aria-haspopup="true" aria-label="Toggle navigation"> |
| 49 | + <span class="navbar-toggler-icon"></span> </button> |
| 50 | + |
| 51 | + <form class="form-inline ms-auto" > |
| 52 | + <a href="{% url 'login'%}" class="btn btn-secondary" color="white">Log in</a> |
| 53 | + <a href="{% url 'signup'%}" class = "btn btn-primary ml-3">Sign up</a> |
| 54 | + </form> |
| 55 | + {% endif%} |
| 56 | + |
| 57 | + </nav> |
| 58 | + |
| 59 | +</header> |
| 60 | + |
| 61 | + <div class="container" > |
| 62 | + {% block content %}{% endblock %} |
| 63 | + </div> |
| 64 | + |
| 65 | + |
| 66 | + {% endblock body%} |
| 67 | + |
| 68 | + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script> |
| 69 | + </body> |
| 70 | +</html> |
0 commit comments