-
-
Notifications
You must be signed in to change notification settings - Fork 403
/
Copy pathproduct_page.tt.html
executable file
·417 lines (359 loc) · 17 KB
/
product_page.tt.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
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
<!-- start templates/[% template.name %] -->
<script src="[% static_subdomain %]/js/dist/JsBarcode.all.min.js"></script>
[% IF product_changes_saved %]
<div data-alert class="alert-box info">
<span>lang('product_changes_saved')</span>
<a href="#" class="close">×</a>
</div>
[% IF structured_response_count > 0 %]
[% search_result %] <hr>
[% END %]
[% END %]
[% IF (robotoff_url.defined) && (robotoff_url.length > 0) %]
<!-- Anonymous users will only be able to vote see AnnotationVote in robotoff,
the voter uniqueness is based on a hash of its ip address
-->
<robotoff-asker url='[% robotoff_url %]' code='[% code %]' lang='[% lc %]' style='display: none;' caption-yes='[% esq(lang("button_caption_yes")) %]' caption-no='[% esq(lang("button_caption_no")) %]' caption-skip='[% esq(lang("button_caption_skip")) %]'></robotoff-asker>
[% END %]
<a href="#upNav" class="back-to-top scrollto button">
<span class="material-icons size-20 ">
arrow_upward
</span>
</a>
<div itemscope itemtype="[% itemtype %]" class="main-product" id="main-product">
<div class="block v-space-tiny product_banner_unranked" id="prodHead">
<div class="row h-space-normal">
<div class="large-12 flex-grid ">
<h1 class="title-3" property="food:name" itemprop="name">[% title %]</h1>
<div class="buttons_prod">
<!-- Edit product page -->
<div class="edit_button">
<a href="/cgi/product.pl?type=edit&code=[% code %]" class="button small white-button round" title="[% edq(lang('edit_product_page')) %]">
<span class="material-icons size-20 ">
edit
</span>
<span class="show-for-large-up">[% lang('edit_product_page') %]</span>
</a>
</div>
<!-- Share -->
<div class="share_button" style="display:none;">
<a href="[% request_ref.canon_url %]" class="button small" title="[% title %]">
<span class="material-icons size-20 ">
share
</span>
<span class="show-for-large-up">[% lang('share') %]</span>
</a>
</div>
[% IF user_moderator %]
<!-- Delete product page -->
<div class="delete_button">
<a href="/cgi/product.pl?type=delete&code=[% code %]" class="button small alert" title="[% edq(lang('delete_product_page')) %]">
<span class="material-icons size-20 ">
delete
</span>
<span class="show-for-large-up"> [% lang('delete_product_page') %]</span>
</a>
</div>
[% END %]
[% IF server_options_producers_platform %]
<div class="delete_button">
<a href="/cgi/export_products.pl?query_code=[% code %]" class="button small" title="[% edq(lang('export_product_page')) %]">
<span class="material-icons size-20 ">
publish
</span>
<span class="show-for-large-up"> [% lang('export_product_page') %]</span>
</a>
</div>
[% END %]
</div>
</div>
</div>
</div>
<div class="block v-space-tiny prod-nav product_banner_unranked" id="prodNav">
<div class="row h-space-normal">
<div class="large-12">
<nav id="navbar" class="navbar h-space-tiny">
<ul class="inline-list">
<li class="product-section-button"><a class="nav-link scrollto button small round white-button" href="#product"><span>[% lang("product") %]</span></a></li>
[% IF user_preferences %]
<li class="product-section-button"><a class="nav-link scrollto button small round white-button" href="#match"><span>[% lang("your_criteria") %]</span></a></li>
[% END %]
[% IF health_card_panel %]
<li class="product-section-button"><a class="nav-link scrollto button small round white-button" href="#health"><span>[% lang("health") %]</span></a></li>
[% END %]
<li class="product-section-button"><a class="nav-link scrollto button small round white-button" href="#environment"><span>[% lang("environment") %]</span></a></li>
[% IF secondhand_card_panel %]
<li class="product-section-button"><a class="nav-link scrollto button small round white-button" href="#secondhand"><span>[% lang("secondhand") %]</span></a></li>
[% END %]
[% IF report_problem_card_panel %]
<li class="product-section-button"><a class="nav-link scrollto button small round white-button" href="#report_problem"><span>[% lang("report_problem_navigation") %]</span></a></li>
[% END %]
[% IF display_data_quality_issues_and_improvement_opportunities %]
<li class="product-section-button"><a class="nav-link scrollto button small round white-button" href="#improvement"><span>[% lang("improvements_navigation") %]</span></a></li>
[% END %]
<li class="product-section-button"><a class="nav-link scrollto button small round white-button" href="#contribution"><span>[% lang("contribution_navigation") %]</span></a></li>
</ul>
</nav><!-- .navbar -->
</div>
</div>
</div>
<div id="prodInfos">
<!-- product_characteristics -->
<section class="row" id="product">
<div class="large-12 column">
<div class="card" style="border-top:none">
<div id="prodBanner" style="display:none"></div>
<div class="card-section">
[% IF front_image %]
<div class="row">
<div class="medium-4 small-12 columns">
[% INCLUDE web/panels/image.tt.html code = code image = front_image %]
</div>
<div class="medium-8 small-12 columns">
[% END %]
<h2 class="title-1" property="food:name" itemprop="name">[% title %]</h1>
[% IF server_options_producers_platform %]
<p>→ <a href="[% public_product_url %]">[% lang("product_page_on_the_public_database") %]</a></p>
[% END %]
<!-- Obsolete product -->
[% IF product_is_obsolete %]
<div data-alert class="alert-box warn" id="obsolete" style="display: block; background:#ffaa33;color:black;">
[% warning %]
</div>
[% END %]
<!-- GS1-Prefixes for restricted circulation numbers within a company - warn for possible conflicts -->
[% IF gs1_prefixes %]
<div data-alert class="alert-box info" id="warning_gs1_company_prefix" style="display: block;">
[% lang('warning_gs1_company_prefix') %]
<a href="#" class="close">×</a></span>
</div>
[% END %]
[% IF rev.defined %]
[% display_rev_info %]
[% ELSIF not_has_tag == "states-en:complete" %]
<div data-alert class="alert-box info" id="warning_not_complete" style="display: block;">
[% lang("warning_not_complete") %]
<a href="#" class="close">×</a></span>
</div>
[% END %]
<!-- owner -->
[% IF owner %]
<p>
[% FILTER format(lang("sources_manufacturer")) %]<a href="/editor/[% owner %]">[% owner_org.name %]</a>[% END %]
[% IF owner_org.customer_service.email || owner_org.customer_service.link || owner_org.customer_service.phone %]
- [% lang("customer_service") %][% sep %]:
[% IF owner_org.customer_service.email %]
[% display_icon('email') %] <a href="mailto:[% owner_org.customer_service.email %]">[% owner_org.customer_service.email %]</a>
[% ELSIF owner_org.customer_service.link %]
[% display_icon('email') %] <a href="[% owner_org.customer_service.link %]">[% lang("contact_form") %]</a>
[% END %]
[% IF owner_org.customer_service.phone %]
[% display_icon('phone') %] <span itemprop="telephone"><a href="tel:[% owner_org.customer_service.phone %]">[% owner_org.customer_service.phone %]</a></span>
[% END %]
[% END %]
</p>
[% END %]
<!-- Display UPC code if the EAN starts with 0 -->
[% IF upc_code == 'defined' %]
<div id="barcode_div">
<!-- Display only text of the code if mobile -->
<div id="barcode_div_code">
<p id="barcode_paragraph">[% lang("barcode") %]: <br id="barcode_br"><span id="barcode" property="food:code" itemprop="gtin13" style="speak-as:digits;">[% code %]</span>[% upc %]</p>
</div>
<!-- Display with SVG if not mobile -->
<div id="barcode_div_svg">
<svg id="barcode_svg"
jsbarcode-format="auto"
jsbarcode-value="[% code %]"
jsbarcode-displayValue="false"
jsbarcode-height="40">
</svg>
</div>
</div>
<script>if (screen && screen.width >= 600) JsBarcode("#barcode_svg").init()</script>
<div property="gr:hasEAN_UCC-13" content="[% code %]" datatype="xsd:string"></div>
[% ELSE %]
[%# put in DOM for folksonomy %]
<span id="barcode" style="display: none;">[% code %]</span>
[% END %]
[% product_fields %]
[% IF front_image.defined %]
</div>
</div>
[% END %]
</div>
</div>
</div>
</div>
</section>
[% IF user_preferences %]
<!-- product summary -->
<section class="row" id="match">
<div class="large-12 column">
<div class="card">
<div class="card-section">
<h2 id="match_title">[% lang('matching_with_your_preferences') %]</h2>
<div id="match_score_and_status"></div>
<div id="product_summary" class="v-space-short text-left"></div>
<div id="preferences_selected" class="text-left"></div>
<div id="preferences_selection_form" class="text-left v-space-whide h-space-wide" style="display:none"></div>
</div>
</div>
</div>
</section>
[% END %]
[% IF health_card_panel %]
<section class="row" id="health">
<div class="large-12 column">
<div class="card">
<div class="card-section">
[% health_card_panel %]
</div>
</div>
</div>
</section>
[% END %]
<section class="row" id="environment">
<div class="large-12 column">
<div class="card">
<div class="card-section">
[% environment_card_panel %]
</div>
</div>
</div>
</section>
<!-- other fields -->
[% IF other_fields != "" %]
<section class="row" id="other">
<!-- product_characteristics -->
<div class="large-12 column">
<div class="card">
<div class="card-section">
<h2 id="product_other_information" class="text-medium">[% lang('product_other_information') %]</h2>
<div class="row">
<div class="small-12 columns">
[% other_fields %]
</div>
</div>
</div>
</div>
</div>
</section>
[% END %]
[% IF secondhand_card_panel %]
<section class="row" id="secondhand">
<div class="large-12 column">
<div class="card">
<div class="card-section">
[% secondhand_card_panel %]
</div>
</div>
</div>
</section>
[% END %]
<!-- Report problem card, if not on the platform for producers -->
[% IF ! server_options_producers_platform %]
<section class="row" id="report_problem">
<div class="large-12 column">
<div class="card">
<div class="card-section">
[% report_problem_card_panel %]
</div>
</div>
</div>
</section>
[% END %]
<!-- Platform for producers: data quality issues and improvements opportunities -->
[% IF server_options_producers_platform %]
<section class="row" id="improvement">
<div class="large-12 column">
<div class="card">
<div class="card-section">
[% display_data_quality_issues_and_improvement_opportunities %]
</div>
</div>
</div>
</section>
[% END %]
[% IF contribution_card_panel %]
<section class="row" id="contribution">
<div class="large-12 column">
<div class="card">
<div class="card-section">
[% contribution_card_panel %]
</div>
</div>
</div>
</section>
[% ELSE %]
<a id="contribution"></a>
[% END %]
<section class="row" >
<div class="large-12 column">
<div class="card">
<div class="card-section">
<h2 id="data_sources" class="text-medium">[% lang('data_sources_p') FILTER ucfirst %]</h2>
<!-- photos and data sources -->
[%IF sources %]
[% lang("list_of_sources") %]
<ul>
[% FOREACH source IN unique_sources %]
<li>
[% IF source.url %]
<a href="\[% source.url %]\">[% source.name %]</a></li>
[% ELSE %]
[% source.name %]
[% END %]
[% IF source.source_licence_url %]
<a href="\[% source.source_licence_url %]\">[% source.name %]</a></li>
[% ELSE %]
[% source.source_licence %]
[% END %]
</li>
[% END %]
</ul>
[% END %]
<!-- databases data sources -->
[% IF data_source_database_provider %]
<p>[% data_source_database_provider %]</p>
[% END %]
[% IF data_source_database_note_about_the_producers_platform %]
<p>[% data_source_database_note_about_the_producers_platform %]</p>
[% END %]
<p class="details">
[% lang('product_added') %] [% created_date %] [% lang('by') %] [% creator %]<br>
[% lang('product_last_edited') %] [% last_modified_date %] [% lang('by') %] [% last_editor %].
[% other_editors %]
[% checked %]
</p>
<div class="alert-box info">
[% lang('fixme_product') %]
</div>
[% IF (user_id.defined) %]
[% display_field_states %]
[% END %]
</div>
</div>
</div>
</section>
<section class="row" >
<div class="large-12 column">
<div class="card">
<div class="card-section">
<section class="row" >
<div class="large-12 column">
[% display_product_history %]
</div>
</section>
<div class="edit_button center text-center" >
<a href="/cgi/product.pl?type=edit&code=[% code %]" class="button small">
[% display_icon('edit') %]
[% lang('edit_product_page') %]
</a>
</div>
</div>
</div>
</div>
</section>
[% INCLUDE web/common/includes/folksonomy_script.tt.html %]
<!-- end templates/[% template.name %] -->