-
Notifications
You must be signed in to change notification settings - Fork 16
/
sitebase.jinja2
290 lines (268 loc) · 16.9 KB
/
sitebase.jinja2
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{{ _('Microsetta') }} - {{page_title}}</title>
<link href="/static/vendor/bootstrap-5.0.2-dist/css/bootstrap.min.css" rel="stylesheet">
<link rel='stylesheet' id='dt-web-fonts-css' href='https://fonts.googleapis.com/css?family=Mulish:300,400,600,700' type='text/css' media='all' />
<link rel="stylesheet" href="/static/css/minimal_interface.css" />
<link rel="stylesheet" href="/static/css/ucsd_colors.css" />
<style>
body {
padding-top: 81px;
}
.profile-png {
width: 36px;
height: 36px;
object-fit: contain;
}
#header-profile {
margin-right: 30px;
}
</style>
<!-- jquery must be enabled before bootstrap for collapsible functionality -->
<script src="/static/vendor/js/jquery-3.4.1.min.js"></script>
<script src="/static/vendor/js/jquery.validate.min.js"></script>
<script src="/static/vendor/bootstrap-5.0.2-dist/js/bootstrap.bundle.min.js"></script>
<script src="/static/input_util.js"></script>
<script type="text/javascript">
function verifyDeleteSource(sourceName) {
{% if profile_has_samples %}
let alertMsg = "{{ _('Profiles with one or more samples assigned cannot be deleted. All samples must be removed prior to deleting this profile.') }}";
alert(alertMsg);
return false;
{% else %}
let confirmMsg = "{{ _('You are deleting the profile for') }} " + sourceName + " {{ _('and all surveys associated with it!') }} " +
"{{ _('This operation cannot be undone. Are you sure you want to delete this source?') }} ";
return window.confirm(confirmMsg);
{% endif %}
}
function openModalSiteBase() {
$("#tips_modal").modal('show');
return false;
}
function hideModalSiteBase() {
$("#tips_modal").modal('hide');
return false;
}
</script>
{%block head%}
{%endblock%}
</head>
<body>
<div class="modal fade" id="tips_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content tip-modal-content">
<div class="modal-header tip-modal-header">
<img src="/static/img/tips_title.svg" />
<span class="tip-title">{{ _('Tips') }}</span>
</div>
<div class="modal-body">
<div class="accordion tip-accordion" id="tips-accordion">
<div class="accordion-item">
<h2 class="accordion-header" id="panelsStayOpen-headingOne">
<button class="accordion-button tip-accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#tip-panel-one" aria-expanded="true" aria-controls="panelsStayOpen-collapseOne">
{{ _('Navigating Surveys') }}
</button>
</h2>
<div id="tip-panel-one" class="accordion-collapse collapse show" aria-labelledby="panelsStayOpen-headingOne">
<div class="accordion-body">
{{ _('You can pick and choose the surveys you want to complete on the "My Profile" tab or complete them in a series.') }}
<ul>
<li>{{ _('Clicking "Previous," "Next," or "Save & Go to Profile" will save your responses to that survey. But if you close your browser or navigate away from the page using other links, your progress for that survey will NOT be saved.') }}</li>
<li>{{ _('If you\'d prefer to only work on one survey at a time or need to stop, click "Save & Go to Profile" to return to your profile page.') }}</li>
</ul>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="panelsStayOpen-headingTwo">
<button class="accordion-button tip-accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#tip-panel-two" aria-expanded="false" aria-controls="panelsStayOpen-collapseTwo">
{{ _('Skipping Questions') }}
</button>
</h2>
<div id="tip-panel-two" class="accordion-collapse collapse show" aria-labelledby="panelsStayOpen-headingTwo">
<div class="accordion-body">
{{ _('The') }} "<span class="skip-text">{{ _('SKIP') }}</span>" {{ _('option can be found at the top right corner of each question.') }}
<ul>
<li>{{ _('Skipping a question clears your selected answer and hides the options.') }}</li>
<li>{{ _('Click "<span class="skip-text">DISPLAY</span>" to bring back the hidden response options.') }}</li>
<li>{{ _('If you want to reset an incorrect answer quickly, click "<span class="skip-text">SKIP</span>" then "<span class="skip-text">DISPLAY</span>".') }}</li>
<li>{{ _('Skipping a question logs a blank response and counts towards completing a survey.') }}</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer tip-modal-footer">
<span class="tip-contact">{{ _('Can\'t find what you\'re looking for?') }} <a href="mailto:microsetta@ucsd.edu" style="text-decoration: none;">{{ _('Please let us know') }}</a>.</span>
<button type="button" class="btn btn-white-blue-border" id="tips_cancel" onClick="hideModalSiteBase();">{{ _('Close') }}</button>
</div>
</div>
</div>
</div>
{% if admin_mode %}
<nav class="navbar fixed-top navbar-light bg-warning shadow">
{{ _('Admin Tools') }}
<a class="btn btn-outline-success" href="/admin/system_message">{{ _('System Panel') }}</a>
<a class="btn btn-outline-success" href="/admin/emperor_playground">{{ _('Emperor') }}</a>
<a class="btn btn-outline-success" href="/admin/perk_fulfillment_state">{{ _('Perk Fulfillment') }}</a>
<a class="btn btn-outline-success" href="/admin/interested_users">{{ _('Interested Users') }}</a>
<a class="btn btn-outline-success" href="/admin/address_verification">{{ _('Address Verification') }}</a>
<a class="btn btn-outline-success" href="/admin/campaigns/list">{{ _('Campaigns') }}</a>
<a class="btn btn-outline-success" href="/admin/ffq_codes">{{ _('FFQ Codes') }}</a>
<form class="form-inline" action="/admin/account_search" method="get">
<input id="email_query" name="email_query" class="form-control mr-sm-2" style="display: inline-block; max-width: 200px;" type="search" placeholder="User Email" aria-label="Search"/>
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">{{ _('Find Account') }}</button>
</form>
<a class="btn btn-outline-success" href="/admin/barcode_search">{{ _('Barcode Search') }}</a>
<a class="btn btn-outline-success" href="{{authrocket_url}}/logout?redirect_uri={{endpoint}}/logout">{{ _('Log Out') }}</a>
</nav>
{% endif %}
{% if not admin_mode and not hide_header %}
<nav class="navbar fixed-top navbar-light bg-white shadow">
<a class="navbar-brand" href="/home" title="microsetta.ucsd.edu">
<img src="/static/img/logo-co.png" class="logo-co"/>
</a>
{% if show_tips_icon %}
<a href="#" onClick="return openModalSiteBase();">
<img src="/static/img/tips.svg" />
</a>
{% endif %}
<div class="dropdown show" id="header-profile">
<a class="btn dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img src="/static/img/profile.png" class="profile-png"/>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdownMenuLink">
{% if login_info %}
{% if login_info.account_id %}
<li><a class="dropdown-item" href="/accounts/{{login_info.account_id |e}}">{{ _('Account Dashboard') }}</a></li>
<li><a class="dropdown-item" href="/accounts/{{login_info.account_id |e}}/details">{{ _('Account Details') }}</a></li>
{% else %}
<li><a class="dropdown-item disabled" href="#">{{ _('Account Details') }}</a></li>
{% endif %}
<li><a class="dropdown-item" href="{{authrocket_url}}/logout?redirect_uri={{endpoint}}/logout">{{ _('Log Out') }}</a></li>
{% else %}
<li><a class="dropdown-item" href="{{authrocket_url}}/login?redirect_uri={{endpoint}}/authrocket_callback">{{ _('Log In') }}</a></li>
<li><a class="dropdown-item" href="{{authrocket_url}}/signup?redirect_uri={{endpoint}}/authrocket_callback">{{ _('Sign Up') }}</a></li>
{% endif %}
</ul>
</div>
</nav>
{% endif %}
{% if profile_header %}
<div class="content pt-2 profile-bg">
{% else %}
<div class="content pt-2">
{% endif %}
{% if show_breadcrumbs %}
<nav aria-label="breadcrumb">
<ol class="breadcrumb tmi-content">
{%block breadcrumb%}
{%endblock%}
</ol>
</nav>
{% endif %}
<!-- Vue Form Generator references a container named "app" -->
<div class="container-fluid" id="app">
{% if profile_header %}
<div class="container profile-container">
<h1 class="profile-h1">
<img src="/static/img/profile_card_icon.png" class="profile-header-icon">
{{ profile_header_name }}
</h1>
<div class="header-nav-container">
<nav class="navbar navbar-expand-lg profile-nav-container">
<div class="container-fluid ps-0 pe-0">
<button class="navbar-toggler nav-toggle" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span>
{% if profile_header_active == "kits" %}
{{ _('My Kits') }}
{% elif profile_header_active == "nutrition" %}
{{ _('My Nutrition') }}
{% elif profile_header_active == "reports" %}
{{ _('My Reports') }}
{% else %}
{{ _('My Profile') }}
{% endif %}
</span>
<img src="/static/img/nav_down.svg" height="20" width="20" style="margin-top: 10px"/>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav profile-nav">
<li class="nav-item">
{% if profile_header_active == "profile" %}
<a class="nav-link active" href="/accounts/{{ profile_account_id }}/sources/{{ profile_source_id }}">{{ _('My Profile') }}</a>
{% else %}
<a class="nav-link" href="/accounts/{{ profile_account_id }}/sources/{{ profile_source_id }}">{{ _('My Profile') }}</a>
{% endif %}
</li>
<li class="nav-item">
{% if profile_header_active == "kits" %}
<a class="nav-link active" href="/accounts/{{ profile_account_id }}/sources/{{ profile_source_id }}/kits">{{ _('My Kits') }}</a>
{% else %}
<a class="nav-link" href="/accounts/{{ profile_account_id }}/sources/{{ profile_source_id }}/kits">{{ _('My Kits') }}</a>
{% endif %}
</li>
<li class="nav-item">
{% if profile_header_active == "nutrition" %}
<a class="nav-link active" href="/accounts/{{ profile_account_id }}/sources/{{ profile_source_id }}/nutrition">{{ _('My Nutrition') }}</a>
{% else %}
<a class="nav-link" href="/accounts/{{ profile_account_id }}/sources/{{ profile_source_id }}/nutrition">{{ _('My Nutrition') }}</a>
{% endif %}
</li>
<li class="nav-item">
{% if profile_header_active == "reports" %}
<a class="nav-link active" href="/accounts/{{ profile_account_id }}/sources/{{ profile_source_id }}/reports">{{ _('My Reports') }}</a>
{% else %}
<a class="nav-link" href="/accounts/{{ profile_account_id }}/sources/{{ profile_source_id }}/reports">{{ _('My Reports') }}</a>
{% endif %}
</li>
</ul>
</div>
</div>
</nav>
<div class="dropdown show" id="profile-kebab-dropdown">
<a class="btn p-0" href="#" role="button" id="profileDropdownMenuLink" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img src="/static/img/kebab.svg" style="margin-top: 10px; margin-left: 10px">
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="profileDropdownMenuLink">
<li><a class="dropdown-item" href="/accounts/{{ account_id }}/sources/{{ source_id }}/consents">{{ _('Consent Documents') }}</a></li>
<li><a class="dropdown-item" href="/accounts/{{ account_id }}/sources/{{ source_id }}/remove" onClick="return verifyDeleteSource('{{source_name}}');">{{ _('Delete This Profile') }}</a></li>
</ul>
</div>
</div>
</div>
{% endif %}
{% if system_msg_text %}
<div id="system_message" class="alert alert-{{system_msg_style|e}}" role="alert">
{% if system_msg_text == "going_down" %}
{{system_msg_dictionary[system_msg_text][_(EN_US_KEY)]}} {{ system_msg_time }}
{% else %}
{{system_msg_dictionary[system_msg_text][_(EN_US_KEY)]}}
{% endif %}
</div>
{% endif %}
{%block content%}
{%endblock%}
</div>
</div>
{%block footer%}
{%endblock%}
{% if not admin_mode and not hide_footer %}
<br />
<div class="tmi-footer">
<div class="container">
<div class="d-flex justify-content-center">
{% if not disable_faq %}
<a style="background-image: url('/static/img/icon-question-mark.svg')" href="https://microsetta.ucsd.edu/participant-resources/faqs/" target="_blank" class="tmi-icon m-3">{{ _('FAQs') }}</a>
{% endif %}
<a style="background-image: url('/static/img/icon-email.svg')" href="mailto:microsetta@ucsd.edu" class="tmi-icon m-3">{{ _('Email') }}</a>
{# <a style="background-image: url('/static/img/icon-phone.svg')" href="tel:858-246-5690" class="cta icon -phone">858-246-5690</a>#}
</div>
</div>
{% endif %}
</body>
</html>