-
Notifications
You must be signed in to change notification settings - Fork 23
/
base.html
103 lines (82 loc) · 4.21 KB
/
base.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{% load static %}
<!doctype html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-3237744-5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-3237744-5');
</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="/static/favicon.ico">
<title>django-todo</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Custom styles for this template -->
<link href="/static/css/sticky-footer-navbar.css" rel="stylesheet">
{# Additional CSS or html head data inserted by templates here. #}
{% block extrahead %}{% endblock extrahead %}
</head>
<body>
<header>
<!-- Fixed navbar -->
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<a class="navbar-brand" href="/">django-todo</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
{% if user.is_authenticated %}
<li class="nav-item"><a href="{% url 'todo:lists' %}" class="nav-link">To-do Lists</a></li>
<li class="nav-item"><a href="{% url 'todo:mine' %}" class="nav-link">My Tasks</a></li>
<li class="nav-item"><a href="{% url 'logout' %}" class="nav-link">Log Out</a></li>
{# Simulate external user adding ticket #}
<li class="nav-item"><a href="{% url 'todo:external_add' %}" class="nav-link">File Ticket</a></li>
<li class="nav-item"><a href="{% url 'todo:import_csv' %}" class="nav-link">Import</a></li>
{% else %}
<li class="nav-item"><a href="{% url 'login' %}" class="nav-link">Log In</a></li>
{% endif %}
</ul>
{% if user.is_authenticated %}
<form class="form-inline mt-2 mt-md-0" action="{% url 'todo:search' %}" method="get" placeholder="Search" aria-label="Search">
<input type="text" name="q" value="" class="form-control mr-sm-2" id="q">
<input type="submit" value="Search Tasks" class="btn btn-outline-success my-2 my-sm-0">
</form>
{% endif %}
</div>
</nav>
</header>
<!-- Begin page content -->
<main role="main" class="container">
{% if messages %}
{% for message in messages %}
<div class="alert {% if message.tags %}alert-{{ message.tags }}{% endif %}">{{ message }}</div>
{% endfor %}
{% endif %}
<p>{{ form.non_field_errors }}</p>
{% block content %}{% endblock %}
</main>
<footer class="footer">
<div class="container">
<span class="text-muted">
django-todo, {% now "Y" %}.
{% if user.is_authenticated %}Logged in as {{ user.username }}{% endif %}</span>
</div>
</footer>
<!-- jQuery and Bootstrap core JS, plus Popper -->
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
{% block extra_js %}{% endblock extra_js %}
</body>
</html>