mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 02:13:15 +00:00
Update templates
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{% macro format(record)%}
|
||||
{% set doctype = record.get_type() %}
|
||||
{% if record.is_grouping() %}
|
||||
{% set doctype = record.type %}
|
||||
{% if record.story %}
|
||||
<img src="/skins/icons/icon_story.gif" title="{{ 'reportage' | trans }}" />
|
||||
{% elseif doctype == 'image' %}
|
||||
<img src="/skins/icons/icon_image.gif" title="{{ 'image' | trans }}" />
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
{% macro prod(record, entry_id)%}
|
||||
{% if not entry_id %}
|
||||
<a style="float:right;padding:0;margin:0;cursor:pointer;" class="contextMenuTrigger"
|
||||
id="contextTrigger_{{record.get_base_id}}_{{record.get_record_id}}">▼</a>
|
||||
id="contextTrigger_{{record.baseId}}_{{record.recordId}}">▼</a>
|
||||
<table cellspacing="0" cellpadding="0" style="display:none;"
|
||||
id="answerContext_{{record.get_base_id}}_{{record.get_record_id}}" class="contextMenu answercontextmenu">
|
||||
id="answerContext_{{record.baseId}}_{{record.recordId}}" class="contextMenu answercontextmenu">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="context-menu context-menu-theme-vista">
|
||||
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id, 'canputinalbum') and not record.is_grouping() %}
|
||||
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.baseId, 'canputinalbum') and not record.story %}
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="evt_add_in_chutier('{{record.get_sbas_id}}','{{record.get_record_id}}',false,this);return(false);">
|
||||
onclick="evt_add_in_chutier('{{record.databoxId}}','{{record.recordId}}',false,this);return(false);">
|
||||
{{ 'action : ajouter au panier' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id, 'candwnldpreview') or app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id, 'candwnldhd') %}
|
||||
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.baseId, 'candwnldpreview') or app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.baseId, 'candwnldhd') %}
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="evt_dwnl('{{record.get_sbas_id}}_{{record.get_record_id}}',false,this);return(false);">
|
||||
onclick="evt_dwnl('{{record.databoxId}}_{{record.recordId}}',false,this);return(false);">
|
||||
{{ 'action : exporter' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="evt_print('{{record.get_sbas_id}}_{{record.get_record_id}}');return(false);">
|
||||
onclick="evt_print('{{record.databoxId}}_{{record.recordId}}');return(false);">
|
||||
{{ 'action : print' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
{% if app['conf'].get(['registry', 'actions', 'social-tools']) == 'all' or (app['conf'].get(['registry', 'actions', 'social-tools']) == 'publishers' and app['acl'].get(app['authentication'].getUser()).has_right_on_sbas(record.get_sbas_id(), 'bas_chupub')) %}
|
||||
{% if record.is_grouping() is empty %}
|
||||
{% if app['conf'].get(['registry', 'actions', 'social-tools']) == 'all' or (app['conf'].get(['registry', 'actions', 'social-tools']) == 'publishers' and app['acl'].get(app['authentication'].getUser()).has_right_on_sbas(record.databoxId, 'bas_chupub')) %}
|
||||
{% if record.story is empty %}
|
||||
<div title="" class="context-menu-item">
|
||||
<div class="context-menu-item-inner"
|
||||
onclick="shareThis('{{record.get_base_id}}','{{record.get_record_id}}');">
|
||||
onclick="shareThis('{{record.baseId}}','{{record.recordId}}');">
|
||||
{{ 'reponses:: partager' | trans }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{% macro format(thumbnail, box_w, box_h, extra_class, wrap, lazyload) %}
|
||||
{% set record_type = thumbnail.get_type() %}
|
||||
{% macro format(record, url, thumb_w, thumb_h, box_w, box_h, extra_class, wrap, lazyload) %}
|
||||
{% set record_type = record.type %}
|
||||
{% set box_w = box_w|round %}
|
||||
{% set box_h = box_h|default(box_w)|round %}
|
||||
|
||||
{% if record_type == 'AUDIO_MP3' %}
|
||||
{% if record_type == 'AUDIO' %}
|
||||
{% set original_w = 320 %}
|
||||
{% set original_h = 60 %}
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
"left": 0
|
||||
} %}
|
||||
{% else %}
|
||||
{% set original_h = thumbnail.get_height() > 0 ? thumbnail.get_height() : 120 %}
|
||||
{% set original_w = thumbnail.get_width() > 0 ? thumbnail.get_width() : 120 %}
|
||||
{% set original_h = thumb_h > 0 ? thumb_h : 120 %}
|
||||
{% set original_w =thumb_w > 0 ? thumb_w : 120 %}
|
||||
|
||||
{% set fit_size = fitIn(
|
||||
{"width":original_w, "height":original_h},
|
||||
@@ -33,8 +33,6 @@
|
||||
)%}
|
||||
{% endif %}
|
||||
|
||||
{% set url = app['authentication'].isAuthenticated() ? thumbnail.get_url() : thumbnail.get_permalink().get_url() %}
|
||||
|
||||
{% if wrap %}
|
||||
<div
|
||||
style="width:{{box_w}}px;height:{{box_h}}px;"
|
||||
|
||||
@@ -1,78 +1,89 @@
|
||||
{% macro block(record, highlight, searchEngine, prefix, entry_id) %}
|
||||
{% import 'common/thumbnail.html.twig' as thumbnail %}
|
||||
{% macro block(record, highlight, searchEngine, prefix, entry_id)%}
|
||||
{% import 'common/thumbnail.html.twig' as thumbnail_macro %}
|
||||
{% import 'common/doctype_icons.html.twig' as doctype_icons %}
|
||||
{% import 'common/drop_down_options.html.twig' as drop_down %}
|
||||
{% set th_size = app['settings'].getUserSetting(app['authentication'].getUser(), 'images_size') %}
|
||||
{% set sbas_id = record.get_sbas_id %}
|
||||
{% set lazyload = app['phraseanet.configuration']['lazyload']|default(false) %}
|
||||
{% set container_attributes %}
|
||||
{% if entry_id %}
|
||||
class="IMGT diapo type-{{ record.get_type }}"
|
||||
onDblClick="openPreview('FEED',{{ record.get_number() }},{{ entry_id }});"
|
||||
{% elseif record.is_grouping() %}
|
||||
class="IMGT diapo grouping type-{{ record.get_type }}"
|
||||
onDblClick="openPreview('REG','0','{{ record.get_serialize_key() }}');"
|
||||
{% else %}
|
||||
class="IMGT diapo type-{{ record.get_type }}"
|
||||
onDblClick="openPreview('RESULT',{{ record.get_number }});"
|
||||
{% endif %}
|
||||
{% endset %}
|
||||
{% set th_size = app['settings'].getUserSetting(app['authentication'].getUser(), 'images_size')%}
|
||||
|
||||
<div style="width:{{ th_size+30 }}px;" sbas="{{ sbas_id }}"
|
||||
id="{{ prefix|default('IMGT') }}_{{ record.get_sbas_id }}_{{ record.get_record_id }}" {{ container_attributes }}>
|
||||
{# @todo retrieve current position of record in result set #}
|
||||
{% set number = 1 %}
|
||||
|
||||
{% if entry_id %}
|
||||
<div style="width:{{th_size+30}}px;" sbas="{{record.databoxId}}"
|
||||
id="{{ prefix|default('IMGT') }}_{{record.databoxId}}_{{record.recordId}}"
|
||||
class="IMGT diapo type-{{record.type}}"
|
||||
onDblClick="openPreview('FEED',{{number}},{{entry_id}});">
|
||||
{% elseif record.story %}
|
||||
<div style="width:{{th_size+30}}px;" sbas="{{record.databoxId}}"
|
||||
id="{{ prefix|default('IMGT') }}_{{record.databoxId}}_{{record.recordId}}"
|
||||
class="IMGT diapo grouping type-{{record.type}}"
|
||||
onDblClick="openPreview('REG','0','{{record.id}}');">
|
||||
{% else %}
|
||||
<div style="width:{{th_size+30}}px;" sbas="{{record.databoxId}}"
|
||||
id="{{ prefix|default('IMGT') }}_{{record.databoxId}}_{{record.recordId}}"
|
||||
class="IMGT diapo type-{{record.type}}"
|
||||
onDblClick="openPreview('RESULT',{{ number }});">
|
||||
{% endif %}
|
||||
<div style="padding: 4px;">
|
||||
<div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">
|
||||
<div class="title" style="max-height:100%" title="{{ record.get_title() }}">
|
||||
{{ record.get_title() }}
|
||||
<div class="title" style="max-height:100%" title="{{ record.title|default(record.originalName) }}">
|
||||
{{ record.title|default(record.originalName) }}
|
||||
</div>
|
||||
<div class="status">
|
||||
{{ record.get_status_icons|raw }}
|
||||
{# @todo find a proper way to map lifted flag to status icon img path #}
|
||||
{#{{record.get_status_icons|raw}}#}
|
||||
</div>
|
||||
</div>
|
||||
{% set thumbnail = record.subdefs.containsKey('thumbnail') ? record.subdefs.get('thumbnail') : null %}
|
||||
{% set preview = record.subdefs.containsKey('preview') ? record.subdefs.get('preview') : null %}
|
||||
{% set rollover_thumbnail = record.subdefs.containsKey('thumbnailgif') ? record.subdefs.get('thumbnailgif') : null %}
|
||||
|
||||
{% set rollover_gif = record.get_rollover_thumbnail() %}
|
||||
{% set user_technical_display = app['settings'].getUserSetting(app['authentication'].getUser(), 'technical_display') %}
|
||||
{% set user_rollover_thumbnail =app['settings'].getUserSetting(app['authentication'].getUser(), 'rollover_thumbnail') %}
|
||||
{% set extraclass = '' %}
|
||||
{% set user_rollover_thumbnail = app['settings'].getUserSetting(app['authentication'].getUser(), 'rollover_thumbnail') %}
|
||||
|
||||
{% set extraclass = '' %}
|
||||
{% if user_rollover_thumbnail == 'caption' and searchEngine is not null %}
|
||||
{% set extraclass = extraclass ~ ' captionTips' %}
|
||||
{% set tooltipsrc = path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'answer', 'number' : record.get_number() }) %}
|
||||
{% set tooltipsrc = path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'answer', 'number' : number }) %}
|
||||
{% elseif user_rollover_thumbnail == 'caption' and searchEngine is null %}
|
||||
{% set extraclass = extraclass ~ ' captionTips' %}
|
||||
{% set tooltipsrc = path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'publi' }) %}
|
||||
{% set tooltipsrc = path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'publi' }) %}
|
||||
{% elseif user_rollover_thumbnail == 'preview' %}
|
||||
{% set extraclass = extraclass ~ ' captionTips' %}
|
||||
{% set tooltipsrc = path('prod_tooltip_preview', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id() }) %}
|
||||
{% set tooltipsrc = path('prod_tooltip_preview', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId }) %}
|
||||
{% endif %}
|
||||
|
||||
<div class="thumb {{ extraclass }} " tooltipsrc="{{ tooltipsrc }}"
|
||||
style="height:{{ th_size }}px; z-index:90;">
|
||||
<div class="thumb {{extraclass}} " tooltipsrc="{{tooltipsrc}}" style="height:{{th_size}}px; z-index:90;">
|
||||
<div class="doc_infos">
|
||||
{% if app['settings'].getUserSetting(app['authentication'].getUser(), 'doctype_display') == '1' %}
|
||||
{{ doctype_icons.format(record) }}
|
||||
{{doctype_icons.format(record)}}
|
||||
{% endif %}
|
||||
<span class="duration">
|
||||
{{ record.get_formated_duration() }}
|
||||
{% if record.type == 'video' and attribute(record.exif, constant('\\media_subdef::TC_DATA_DURATION')) is defined %}
|
||||
{{ attribute(record.exif, constant('\\media_subdef::TC_DATA_DURATION')) }}
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
<div class="{% if rollover_gif %}rollovable{% endif %}">
|
||||
<div class="{% if rollover_thumbnail %}rollovable{% endif %}">
|
||||
{% set extraclass = '' %}
|
||||
{% if rollover_gif %}
|
||||
{% if rollover_thumbnail %}
|
||||
{% set extraclass = 'rollover-gif-out' %}
|
||||
{% endif %}
|
||||
{{ thumbnail.format(record.get_thumbnail(), th_size, th_size, extraclass, true, lazyload) }}
|
||||
{% if rollover_gif %}
|
||||
{{ thumbnail.format(rollover_gif, th_size, th_size, 'rollover-gif-hover', true, lazyload) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{# @todo thumbnail must be served using symbolic link, this feature is not yed merged #}
|
||||
{#{% set thumb_path = thumbnail.path is defined ? thumbnail.path : "/path/to/subsitution" %}#}
|
||||
{#{% set url = record|thumb_url(app, 'thumbnail', thumb_path) %}#}
|
||||
|
||||
{#{{thumbnail_macro.format(record, url, thumbnail.width, thumbnail.height, th_size, th_size, extraclass, true, true)}}#}
|
||||
|
||||
{% if rollover_thumbnail and rollover_thumbnail.path is defined %}
|
||||
{#{% set url = record|thumb_url(app, 'thumbnailgif', thumb_path) %}#}
|
||||
{#{{thumbnail_macro.format(record, url, rollover_thumbnail.width, rollover_thumbnail.height, th_size, th_size, 'rollover-gif-hover', true, true)}}#}
|
||||
{#{% endif %}#}
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 25px; position:relative; text-align:left;">
|
||||
<table class="bottom" style="width:100%; table-layout:fixed;">
|
||||
<tr>
|
||||
<td style="text-align:left;text-overflow:ellipsis;overflow:hidden;">
|
||||
{{ record.get_collection_logo(app)|raw }}
|
||||
{{record.baseId | get_collection_logo(app, true)|raw}}
|
||||
</td>
|
||||
{% set l_width = 30 %}
|
||||
{% if user_rollover_thumbnail == 'preview' %}
|
||||
@@ -81,20 +92,17 @@
|
||||
{% if user_technical_display == '1' %}
|
||||
{% set l_width = l_width + 20 %}
|
||||
{% endif %}
|
||||
<td style='text-align:right;width:{{ l_width }}px;' valign='bottom'>
|
||||
{{ drop_down.prod(record, entry_id) }}
|
||||
{% if record.has_preview() and app['acl'].get(app['authentication'].getUser()).has_access_to_subdef(record, 'preview') %}
|
||||
<div tooltipsrc="{{ path('prod_tooltip_preview', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id() }) }}"
|
||||
class="previewTips"></div>
|
||||
{% endif %}
|
||||
<td style='text-align:right;width:{{l_width}}px;' valign='bottom'>
|
||||
{{drop_down.prod(record, entry_id)}}
|
||||
{# @todo acl methods should accept RecordInterface Object as parameter #}
|
||||
{#{% if preview and app['acl'].get(app['authentication'].getUser()).has_access_to_subdef(record, 'preview') %}#}
|
||||
{#<div tooltipsrc="{{ path('prod_tooltip_preview', { 'databoxId' : record.databoxId, 'recordId' : record.recordId }) }}" class="previewTips"></div>#}
|
||||
{#{% endif %}#}
|
||||
{% if user_rollover_thumbnail == 'preview' %}
|
||||
<div tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'answer', 'number' : record.get_number() }) }}"
|
||||
class="captionRolloverTips"></div>
|
||||
<div tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'answer', 'number' : record.get_number() }) }}" class="captionRolloverTips"></div>
|
||||
{% endif %}
|
||||
{% if user_technical_display == '1' %}
|
||||
<img class="infoTips"
|
||||
tooltipsrc="{{ path('prod_tooltip_technical_data', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id() }) }}"
|
||||
src="/skins/icons/info.gif"/>
|
||||
<img class="infoTips" tooltipsrc="{{ path('prod_tooltip_technical_data', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId }) }}" src="/skins/icons/info.gif"/>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user