Update templates

This commit is contained in:
Nicolas Le Goff
2014-10-14 20:54:26 +02:00
parent 14d91144a0
commit a5b3e24fc2
4 changed files with 122 additions and 116 deletions

View File

@@ -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 }}" />

View File

@@ -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}}">&#9660;</a>
id="contextTrigger_{{record.baseId}}_{{record.recordId}}">&#9660;</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>

View File

@@ -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;"