-
Notifications
You must be signed in to change notification settings - Fork 56
/
base.html
235 lines (209 loc) · 10.5 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
{% load static %}
{% load bootstrap3 %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="theme-color" content="#f8f8f8">
<meta name="author" content="{{ h_name }}">
<link rel="icon" href="{% static 'favicon.png' %}" type="image/png">
<link rel="icon" href="{% static 'favicon.ico' %}" type="image/x-icon">
<meta name="description" content="{{ h_description }}">
<!--FACEBOOK DESCRIPTION -->
<meta property="og:title" content="{{ h_app_name }}"/>
<meta property="og:site_name" content="{{ h_app_name }}"/>
<meta property="og:description" content="{{ h_description }}"/>
{% if h_og_image %}
<meta property="og:image" content="{{ h_og_image }}">
<meta property="og:image:secure_url" content="{{ h_og_image }}">
{% endif %}
<meta property="og:url" content="https://{{ h_domain }}/">
<!--TWITTER DESCRIPTION -->
<meta name="twitter:card" content="summary">
{% if h_tw %}
<meta name="twitter:site" content="@{{ h_tw }}">
<meta name="twitter:creator" content="@{{ h_tw }}">
{% endif %}
<meta name="twitter:title" content="{{ h_app_name }}">
<meta name="twitter:description" content="{{ h_description }}">
{% if h_og_image %}
<meta name="twitter:image" content="{{ h_og_image }}">
{% endif %}
<link rel="stylesheet" href="{% static 'css/reset.css' %}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="{% static 'css/main.css' %}">
<link rel="stylesheet" href="{% static 'lib/snackbar.min.css' %}">
<link rel="stylesheet" href="{% static 'lib/material.css' %}">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script src="{% static 'lib/snackbar.min.js' %}"></script>
{% block head %}
{% endblock %}
<title>{% block title %}{% block head_title %}{% endblock %} | {% endblock %}{{ h_app_name }}</title>
</head>
<body>
{% if messages %}
<script>
$(function () {
// {% for message in messages %}
$.snackbar({
content: "{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}Important: {% endif %}{{ message }}",
timeout: 3000
});
// {% endfor %}
})
</script>
{% endif %}
{% block navbar %}
<nav class="navbar navbar-default navbar-fixed-top navbar-expand-xl">
<div class="container container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<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="navbar-brand white-text" href="/">{{ h_app_name }}</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
{% if request.user.is_authenticated %}
{% if request.user.is_admin %}
<li class="{% if request.resolver_match.url_name == "admin:index" %}active{% endif %}"><a
href="{% url 'admin:index' %}">Admin</a></li>
{% endif %}
{% if request.user.email_verified and request.user.has_usable_password %}
{% if request.user.is_organizer or request.user.is_volunteer_accepted %}
<li class="{% if 'hacker' in request.build_absolute_uri %}active{% endif %}">
{% if request.user.is_organizer %}
<a href="{% url 'app_list' %}">Hacker</a>
{% else %}
<a href="{% url 'check_in_list' %}">Check-in</a>
{% endif %}
</li>
{% if request.user.is_organizer %}
{% if request.user.has_volunteer_access %}
<li class="{% if 'volunteer' in request.build_absolute_uri %}active{% endif %}"><a
href="{% url 'volunteer_list' %}">Volunteer</a></li>
{% endif %}
{% if request.user.has_mentor_access %}
<li class="{% if 'mentor' in request.build_absolute_uri %}active{% endif %}"><a
href="{% url 'mentor_list' %}">Mentor</a></li>
{% endif %}
{% if request.user.has_sponsor_access %}
<li class="{% if 'sponsor' in request.build_absolute_uri %}active{% endif %}"><a
href="{% url 'sponsor_user_list' %}">Sponsor</a></li>
{% endif %}
{% endif %}
{% endif %}
{% if h_hw_enabled %}
{% include 'include/hardware_tab.html' %}
{% endif %}
{% if request.user.is_organizer %}
<li class="{% if 'stats' in request.build_absolute_uri %}active{% endif %}"><a
href="{% url 'app_stats' %}">Stats</a></li>
{% endif %}
{% endif %}
{% endif %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% if request.user.is_authenticated %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ request.user.email }} <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="{% url 'user_profile' %}"><span class="glyphicon glyphicon-user"></span> Profile</a></li>
<li role="separator" class="divider"></li>
<li><a href="{% url 'account_logout' %}"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li>
</ul>
</li>
{% else %}
<li><a href="{% url 'account_login' %}"><span class="glyphicon glyphicon-log-in"></span> Sign In</a></li>
<li><a href="{% url 'account_signup' %}"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
{% endif %}
</ul>
</div>
</div>
</nav>
{% endblock %}
<div class="content container">
<div class="content-inside">
{% block body %}
<div class="margin-top">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-default">
<div class="panel-body">
{% block content %}
{% endblock %}
</div>
</div>
</div>
</div>
{% block extra_body %}
{% endblock %}
{% endblock %}
</div>
</div>
<footer class="footer navbar-fixed-bottom">
<div class="container">
<div class="row">
<div class="col-sm-6">
<p>Have a question? We're happy to help! {{ h_contact_email | urlize }}</p>
</div>
<div class="social-icons col-sm-6 text-right text-center-xs">
{% if h_tw %}
<a class="btns" target="_blank" href="https://twitter.com/{{ h_tw }}">
<i aria-hidden="true" class="fa fa-twitter fa-lg"></i>
</a>
{% endif %}
{% if h_fb %}
<a class="btns" target="_blank" href="https://fb.com/{{ h_fb }}">
<i aria-hidden="true" class="fa fa-facebook fa-lg"></i>
</a>
{% endif %}
{% if h_contact_email %}
<a class="btns" target="_blank" href="mailto:{{ h_contact_email }}">
<i aria-hidden="true" class="fa fa-envelope-o fa-lg"></i>
</a>
{% endif %}
{% if h_repo %}
<a class="btns" target="_blank" href="{{ h_repo }}">
<i aria-hidden="true" class="fa fa-github fa-lg"></i>
</a>
{% endif %}
</div>
</div>
<div class="row">
<div class="col-md-12 text-center">
<small>Made with <i class="fa fa-heart" aria-hidden="true"></i> by {{ h_name }} </small>
{# OH NO YOU FOUND ME! This is just an internal joke that appeared at the first edition of HackUPC. #}
{# You can remove it, but if you dont care, please keep it. I'm a sentimental - Gerard Casas [email protected] #}
<span style="display: none">BIENE {{ h_name }}</span>
</div>
</div>
</div>
</footer>
{% block extra_scripts %}
{% endblock %}
{% if h_ga %}
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', '{{ h_ga }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
</body>
</html>