mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
Merge branch 'master' into PHRAS-2608_Prod_Fix_responsive_custom_link
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
{% import 'common/macros.html.twig' as macro %}
|
||||
{% import 'common/macro_caption.html.twig' as macro_caption %}
|
||||
|
||||
{% set business = granted_on_collection(record.baseId, [constant('\\ACL::CANMODIFRECORD')]) %}
|
||||
{% set display_exif = true %}
|
||||
|
||||
{% if view == 'answer' %}
|
||||
{{ macro.caption(record, business, display_exif) }}
|
||||
{{ macro_caption.caption(record, business, display_exif) }}
|
||||
{% elseif view == 'lazaret' %}
|
||||
{{ macro.caption(record, business, display_exif) }}
|
||||
{{ macro_caption.caption(record, business, display_exif) }}
|
||||
{% elseif view == 'preview' %}
|
||||
{% set display_exif = false %}
|
||||
{{ macro.caption(record, business, display_exif, true) }}
|
||||
{{ macro_caption.caption(record, business, display_exif, true) }}
|
||||
{% elseif view == 'basket' %}
|
||||
{% set display_exif = false %}
|
||||
{{ macro.caption(record, business, display_exif) }}
|
||||
{{ macro_caption.caption(record, business, display_exif) }}
|
||||
{% elseif view == 'overview' %}
|
||||
{% set display_exif = false %}
|
||||
{{ macro.caption(record, business, display_exif) }}
|
||||
{{ macro_caption.caption(record, business, display_exif) }}
|
||||
{% elseif view == 'publi' %}
|
||||
{{ macro.caption(record, business, display_exif) }}
|
||||
{{ macro_caption.caption(record, business, display_exif) }}
|
||||
{% endif %}
|
||||
|
@@ -67,72 +67,3 @@
|
||||
<input type="hidden" name="recaptcha_response_field" value="manual_challenge">
|
||||
</noscript>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro flashes() %}
|
||||
{% for type in app.getAvailableFlashTypes %}
|
||||
{% for message in app.getFlash(type) %}
|
||||
<div class="alert alert-{{ type }}">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="alert-block-logo">
|
||||
<i class="fa-2x icon-white fa fa-exclamation-circle" aria-hidden="true"></i>
|
||||
</td>
|
||||
<td class="alert-block-content">{{ message }}</td>
|
||||
<td class="alert-block-close">
|
||||
<a href="#"><b>×</b></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro caption_value(field, bounceable) %}
|
||||
{% autoescape false %}
|
||||
{% set terms = [] %}
|
||||
{% for data in field.values %}
|
||||
{% if data.from_thesaurus and bounceable %}
|
||||
{% set value = data.value|e|bounce(field.name, data.qjs, field.sbas_id)|parseColor %}
|
||||
{% else %}
|
||||
{% set value = data.value|e|parseColor %}
|
||||
{% endif %}
|
||||
{% set terms = [value]|merge(terms) %}
|
||||
{% endfor %}
|
||||
{{ terms|join(' ; ') }}
|
||||
{% endautoescape %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro caption_field(field, bounceable, extra_classes) %}
|
||||
<div class="desc {{ extra_classes|join(' ') }}">
|
||||
<b>{{ field.label_name }}</b> :
|
||||
{{ _self.caption_value(field, bounceable|default(true))|highlight|linkify }}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro format_caption(record, highlight, search_engine, include_business, bounceable, technical_data) %}
|
||||
{% for field in record.get_caption().get_highlight_fields(null, include_business) %}
|
||||
{% set extra_classes = ['pair'] %}
|
||||
{% if loop.index is odd %}
|
||||
{% set extra_classes = ['impair'] %}
|
||||
{% endif %}
|
||||
{{ _self.caption_field(field, bounceable|default(true), extra_classes) }}
|
||||
{% endfor %}
|
||||
{% if technical_data|default(true) and app.getAuthenticatedUser() is not none and app['settings'].getUserSetting(app.getAuthenticatedUser(), 'technical_display') == 'group' %}
|
||||
<hr/>
|
||||
{% include 'common/technical_datas.html.twig' %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro caption(record, can_see_business, display_exif, limitedWidth = false) %}
|
||||
<dl class="{% if limitedWidth %}{% else %}dl-horizontal{% endif %}">
|
||||
{% for name, value in record.getCaption(caption_field_order(record, can_see_business)) %}
|
||||
<dt>{{ caption_field_label(record, name) }}</dt>
|
||||
<dd>{{ caption_field(record, name, value)|e|highlight|linkify|parseColor }}</dd>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
{% if display_exif|default(true) and app.getAuthenticator().user is not none and user_setting('technical_display') == 'group' %}
|
||||
<hr/>
|
||||
{% include 'common/technical_datas.html.twig' %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
12
templates/web/common/macro_caption.html.twig
Normal file
12
templates/web/common/macro_caption.html.twig
Normal file
@@ -0,0 +1,12 @@
|
||||
{% macro caption(record, can_see_business, display_exif, limitedWidth = false) %}
|
||||
<dl class="{% if limitedWidth %}{% else %}dl-horizontal{% endif %}">
|
||||
{% for name, value in record.getCaption(caption_field_order(record, can_see_business)) %}
|
||||
<dt>{{ caption_field_label(record, name) }}</dt>
|
||||
<dd>{{ caption_field(record, name, value)|e|highlight|linkify|parseColor }}</dd>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
{% if display_exif|default(true) and app.getAuthenticator().user is not none and user_setting('technical_display') == 'group' %}
|
||||
<hr/>
|
||||
{% include 'common/technical_datas.html.twig' %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
19
templates/web/common/macro_flashes.html.twig
Normal file
19
templates/web/common/macro_flashes.html.twig
Normal file
@@ -0,0 +1,19 @@
|
||||
{% macro flashes() %}
|
||||
{% for type in app.getAvailableFlashTypes %}
|
||||
{% for message in app.getFlash(type) %}
|
||||
<div class="alert alert-{{ type }}">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="alert-block-logo">
|
||||
<i class="fa-2x icon-white fa fa-exclamation-circle" aria-hidden="true"></i>
|
||||
</td>
|
||||
<td class="alert-block-content">{{ message }}</td>
|
||||
<td class="alert-block-close">
|
||||
<a href="#"><b>×</b></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
Reference in New Issue
Block a user