Fix mess in prod (record & feed) templates

This commit is contained in:
Nicolas Le Goff
2014-12-02 14:06:44 +01:00
parent 93d3e98e88
commit e9c6d1a56e
27 changed files with 802 additions and 646 deletions

View File

@@ -207,7 +207,7 @@ class Feed implements ControllerProviderInterface
$feeds = $app['repo.feeds']->getAllForUser($app['acl']->get($app['authentication']->getUser())); $feeds = $app['repo.feeds']->getAllForUser($app['acl']->get($app['authentication']->getUser()));
$datas = $app['twig']->render('prod/feeds/feeds.html.twig', [ $datas = $app['twig']->render('prod/results/feeds.html.twig', [
'feeds' => $feeds, 'feeds' => $feeds,
'feed' => new Aggregate($app['EM'], $feeds), 'feed' => new Aggregate($app['EM'], $feeds),
'page' => $page 'page' => $page

View File

@@ -52,8 +52,6 @@ class Query implements ControllerProviderInterface
{ {
$query = (string) $request->request->get('qry'); $query = (string) $request->request->get('qry');
$mod = $app['settings']->getUserSetting($app['authentication']->getUser(), 'view');
$json = []; $json = [];
$options = SearchEngineOptions::fromRequest($app, $request); $options = SearchEngineOptions::fromRequest($app, $request);
@@ -176,21 +174,10 @@ class Query implements ControllerProviderInterface
if ($result->getTotal() === 0) { if ($result->getTotal() === 0) {
$template = 'prod/results/help.html.twig'; $template = 'prod/results/help.html.twig';
} else { } else {
if ($mod == 'thumbs') { $template = 'prod/results/records.html.twig';
$template = 'prod/results/answergrid.html.twig';
} else {
$template = 'prod/results/answerlist.html.twig';
}
} }
$json['results'] = $app['twig']->render($template, [ $json['results'] = $app['twig']->render($template, ['results'=> $result]);
'results' => $result,
'highlight' => $result->getQuery(),
'searchEngine' => $app['phraseanet.SE'],
'searchOptions' => $options,
'suggestions' => $prop
]
);
$json['query'] = $query; $json['query'] = $query;

View File

@@ -29,7 +29,7 @@
{% for item in feed_entry.getItems() %} {% for item in feed_entry.getItems() %}
<li class="image_box" id="item_{{item.getId()}}"> <li class="image_box" id="item_{{item.getId()}}">
<a href="{{ path('lightbox_ajax_load_feeditem', { 'entry_id' : feed_entry.getId(), 'item_id' : item.getId()}) }}"> <a href="{{ path('lightbox_ajax_load_feeditem', { 'entry_id' : feed_entry.getId(), 'item_id' : item.getId()}) }}">
{{thumbnail.format(item.getRecord(app).get_thumbnail(), 80, 80, '', true, false)}} {{ thumbnail.format(item.getRecord(app).get_thumbnail(), 80, 80, '', true, false) }}
</a> </a>
<input type="hidden" class="display_id" name="display_id" value="{{item.getOrd()}}" /> <input type="hidden" class="display_id" name="display_id" value="{{item.getOrd()}}" />
</li> </li>

View File

@@ -1,16 +0,0 @@
{% macro format(record)%}
{% 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 }}" />
{% elseif doctype == 'document' %}
<img src="/skins/icons/icon_document.gif" title="{{ 'document' | trans }}" />
{% elseif doctype == 'flash' %}
<img src="/skins/icons/icon_flash.gif" title="{{ 'animation flash' | trans }}" />
{% elseif doctype == 'video' %}
<img src="/skins/icons/icon_video.gif" title="{{ 'video' | trans }}" />
{% elseif doctype == 'audio' %}
<img src="/skins/icons/icon_audio.gif" title="{{ 'audio' | trans }}" />
{% endif %}
{% endmacro %}

View File

@@ -1,49 +0,0 @@
{% macro prod(record, entry_id)%}
{% if not entry_id %}
<a style="float:right;padding:0;margin:0;cursor:pointer;" class="contextMenuTrigger"
id="contextTrigger_{{record.baseId}}_{{record.recordId}}">&#9660;</a>
<table cellspacing="0" cellpadding="0" style="display:none;"
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.baseId, 'canputinalbum') and not record.story %}
<div title="" class="context-menu-item">
<div class="context-menu-item-inner"
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.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.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.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.databoxId, 'bas_chupub')) %}
{% if record.story is empty %}
<div title="" class="context-menu-item">
<div class="context-menu-item-inner"
onclick="shareThis('{{record.baseId}}','{{record.recordId}}');">
{{ 'reponses:: partager' | trans }}
</div>
</div>
{% endif %}
{% endif %}
</div>
</td>
</tr>
</tbody>
</table>
{% endif %}
{% endmacro %}

View File

@@ -4,7 +4,7 @@
theme : 'custom', theme : 'custom',
custom_theme_widget: 'recaptcha_widget', custom_theme_widget: 'recaptcha_widget',
lang : '{{ app['locale'] }}' lang : '{{ app['locale'] }}'
}; };
</script> </script>
<div class="row-fluid"> <div class="row-fluid">
@@ -46,7 +46,7 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@@ -54,9 +54,9 @@
{% set public_key = app["conf"].get(['registry', 'webservices', 'recaptcha-public-key']) %} {% set public_key = app["conf"].get(['registry', 'webservices', 'recaptcha-public-key']) %}
<script type="text/javascript" src="https://www.google.com/recaptcha/api/challenge?k={{ app['recaptcha'].getPublicKey() }}"></script> <script type="text/javascript" src="https://www.google.com/recaptcha/api/challenge?k={{ app['recaptcha'].getPublicKey() }}"></script>
<noscript> <noscript>
<iframe src="https://www.google.com/recaptcha/api/noscript?k={{ app['recaptcha'].getPublicKey() }}" height="300" width="500" frameborder="0"></iframe><br> <iframe src="https://www.google.com/recaptcha/api/noscript?k={{ app['recaptcha'].getPublicKey() }}" height="300" width="500" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea> <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge"> <input type="hidden" name="recaptcha_response_field" value="manual_challenge">
</noscript> </noscript>
{% endmacro %} {% endmacro %}
@@ -103,14 +103,15 @@
{% endmacro %} {% endmacro %}
{% macro format_caption(record, highlight, search_engine, include_business, bounceable, technical_data) %} {% macro format_caption(record, highlight, search_engine, include_business, bounceable, technical_data) %}
{# @todo business fields are always included ... #} {% for field in record.get_caption().get_highlight_fields(highlight, null, search_engine, include_business) %}
{% for name, value in record.getCaption() %} {% set extra_classes = ['pair'] %}
<div class="desc {{ cycle(['odd', 'even'], loop.index0) }}"> {% if loop.index is odd %}
<b>{{ name }}</b> : {{ value is iterable ? value|join('; ') : value }} {% set extra_classes = ['impair'] %}
</div> {% endif %}
{{ _self.caption_field(field, bounceable|default(true), extra_classes) }}
{% endfor %} {% endfor %}
{% if technical_data|default(true) and app['authentication'].user is not none and app['settings'].getUserSetting(app['authentication'].user, 'technical_display') == 'group' %} {% if technical_data|default(true) and app['authentication'].getUser() is not none and app['settings'].getUserSetting(app['authentication'].getUser(), 'technical_display') == 'group' %}
<hr/> <hr/>
{% include 'common/technical_datas.html.twig' %} {% include 'common/technical_datas.html.twig' %}
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}

View File

@@ -1,63 +1,64 @@
{% macro format(record, url, thumb_w, thumb_h, box_w, box_h, extra_class, wrap) %} {% macro format(thumbnail, box_w, box_h, extra_class, wrap, lazyload) %}
{% set record_type = record.type %} {# @todo remove lazyload #}
{% set box_w = box_w|round %}
{% set box_h = box_h|default(box_w)|round %}
{% if record_type == 'AUDIO' %} {% set record_type = thumbnail.get_type() %}
{% set original_w = 320 %} {% set box_w = box_w|round %}
{% set original_h = 60 %} {% set box_h = box_h|default(box_w)|round %}
{% set fit_size = { {% if record_type == 'AUDIO_MP3' %}
"width":original_w, {% set original_w = 320 %}
"height":original_h, {% set original_h = 60 %}
"top":0,
"left": 0
} %}
{% elseif record_type == 'FLEXPAPER' %}
{% set original_w = 800 %}
{% set original_h = 600 %}
{% set fit_size = { {% set fit_size = {
"width":800, "width":original_w,
"height":600, "height":original_h,
"top":0, "top":0,
"left": 0 "left": 0
} %} } %}
{% else %} {% elseif record_type == 'FLEXPAPER' %}
{% set original_h = thumb_h > 0 ? thumb_h : 120 %} {% set original_w = 800 %}
{% set original_w = thumb_w > 0 ? thumb_w : 120 %} {% set original_h = 600 %}
{% set fit_size = fitIn( {% set fit_size = {
{"width":original_w, "height":original_h}, "width":800,
{"width":box_w, "height":box_h} "height":600,
)%} "top":0,
{% endif %} "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 %}
{% if wrap %} {% set fit_size = fitIn(
<div {"width":original_w, "height":original_h},
style="width:{{box_w}}px;height:{{box_h}}px;" {"width":box_w, "height":box_h}
class="thumb_wrapper {{extra_class|default('')}}" )%}
> {% endif %}
{% endif %}
{% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %} {% set url = app['authentication'].isAuthenticated() ? thumbnail.get_url() : thumbnail.get_permalink().get_url() %}
{% import 'common/players/video.html.twig' as player %}
{{ player.video_player(thumbnail, url, original_w, original_h, fit_size) }}
{% elseif record_type == 'FLEXPAPER' %}
{% import 'common/players/pdf.html.twig' as player %}
{{ player.pdf_player(thumbnail, url, original_w, original_h, fit_size) }}
{% elseif record_type == 'AUDIO_MP3' %}
{% import 'common/players/audio.html.twig' as player %}
{{ player.audio_player(thumbnail, url, original_w, original_h, fit_size) }}
{% else %}
<img class="record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
style="width:{{fit_size.width}}px;height:{{fit_size.height}}px;top:{{fit_size.top}}px;"
src="{{ url }}" ondragstart="return false;">
<input type="hidden" name="width" value="{{original_w}}"/>
<input type="hidden" name="height" value="{{original_h}}"/>
{% endif %}
{% if wrap %} {% if wrap %}
<div style="width:{{box_w}}px;height:{{box_h}}px;" class="thumb_wrapper {{extra_class|default('')}}" >
{% endif %}
{% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %}
{% import 'common/players/video.html.twig' as player %}
{{ player.video_player(thumbnail, url, original_w, original_h, fit_size) }}
{% elseif record_type == 'FLEXPAPER' %}
{% import 'common/players/pdf.html.twig' as player %}
{{ player.pdf_player(thumbnail, url, original_w, original_h, fit_size) }}
{% elseif record_type == 'AUDIO_MP3' %}
{% import 'common/players/audio.html.twig' as player %}
{{ player.audio_player(thumbnail, url, original_w, original_h, fit_size) }}
{% else %}
<img class="{% if lazyload %}lazyload{% endif %} record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
style="width:{{fit_size.width}}px;height:{{fit_size.height}}px;top:{{fit_size.top}}px;"
src="{% if lazyload %}/skins/grey.gif{% else %}{{ url }}{% endif %}" data-original="{{ url }}" ondragstart="return false;">
<input type="hidden" name="width" value="{{original_w}}"/>
<input type="hidden" name="height" value="{{original_h}}"/>
{% endif %}
{% if wrap %}
</div> </div>
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}

View File

@@ -1,2 +0,0 @@
{% import 'prod/feeds/entry_macro.html.twig' as _entry %}
{{ _entry.format(entry.getFeed(), entry) }}

View File

@@ -1,67 +0,0 @@
{% macro format(feed, entry)%}
{% import 'prod/results/record.html.twig' as record_format %}
<div class="entry ui-corner-all" id="entry_{{ entry.getId() }}">
<table class="head">
<tr>
<td>
<h1 class="title">
{% if feed.isAggregated() %}
<img style="height:16px;" src="{% if entry.getFeed().getIconUrl() == false %}
/skins/icons/rss32.gif
{% else %}
/custom/feed_{{ entry.getFeed().getId() }}.jpg
{% endif %}"/>
{% endif %}
{{ entry.getTitle() }}
{% set author = entry.getAuthorName() %}
<span class="author">{% trans with {'%author%' : author} %}Par %author%{% endtrans %}</span>
</h1>
</td>
<td style="width:60px;text-align:right;">
{% if entry.getFeed().isOwner(app['authentication'].getUser()) or entry.isPublisher(app['authentication'].getUser()) %}
<a class="tools options feed_edit" href="{{ path('prod_feeds_entry_edit', { 'id' : entry.getId() }) }}">
<img src="/skins/icons/file-edit.png" title="{{ 'boutton::editer' | trans }}"/>
</a>
<a class="tools feed_delete" href="{{ path('prod_feeds_entry_delete', { 'id' : entry.getId() }) }}">
<img src="/skins/icons/delete.png" title="{{ 'boutton::supprimer' | trans }}"/>
</a>
{% endif %}
</td>
</tr>
</table>
<div class="post_date">
{% set updated_on = app['date-formatter'].getPrettyString(entry.getUpdatedOn()) %}
{% set created_on = app['date-formatter'].getPrettyString(entry.getCreatedOn()) %}
<span class="created_on">
{{ created_on }}
</span>
{% if created_on != updated_on %}
<span class="updated_on">
(
{% trans with {'%updated_on%' : updated_on} %}Derniere mise a jour le %updated_on%{% endtrans %}
)
</span>
{% endif %}
{% if feed.isAggregated() %}
<a class="ajax_answers" href="{{ path('prod_feeds_feed', { 'id' : entry.getFeed().getId() }) }}">
{% set feed_name = entry.getFeed().getTitle() %}
{% trans with {'%feed_name%' : feed_name} %}dans %feed_name%{% endtrans %}
<img style="height:16px;" src="{% if entry.getFeed().getIconUrl() == false %}
/skins/icons/rss32.gif
{% else %}
/custom/feed_{{ entry.getFeed().getId() }}.jpg
{% endif %}"/>
</a>
{% endif %}
</div>
<p>{{ entry.getSubtitle()|nl2br|raw }}</p>
<div class="contents selectable">
{% for item in entry.getItems() %}
{% set record = item.getRecord(app) %}
{% set prefix = 'PUBLI_' ~ item.getId() %}
{{record_format.block(record, false, null, prefix, entry.getId())}}
{% endfor %}
</div>
</div>
{% endmacro %}

View File

@@ -1,84 +0,0 @@
{% import 'prod/feeds/entry_macro.html.twig' as _entry %}
<div class="feed">
{% if page == 1 %}
<div class="headblock">
<table>
<tr>
<td style="width:600px;">
<h1>
<img src="{% if feed.getIconUrl() == false %}
/skins/icons/rss32.gif
{% else %}
/custom/feed_{{ feed.getId() }}.jpg
{% endif %}" style="height:32px;"/>
{% if feed.isAggregated %}
{{ 'Toutes les publications' | trans }}
<a class="feed_reload ajax_answers no_scroll" href="{{ path('prod_feeds') }}" >
<img src="/skins/icons/reload.png" title="{{ 'rafraichir' | trans }}" />
</a>
{% else %}
{{ feed.getTitle() }}
<a class="feed_reload ajax_answers" href="{{ path('prod_feeds_feed', { 'id' : feed.getId() }) }}" >
<img src="/skins/icons/reload.png" title="{{ 'rafraichir' | trans }}" />
</a>
{% endif %}
{% if feed.isAggregated %}
<a class="subscribe_rss" href="{{ path('prod_feeds_subscribe_aggregated') }}">{{ 'publications:: s\'abonner aux publications' | trans }}</a>
{% else %}
<a class="subscribe_rss" href="{{ path('prod_feeds_subscribe_feed', { 'id' : feed.getId() }) }}">{{ 'publications:: s\'abonner aux publications' | trans }}</a>
{% endif %}
</h1>
</td>
<td>
<div class="menu_feeds">
<div class="btn-group">
<button class="trigger btn btn-inverse dropdown-toggle" data-toggle="dropdown">
{{ 'Aller a' | trans }}
<span class="caret"></span>
</button>
<ul class="submenu dropdown-menu">
{% for aval_feed in feeds %}
<li>
<a class="ajax_answers" href="{{ path('prod_feeds_feed', { 'id' : aval_feed.getId() }) }}">
<img src="{% if aval_feed.getIconUrl() == false %}
/skins/icons/rss32.gif
{% else %}
/custom/feed_{{ aval_feed.getId() }}.jpg
{% endif %}" style="height:16px;"/> {{ aval_feed.getTitle() }}
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</td>
</tr>
</table>
</div>
{% endif %}
{% set offset_start = ((page - 1) * 5 )%}
{% set entries = feed.getEntries(offset_start,5) %}
{% for entry in entries %}
{{ _entry.format(feed, entry) }}
{% endfor %}
{% if entries|length == 0 %}
<p>{{ 'Aucune entree pour le moment' | trans }}</p>
{% endif %}
{% if feed.getCountTotalEntries() > (page*5) %}
{% set next_page = page + 1 %}
<div class="see_more">
{% if feed.isAggregated() %}
<a href="{{ path('prod_feeds', { page : next_page }) }}" class="ajax_answers append">
{{ 'charger d\'avantage de publications' | trans }}
</a>
{% else %}
<a href="{{ path('prod_feeds_feed', { 'id' : feed.getId(), 'page' : next_page }) }}" class="ajax_answers append">
{{ 'charger d\'avantage de publications' | trans }}
</a>
{% endif %}
</div>
{% endif %}
</div>

View File

@@ -1,35 +1,48 @@
<div id="PREVIEWCURRENTCONT" class="PNB10"> <div id="PREVIEWCURRENTCONT" class="PNB10">
<ul> <ul>
{% for child in record.get_container().getElements() %} {% set basket = record.get_container %}
{% for element in basket.elements %}
{% set thumbnail = child.getRecord(app).get_thumbnail() %} {% set record_item = element.record(app) %}
{% if thumbnail.is_paysage() %}
{% set style = 'width:65px;top:' %} {% set thumb_w = 70 %}
{% if thumbnail.get_width() > 0 and thumbnail.get_height() > 0 %} {% set thumb_h = 70 %}
{% set top = ((66 - (65 / (thumbnail.get_width() / thumbnail.get_height()))) / 2)|round %}
{% else %} {% set thumbnail = record_item.get_thumbnail %}
{% set top = 65 %}
{% if thumbnail is not none %}
{% set thumb_w = thumbnail.get_width %}
{% set thumb_h = thumbnail.get_height %}
{% endif %} {% endif %}
{% set style = style ~ top %}
{% set style = style ~ 'px;' %}
{% else %}
{% set style = 'height:65px;top:0;' %}
{% endif %}
{% set tooltip = '' %} {% set url = record_thumbnail_url(record_item) %}
{% if app['conf'].get(['registry', 'classic', 'stories-preview']) %}
{% set tooltip = path('prod_tooltip_caption', { 'sbas_id' : child.getRecord(app).get_sbas_id(), 'record_id' : child.getRecord(app).get_record_id(), 'context' : 'basket' }) %}
{% endif %}
{% set class = '' %} {% set box_w = 70 %}
{% if record.get_number() == child.getOrd() %} {% set box_h = 80 %}
{% set class = ' selected' %}
{% endif %}
<li class="{{class}} prevTrainCurrent"> {% set original_h = thumb_h > 0 ? thumb_h : 70 %}
<img {% if tooltip %}tooltipsrc="{{ tooltip }}"{% endif %} jsargs="BASK|{{child.getOrd()}}|{{record.get_container().getId()}}" {% set original_w = thumb_w > 0 ? thumb_w : 70 %}
class="openPreview prevRegToolTip" return(false);" src="{{thumbnail.get_url()}}"
style="{{style}}margin:7px;position:relative;"/></li> {% set fit_size = fitIn(
{"width":original_w, "height":original_h},
{"width":box_w, "height":box_h}
)
%}
<li class="{% if record.get_number == element.ord %}selected{% endif %} prevTrainCurrent">
<img {% if app['conf'].get(['registry', 'classic', 'stories-preview']) %}
tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : record_item.databoxId, 'record_id' : record_item.recordId, 'context' : 'basket' }) }}"
{% endif %}
jsargs="BASK|{{element.ord}}|{{basket.id}}"
class="openPreview prevRegToolTip" src="{{url}}"
style="
width:{{fit_size.width}}px;
height:{{fit_size.height}}px;
top:{{fit_size.top}}px;
position:relative;
"
/>
</li>
{% endfor %} {% endfor %}
</ul> </ul>

View File

@@ -15,5 +15,5 @@
{% if record.is_from_reg() %} {% if record.is_from_reg() %}
{{macro.format_caption(record, '', null, null, business, false, true)}} {{macro.format_caption(record, '', null, null, business, false, true)}}
{% else %} {% else %}
{{macro.format_caption(record, highlight, searchEngine, business, false, true)}} {{macro.format_caption(record, null, null, business, false, true)}}
{% endif %} {% endif %}

View File

@@ -1,35 +1,46 @@
<div id="PREVIEWCURRENTCONT" class="PNB10"> <div id="PREVIEWCURRENTCONT" class="PNB10">
<ul> <ul>
{% for child in record.get_container() %} {% set entry = record.get_container() %}
{% for item in entry.items %}
{% set record_item = item.record(app) %}
{% set thumbnail = child.getRecord(app).get_thumbnail() %} {% set thumb_w = 70 %}
{% if thumbnail.is_paysage() %} {% set thumb_h = 70 %}
{% set style = 'width:65px;top:' %}
{% if thumbnail.get_width() > 0 and thumbnail.get_height() > 0 %} {% set thumbnail = record_item.get_thumbnail %}
{% set top = ((66 - (65 / (thumbnail.get_width() / thumbnail.get_height()))) / 2)|round %}
{% else %} {% if thumbnail is not none %}
{% set top = 65 %} {% set thumb_w = thumbnail.get_width %}
{% set thumb_h = thumbnail.get_height %}
{% endif %} {% endif %}
{% set style = style ~ top %}
{% set style = style ~ 'px;' %}
{% else %}
{% set style = 'height:65px;top:0;' %}
{% endif %}
{% set tooltip = '' %} {% set url = record_thumbnail_url(record_item) %}
{% if app['conf'].get(['registry', 'classic', 'stories-preview']) %}
{% set tooltip = path('prod_tooltip_preview', { 'sbas_id' : child.get_record().get_sbas_id(), 'record_id' : child.get_record().get_record_id() }) %}
{% endif %}
{% set class = '' %} {% set box_w = 70 %}
{% if record.get_number() == child.getOrd() %} {% set box_h = 80 %}
{% set class = ' selected' %}
{% endif %}
<li class="{{class}} prevTrainCurrent"> {% set original_h = thumb_h > 0 ? thumb_h : 70 %}
<img {% if tooltip %}tooltipsrc="{{ tooltip }}"{% endif %} jsargs="FEED|{{child.get_ord()}}|{{record.get_container().getId()}}" {% set original_w = thumb_w > 0 ? thumb_w : 70 %}
class="openPreview prevRegToolTip" return(false);" src="{{thumbnail.get_url()}}"
style="{{style}}margin:7px;position:relative;"/></li> {% set fit_size = fitIn(
{"width":original_w, "height":original_h},
{"width":box_w, "height":box_h}
)
%}
<li class="{% if record.get_number == item.ord %}selected{% endif %} prevTrainCurrent">
<img {% if app['conf'].get(['registry', 'classic', 'stories-preview']) %}
tooltipsrc="{{ path('prod_tooltip_preview', { 'sbas_id' :record_item.databoxId, 'record_id' : record_item.recordId }) }}"
{% endif %}
jsargs="FEED|{{item.ord}}|{{entry.id}}"
class="openPreview prevRegToolTip" src="{{url}}"
style="
width:{{fit_size.width}}px;
height:{{fit_size.height}}px;
top:{{fit_size.top}}px;
position:relative;
"
/></li>
{% endfor %} {% endfor %}
</ul> </ul>

View File

@@ -1,54 +1,79 @@
{% set story = record.get_container %}
{% set regroupement = record.get_container() %} {% set thumb_w = 90 %}
{% set thumbnail = regroupement.get_thumbnail() %} {% set thumb_h = 90 %}
{% if thumbnail.get_height() > 0 %} {% set thumbnail = story.get_thumbnail %}
{% set ratio = thumbnail.get_width() / thumbnail.get_height() %}
{% else %} {% if thumbnail is not none %}
{% set ratio = 1 %} {% set thumb_w = thumbnail.get_width %}
{% endif %} {% set thumb_h = thumbnail.get_height %}
{% if thumbnail.is_paysage %} {% endif %}
{% set style = 'width:80px;top:' %}
{% set top = (8 + (80 - (80 / ratio)) / 2)|round %} {% set url = record_thumbnail_url(story) %}
{% set style = style ~ top %}
{% set style = style ~ 'px;' %} {% set box_w = 90 %}
{% else %} {% set box_h = 96 %}
{% set style = 'height:80px;top:8px;' %}
{% endif %} {% set original_h = thumb_h > 0 ? thumb_h : 90 %}
{% set original_w = thumb_w > 0 ? thumb_w : 90 %}
{% set fit_size = fitIn(
{"width":original_w, "height":original_h},
{"width":box_w, "height":box_h}
)
%}
<div id="PREVMAINREG" class="PNB10"> <div id="PREVMAINREG" class="PNB10">
<img onclick="openPreview('REG',0,'{{regroupement.get_serialize_key()}}')" <img onclick="openPreview('REG',0,'{{story.get_serialize_key}}')"
src="{{thumbnail.get_url()}}" style="position:relative;{{style}}" /> src="{{url}}"
style="
width:{{fit_size.width}}px;
height:{{fit_size.height}}px;
top:{{fit_size.top}}px;
position:relative;
" />
</div> </div>
<div id="PREVIEWCURRENTCONT" class="PNB10 group_case"> <div id="PREVIEWCURRENTCONT" class="PNB10 group_case">
<ul> <ul>
{% for record_item in record.get_train %}
{% set thumb_w = 70 %}
{% set thumb_h = 70 %}
{% for contained in record.get_train %} {% set thumbnail = record_item.get_thumbnail %}
{% set thumbnail = contained.get_thumbnail() %}
{% if thumbnail.is_paysage %} {% if thumbnail is not none %}
{% set style = 'width:65px;top:' %} {% set thumb_w = thumbnail.get_width %}
{% set top = ((66 - (65 / (thumbnail.get_width() / thumbnail.get_height()))) / 2)|round %} {% set thumb_h = thumbnail.get_height %}
{% set style = style ~ top %} {% endif %}
{% set style = style ~ 'px;' %}
{% else %}
{% set style = 'height:65px;top:8px;' %}
{% endif %}
{% set tooltip = '' %} {% set url = record_thumbnail_url(record_item) %}
{% if app['conf'].get(['registry', 'classic', 'stories-preview']) %}
{% set tooltip = path('prod_tooltip_caption', { 'sbas_id' : contained.get_sbas_id(), 'record_id' : contained.get_record_id(), 'context' : 'preview', 'number' : contained.get_number() }) %}
{% endif %}
{% set class = '' %} {% set box_w = 70 %}
{% if loop.index == record.get_number() %} {% set box_h = 80 %}
{% set class = ' selected' %}
{% endif %}
<li class="{{class}} prevTrainCurrent" style=""> {% set original_h = thumb_h > 0 ? thumb_h : 70 %}
<img {% if tooltip %}tooltipsrc="{{ tooltip }}"{% endif %} jsargs="REG|{{loop.index}}|{{regroupement.get_serialize_key}}" {% set original_w = thumb_w > 0 ? thumb_w : 70 %}
class="openPreview prevRegToolTip" src="{{thumbnail.get_url()}}"
style="{{style}}margin:7px;position:relative;"/></li> {% set fit_size = fitIn(
{"width":original_w, "height":original_h},
{"width":box_w, "height":box_h}
)
%}
<li class="{% if loop.index == record.get_number %}selected{% endif %} prevTrainCurrent" style="">
<img {% if app['conf'].get(['registry', 'classic', 'stories-preview']) %}tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : record_item.databoxId, 'record_id' : record_item.recordId, 'context' : 'preview', 'number' : record_item.get_number }) }}"{% endif %}
jsargs="REG|{{loop.index}}|{{story.get_serialize_key}}"
class="openPreview prevRegToolTip" src="{{url}}"
style="
width:{{fit_size.width}}px;
height:{{fit_size.height}}px;
top:{{fit_size.top}}px;
position:relative;
"
/></li>
{% endfor %} {% endfor %}
</ul> </ul>

View File

@@ -1,30 +1,41 @@
<div id="PREVIEWCURRENTCONT" class="PNB10"> <div id="PREVIEWCURRENTCONT" class="PNB10">
<ul> <ul>
{% for rec in records %} {% for record in records %}
{% set thumbnail = rec.get_thumbnail() %} {% set thumb_w = 70 %}
{% set w = thumbnail.get_width() %} {% set thumb_h = 70 %}
{% set h = thumbnail.get_height() %}
{% if thumbnail.is_paysage() %} {% set thumbnail = record.subdefs.get('thumbnail') %}
{% set style = 'width:65px;top:' %}
{% set top = ((66 - (65 / (w / h))) / 2)|round %} {% if thumbnail is not none %}
{% set style = style ~ top %} {% set thumb_w = thumbnail.width %}
{% set style = style ~ 'px;' %} {% set thumb_h = thumbnail.height %}
{% else %}
{% set style = 'height:65px;top:0;' %}
{% endif %} {% endif %}
{% if selected == rec.get_number() %} {% set url = record_thumbnail_url(record) %}
{% set class = ' selected ' %}
{% else %}
{% set class = '' %}
{% endif %}
<li class="prevTrainCurrent current{{rec.get_number()}} {{class}}" style=""> {% set box_w = 70 %}
<!--<div class="doc_infos">' . $array_icons[$record->get_type()] . '<span class="duration">{{rec.get_formated_duration()}}</span></div>--> {% set box_h = 80 %}
<img jsargs="RESULT|{{rec.get_number()}}|" class="openPreview" src="{{thumbnail.get_url()}}"
style="{{style}}margin:7px;position:relative;"/> {% set original_h = thumb_h > 0 ? thumb_h : 70 %}
{% set original_w = thumb_w > 0 ? thumb_w : 70 %}
{% set fit_size = fitIn(
{"width":original_w, "height":original_h},
{"width":box_w, "height":box_h}
)
%}
<li class="prevTrainCurrent current{{loop.index0}} {% if loop.index0 == selected %}selected{% endif %}">
<img jsargs="RESULT|{{loop.index0}}|" class="openPreview" src="{{url}}"
src="{{url}}"
style="
width:{{fit_size.width}}px;
height:{{fit_size.height}}px;
top:{{fit_size.top}}px;
position:relative;
"
/>
</li> </li>
{% endfor %} {% endfor %}

View File

@@ -1,20 +0,0 @@
{% import 'prod/results/record.html.twig' as record_format %}
{% if results.getError() %}
<div>{{results.getError()}}</div>
{% else %}
{% if results.getWarning() %}
<div>{{results.getWarning()}}</div>
{% endif %}
{% if suggestions %}
{% set suggestions = suggestions|e %}
{% set link = '<a href="#" onclick="doSpecialSearch(\'' ~ suggestions ~ '\');return false;">' ~ suggestions ~ '</a>' %}
{% trans with {'%link%' : link} %}Voulez-vous dire %link% ?{% endtrans %}
<br/>
{% endif %}
{% set th_size = app['settings'].getUserSetting(app['authentication'].getUser(), 'images_size')%}
<div class="selectable" style="margin:10px 0; float:left;">
{% block content %}{% endblock %}
</div>
{% endif %}

View File

@@ -1,11 +0,0 @@
{% extends "prod/results/answerabstract.html.twig" %}
{% block content %}
{% for record in results.getResults() %}
{{record_format.block(record, highlight, searchEngine, 'IMGT', false)}}
{% endfor %}
{% endblock %}

View File

@@ -1,27 +0,0 @@
{% extends "prod/results/answerabstract.html.twig" %}
{% block content %}
{% import 'common/macros.html.twig' as macro %}
{% for record in results.getResults() %}
<div class='list ui-corner-all'>
<table style='width:100%;' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td valign="top" style='width:{{th_size+50}}px'>
{{ record_format.block(record, highlight, searchEngine, 'IMGT', false) }}
</td>
<td valign="middle">
<div class='desc' style='max-height:{{th_size+70}}px;overflow-y:auto;'>
<div class="fixeddesc">
{% set business = app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.baseId(), 'canmodifrecord') %}
{{ macro.format_caption(record, highlight, searchEngine, searchOptions, business, true, true) }}
</div>
</div>
</td>
</tr>
</table>
</div>
{% endfor %}
{% endblock %}

View File

@@ -0,0 +1,70 @@
{% import 'prod/results/macro.html.twig' as result_macro %}
<div class="entry ui-corner-all" id="entry_{{ entry.id }}">
<table class="head">
<tr>
<td>
<h1 class="title">
{% if feed.aggregated %}
<img style="height:16px;" src="{% if entry.feed.iconUrl == false %} /skins/icons/rss32.gif{% else %}/custom/feed_{{ entry.feed.id }}.jpg{% endif %}"/>
{% endif %}
{{ entry.title }}
{% set author = entry.authorName %}
<span class="author">
{% trans with {'%author%' : author} %}Par %author%{% endtrans %}
</span>
</h1>
</td>
<td style="width:60px;text-align:right;">
{% if entry.feed.isOwner(app['authentication'].user) or entry.isPublisher(app['authentication'].user) %}
<a class="tools options feed_edit" href="{{ path('prod_feeds_entry_edit', { 'id' : entry.id }) }}">
<img src="/skins/icons/file-edit.png" title="{{ 'boutton::editer' | trans }}"/>
</a>
<a class="tools feed_delete"href="{{ path('prod_feeds_entry_delete', { 'id' : entry.id }) }}">
<img src="/skins/icons/delete.png" title="{{ 'boutton::supprimer' | trans }}"/>
</a>
{% endif %}
</td>
</tr>
</table>
<div class="post_date">
{% set updated_on = app['date-formatter'].getPrettyString(entry.updatedOn) %}
{% set created_on = app['date-formatter'].getPrettyString(entry.createdOn) %}
<span class="created_on">
{{ created_on }}
</span>
{% if created_on != updated_on %}
<span class="updated_on">
(
{% trans with {'%updated_on%' : updated_on} %}Derniere mise a jour le %updated_on%{% endtrans %}
)
</span>
{% endif %}
{% if feed.aggregated %}
<a class="ajax_answers" href="{{ path('prod_feeds_feed', { 'id' : entry.feed.id }) }}">
{% set feed_name = entry.feed.title %}
{% trans with {'%feed_name%' : feed_name} %}dans %feed_name%{% endtrans %}
<img style="height:16px;" src="{% if entry.feed.iconUrl == false %}/skins/icons/rss32.gif{% else %}/custom/feed_{{ entry.feed.id }}.jpg{% endif %}"/>
</a>
{% endif %}
</div>
<p>{{ entry.getSubtitle()|nl2br|raw }}</p>
<div class="contents selectable">
{% for item in entry.items %}
{% block item %}
{% include 'prod/results/item.html.twig' with {
'item' : item,
'entry': entry,
'settings': {
'images_size': images_size,
'technical_display': technical_display,
'rollover_thumbnail': rollover_thumbnail,
'doctype_display': doctype_display
}
} %}
{% endblock %}
{% endfor %}
</div>
</div>

View File

@@ -0,0 +1,97 @@
{% block result %}
<div class="feed">
{# header for first page #}
{% if page == 1 %}
<div class="headblock">
<table>
<tr>
<td style="width:600px;">
<h1>
<img src="{% if feed.iconUrl == false %}/skins/icons/rss32.gif{% else %}{% endif %}" style="height:32px;"/>
{% if feed.isAggregated %}
{{ 'Toutes les publications' | trans }}
<a class="subscribe_rss" href="{{ path('prod_feeds_subscribe_aggregated') }}">
{{ 'publications:: s\'abonner aux publications' | trans }}
</a>
<a class="feed_reload ajax_answers no_scroll" href="{{ path('prod_feeds') }}" >
<img src="/skins/icons/reload.png" title="{{ 'rafraichir' | trans }}" />
</a>
{% else %}
{{ feed.title }}
<a class="feed_reload ajax_answers" href="{{ path('prod_feeds_feed', { 'id' : feed.id }) }}" >
<img src="/skins/icons/reload.png" title="{{ 'rafraichir' | trans }}" />
</a>
<a class="subscribe_rss" href="{{ path('prod_feeds_subscribe_feed', { 'id' : feed.id }) }}">
{{ 'publications:: s\'abonner aux publications' | trans }}
</a>
{% endif %}
</h1>
</td>
<td>
<div class="menu_feeds">
<div class="btn-group">
<button class="trigger btn btn-inverse dropdown-toggle" data-toggle="dropdown">
{{ 'Aller a' | trans }}
<span class="caret"></span>
</button>
<ul class="submenu dropdown-menu">
{% for aval_feed in feeds %}
<li>
<a class="ajax_answers" href="{{ path('prod_feeds_feed', { 'id' : aval_feed.id }) }}">
<img src="{% if aval_feed.iconUrl == false %}/skins/icons/rss32.gif{% else %}/custom/feed_{{ aval_feed.id }}.jpg{% endif %}" style="height:16px;"/> {{ aval_feed.title }}
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</td>
</tr>
</table>
</div>
{% endif %}
{% block content %}
{% set images_size = user_setting('images_size') %}
{% set technical_display = user_setting('technical_display') %}
{% set rollover_thumbnail = user_setting('rollover_thumbnail') %}
{% set doctype_display = user_setting('doctype_display') %}
{% set offset_start = ((page - 1) * 5 )%}
{% set entries = feed.getEntries(offset_start,5) %}
{% for entry in entries %}
{% block content_item %}
{% include 'prod/results/entry.html.twig' with {
'feed': feed,
'entry': entry,
'settings': {
'images_size': images_size,
'technical_display': technical_display,
'rollover_thumbnail': rollover_thumbnail,
'doctype_display': doctype_display
}
} %}
{% endblock %}
{% else %}
<p>{{ 'Aucune entree pour le moment' | trans }}</p>
{% endfor %}
{# pagination #}
{% if feed.countTotalEntries > (page * 5) %}
{% set next_page = page + 1 %}
<div class="see_more">
{% if feed.aggregated %}
<a href="{{ path('prod_feeds', { page : next_page }) }}" class="ajax_answers append">
{{ 'charger d\'avantage de publications' | trans }}
</a>
{% else %}
<a href="{{ path('prod_feeds_feed', { 'id' : feed.id, 'page' : next_page }) }}" class="ajax_answers append">
{{ 'charger d\'avantage de publications' | trans }}
</a>
{% endif %}
</div>
{% endif %}
{% endblock %}
</div>
{% endblock %}

View File

@@ -0,0 +1,4 @@
{% include 'prod/results/record.html.twig' with {
'record': item,
'settings': settings
} %}

View File

@@ -1,85 +1,73 @@
{% block content %} {% block content %}
{% if results.getError() %} {% if results.error %}
<div>{{results.getError()}}</div> <div>{{ results.error }}</div>
{% else %} {% elseif results.warning %}
{% if results.getWarning() %} <div>{{ results.warning }}</div>
<div>{{results.getWarning()}}</div> {% endif %}
{% endif %}
{% endif %}
<p> <p>
{{ 'Votre recherche ne retourne aucun resultat' | trans }} {{ 'Votre recherche ne retourne aucun resultat' | trans }}
</p> </p>
{% if suggestions %}
{% set link = '<a href="#" onclick="doSpecialSearch(\'' ~ suggestions ~ '\');return false;">' ~ suggestions ~ '</a>' %}
{% trans with {'%link%' : link} %}Voulez-vous dire %link% ?{% endtrans %}
<br/>
{% endif %}
{% set th_size = app['settings'].getUserSetting(app['authentication'].getUser(), 'images_size')%}
{% if app['locale'] == 'fr' %}
<div class="client_help"> <div class="client_help">
<h5>{{ 'La recherche s\'effectue grâce à la boîte de dialogue qui se trouve en haut à gauche de l\'écran.' | trans }} <h5>{{ 'La recherche s\'effectue grâce à la boîte de dialogue qui se trouve en haut à gauche de l\'écran.' | trans }}
{{ 'Sachez que vous pouvez utiliser les opérateurs ou caractères spéciaux suivants :' | trans }}</h5> {{ 'Sachez que vous pouvez utiliser les opérateurs ou caractères spéciaux suivants :' | trans }}</h5>
<h5 style="border:#CCCCCC 2px solid">{{ '* , ? , ET , OU , SAUF , DANS , DERNIERS , TOUT (ou AND , OR , EXCEPT , LAST , ALL)' | trans }}</h5> <h5 style="border:#CCCCCC 2px solid">{{ '* , ? , ET , OU , SAUF , DANS , DERNIERS , TOUT (ou AND , OR , EXCEPT , LAST , ALL)' | trans }}</h5>
<H5>{{ 'Caractères de troncature' | trans }}</H5> <h5>{{ 'Caractères de troncature' | trans }}</h5>
<table> <table>
<tr> <tr>
<td valign="top"><kbd class="ky">{{ 'auto*' | trans }}</kbd></td> <td valign="top"><kbd class="ky">{{ 'auto*' | trans }}</kbd></td>
<td valign="top"> {{ 'retourne "automobile", "automate", "autoroute", ...' | trans }}</td> <td valign="top"> {{ 'retourne "automobile", "automate", "autoroute", ...' | trans }}</td>
</tr> </tr>
<tr> <tr>
<td valign="top"><kbd class="ky">{{ 'dé?it' | trans }}</kbd></td> <td valign="top"><kbd class="ky">{{ 'dé?it' | trans }}</kbd></td>
<td valign="top"> {{ 'retourne "délit", "débit", ...' | trans }}</td> <td valign="top"> {{ 'retourne "délit", "débit", ...' | trans }}</td>
</tr> </tr>
</table> </table>
<H5>{{ 'Visualiser tous les enregistrements / les derniers enregistrements' | trans }}</H5> <h5>{{ 'Visualiser tous les enregistrements / les derniers enregistrements' | trans }}</h5>
<table> <table>
<tr> <tr>
<td valign="top"><kbd class="ky"><b>{{ 'TOUT' | trans }}</b></kbd></td> <td valign="top"><kbd class="ky"><b>{{ 'TOUT' | trans }}</b></kbd></td>
<td valign="top">{{ 'retourne tous les enregistrements des collections selectionnees' | trans }}</td> <td valign="top">{{ 'retourne tous les enregistrements des collections selectionnees' | trans }}</td>
</tr> </tr>
<tr> <tr>
<td valign="top"><kbd class="ky"><b>{{ 'LAST 20' | trans }}</b></kbd></td> <td valign="top"><kbd class="ky"><b>{{ 'LAST 20' | trans }}</b></kbd></td>
<td valign="top">{{ 'retourne les 20 derniers enregistrements archives dans les collections selectionnees' | trans }}</td> <td valign="top">{{ 'retourne les 20 derniers enregistrements archives dans les collections selectionnees' | trans }}</td>
</tr> </tr>
</table> </table>
<H5>{{ 'Recherche multicritères' | trans }}</H5> <h5>{{ 'Recherche multicritères' | trans }}</h5>
{{ 'Vous pouvez affiner votre recherche avec les opérateurs : ET, OU, SAUF ou DANS' | trans }}<br> {{ 'Vous pouvez affiner votre recherche avec les opérateurs : ET, OU, SAUF ou DANS' | trans }}<br>
<table> <table>
<tr> <tr>
<td valign="top"><kbd class="ky">{{ 'sport' | trans }} <b>ET</b> {{ 'automobile' | trans }}</kbd></td> <td valign="top"><kbd class="ky">{{ 'sport' | trans }} <b>ET</b> {{ 'automobile' | trans }}</kbd></td>
<td valign="top">{{ 'retourne les documents comprenant les deux mots.' | trans }}</td> <td valign="top">{{ 'retourne les documents comprenant les deux mots.' | trans }}</td>
</tr> </tr>
<tr> <tr>
<td valign="top"><kbd class="ky">{{ 'journal OU jt' | trans }}</kbd></td> <td valign="top"><kbd class="ky">{{ 'journal OU jt' | trans }}</kbd></td>
<td valign="top">{{ 'retourne les documents comprenant un mot et/ou l\'autre.' | trans }}</td> <td valign="top">{{ 'retourne les documents comprenant un mot et/ou l\'autre.' | trans }}</td>
</tr> </tr>
<tr> <tr>
<td valign="top"><kbd class="ky">{{ 'cannes SAUF festival' | trans }}</kbd></td> <td valign="top"><kbd class="ky">{{ 'cannes SAUF festival' | trans }}</kbd></td>
<td valign="top">{{ 'retourne les documents comprenant cannes sans le mot festival.' | trans }}</td> <td valign="top">{{ 'retourne les documents comprenant cannes sans le mot festival.' | trans }}</td>
</tr> </tr>
<tr> <tr>
<td valign="top"><kbd class="ky">{{ 'thalassa DANS titre' | trans }}</kbd></td> <td valign="top"><kbd class="ky">{{ 'thalassa DANS titre' | trans }}</kbd></td>
<td valign="top">{{ 'retourne les documents où le terme est au moins présent dans le titre, en évitant par exemple celles où le terme est uniquement cité dans la légende.' | trans }}</td> <td valign="top">{{ 'retourne les documents où le terme est au moins présent dans le titre, en évitant par exemple celles où le terme est uniquement cité dans la légende.' | trans }}</td>
</tr> </tr>
</table> </table>
<center> <center>
<h3 style="background-color:#CCCCCC; color:#000000">{{ 'Attention' | trans }}</h3> <h3 style="background-color:#CCCCCC; color:#000000">{{ 'Attention' | trans }}</h3>
<h4> {{ 'pour chercher une phrase contenant un des mots-clé ci-dessus, utilisez les guillemets :' | trans }}</h4> <h4> {{ 'pour chercher une phrase contenant un des mots-clé ci-dessus, utilisez les guillemets :' | trans }}</h4>
<kbd class='tx'><i>"</i>{{ 'C dans l\'air' | trans }}<i>"</i></kbd> <kbd class='tx'><i>"</i>{{ 'C dans l\'air' | trans }}<i>"</i></kbd>
, <kbd class='tx'><i>"</i>{{ 'Et Dieu créa la femme' | trans }}<i>"</i></kbd> , <kbd class='tx'><i>"</i>{{ 'Et Dieu créa la femme' | trans }}<i>"</i></kbd>
, <kbd class='tx'><i>"</i>{{ 'bijou en or' | trans }}<i>"</i></kbd> , <kbd class='tx'><i>"</i>{{ 'bijou en or' | trans }}<i>"</i></kbd>
, <kbd class='tx'><i>"</i>{{ 'tout le sport' | trans }}<i>"</i></kbd> , <kbd class='tx'><i>"</i>{{ 'tout le sport' | trans }}<i>"</i></kbd>
</center> </center>
</div> </div>
{% endif %}
{% endblock %} {% endblock %}

View File

@@ -0,0 +1,80 @@
{% import 'common/thumbnail.html.twig' as thumbnail %}
{% set record = item.record(app) %}
<div style="width:{{ images_size+30 }}px;"
sbas="{{ record.databoxId }}"
id="{{'PUBLI_' ~ entry.id ~ '_' ~ record.id }}"
class="IMGT diapo type-{{ record.type }}"
onDblClick="openPreview('FEED',{{ record.get_number }},{{ entry.id }});"
>
<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>
<div class="status">
{{ record.get_status_icons|raw }}
</div>
</div>
{% set rollover_gif = record.get_rollover_thumbnail %}
{% if rollover_thumbnail == 'caption' %}
{% set tooltipsrc = path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'publi' }) %}
{% elseif rollover_thumbnail == 'preview' %}
{% set tooltipsrc = path('prod_tooltip_preview', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId }) %}
{% endif %}
<div class="thumb captionTips " tooltipsrc="{{ tooltipsrc }}"
style="height:{{ images_size }}px; z-index:90;">
<div class="doc_infos">
{% if doctype_display %}
{{ record_doctype_icon(record) }}
{% endif %}
<span class="duration">
{{ record.get_formated_duration }}
</span>
</div>
<div class="{% if rollover_gif %}rollovable{% endif %}">
{% set extraclass = rollover_gif ? 'rollover-gif-out' : '' %}
{{ thumbnail.format(record.get_thumbnail(), images_size, images_size, extraclass, true, false) }}
{% if rollover_gif %}
{{ thumbnail.format(rollover_gif, images_size, images_size, 'rollover-gif-hover', true, false) }}
{% 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 }}
</td>
{% set l_width = 30 %}
{% if rollover_thumbnail == 'preview' %}
{% set l_width = l_width + 20 %}
{% endif %}
{% if technical_display == '1' %}
{% set l_width = l_width + 20 %}
{% endif %}
<td style='text-align:right;width:{{ l_width }}px;' valign='bottom'>
{% if record.has_preview and has_access_subdef(record, 'preview') %}
<div tooltipsrc="{{ path('prod_tooltip_preview', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId }) }}"
class="previewTips"></div>
{% endif %}
{% if rollover_thumbnail == 'preview' %}
<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 technical_display == '1' %}
<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>
</table>
</div>
</div>
</div>

View File

@@ -0,0 +1,24 @@
{% import 'common/macros.html.twig' as macro %}
{% block content_item %}
<div class='list ui-corner-all'>
<table style='width:100%;' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td valign="top" style='width:{{th_size+50}}px'>
{% include 'prod/results/record.html.twig' with {
'record': item,
'settings': settings
}%}
</td>
<td valign="middle">
<div class='desc' style='max-height:{{th_size+70}}px;overflow-y:auto;'>
<div class="fixeddesc">
{% set business = app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.baseId(), 'canmodifrecord') %}
{{ macro.format_caption(record, highlight, searchEngine, searchOptions, business, true, true) }}
</div>
</div>
</td>
</tr>
</table>
</div>
{% endblock %}

View File

@@ -0,0 +1,69 @@
{% macro thumbnail(record, box_w, box_h, extra_class) %}
{% set record_type = record.type %}
{% set thumb_w = 256 %}
{% set thumb_h = 256 %}
{% set thumbnail = record.subdefs.get('thumbnail') %}
{% if thumbnail is not none %}
{% set thumb_w = thumbnail.width %}
{% set thumb_h = thumbnail.height %}
{% endif %}
{% set url = record_thumbnail_url(record) %}
{% set box_w = box_w|round %}
{% set box_h = box_h|default(box_w)|round %}
{% 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},
{"width":box_w, "height":box_h}
)
%}
<div style="width:{{box_w}}px;height:{{box_h}}px;" class="thumb_wrapper {{ extra_class|default('') }}">
<img class="record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
style="width:{{fit_size.width}}px;height:{{fit_size.height}}px;top:{{fit_size.top}}px;"
src="{{ url }}" ondragstart="return false;">
<input type="hidden" name="width" value="{{original_w}}"/>
<input type="hidden" name="height" value="{{original_h}}"/>
</div>
{% endmacro %}
{% macro thumbnailgif(record, box_w, box_h, extra_class) %}
{% set record_type = record.type %}
{% set thumb_w = 256 %}
{% set thumb_h = 256 %}
{% set thumbnail = record.subdefs.get('thumbnailgif') %}
{% if thumbnail is not none %}
{% set thumb_w = thumbnail.width %}
{% set thumb_h = thumbnail.height %}
{% endif %}
{% set url = record_thumbnailgif_url(record) %}
{% set box_w = box_w|round %}
{% set box_h = box_h|default(box_w)|round %}
{% 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},
{"width":box_w, "height":box_h}
)
%}
<div style="width:{{box_w}}px;height:{{box_h}}px;" class="thumb_wrapper {{ extra_class|default('') }}">
<img class="record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
style="width:{{fit_size.width}}px;height:{{fit_size.height}}px;top:{{fit_size.top}}px;"
src="{{ url }}" ondragstart="return false;">
<input type="hidden" name="width" value="{{original_w}}"/>
<input type="hidden" name="height" value="{{original_h}}"/>
</div>
{% endmacro %}

View File

@@ -1,119 +1,131 @@
{% macro block(record, highlight, searchEngine, prefix, entry_id)%} {% import 'prod/results/macro.html.twig' as result_macro %}
{% 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'].user, 'images_size')%}
{% if entry_id %} <div style="width:{{ settings.images_size + 30}}px;"
<div style="width:{{th_size+30}}px;" sbas="{{record.databoxId}}" sbas="{{ record.databoxId }}"
id="{{ prefix|default('IMGT') }}_{{record.id}}" id="{{ prefix|default('IMGT') }}_{{ record.id }}"
class="IMGT diapo type-{{record.type}}" class="IMGT diapo {% if record.story %}grouping{% endif %} type-{{ record.type }}"
onDblClick="openPreview('FEED',{{record.position}},{{entry_id}});"> onDblClick="openPreview('{{ record.story ? 'REG' : 'RESULT' }}', '{{ record.position|default(0) }}', '{{ record.id }}');">
{% elseif record.story %} <div style="padding: 4px;">
<div style="width:{{th_size+30}}px;" sbas="{{record.databoxId}}" <div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">
id="{{ prefix|default('IMGT') }}_{{record.id}}" {# @todo title should be localized #}
class="IMGT diapo grouping type-{{record.type}}" <div class="title" style="max-height:100%" title="{{ record.title }}">
onDblClick="openPreview('REG','0','{{record.id}}');"> {{ record.title }}
{% else %} </div>
<div style="width:{{th_size+30}}px;" sbas="{{record.databoxId}}" <div class="status">
id="{{ prefix|default('IMGT') }}_{{record.id}}"
class="IMGT diapo type-{{record.type}}"
onDblClick="openPreview('RESULT',{{record.position}});">
{% endif %}
<div style="padding: 4px;">
<div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">
{# @todo title should be localized #}
<div class="title" style="max-height:100%" title="{{ record.title }}">
{{ record.title }}
</div>
<div class="status">
{# @todo find a proper way to map lifted flag to status icon img path #} {# @todo find a proper way to map lifted flag to status icon img path #}
{#{{record.get_status_icons|raw}}#} {#{{record.get_status_icons|raw}}#}
</div>
</div> </div>
{% set thumbnail = record.subdefs.containsKey('thumbnail') ? record.subdefs.get('thumbnail') : null %} </div>
{% set preview = record.subdefs.containsKey('preview') ? record.subdefs.get('preview') : null %}
{% set rollover_thumbnail = record.subdefs.containsKey('thumbnailgif') ? record.subdefs.get('thumbnailgif') : null %}
{% set user_technical_display = app['settings'].getUserSetting(app['authentication'].user, 'technical_display') %} {% if settings.rollover_thumbnail == 'caption' %}
{% set user_rollover_thumbnail = app['settings'].getUserSetting(app['authentication'].user, 'rollover_thumbnail') %} {% set tooltip = path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'answer', 'number' : record.position|default(0) }) %}
{% elseif settings.rollover_thumbnail == 'preview' %}
{% set tooltip = path('prod_tooltip_preview', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId }) %}
{% endif %}
{% set extraclass = '' %} <div class="thumb captionTips" tooltipsrc="{{ tooltip }}" style="height:{{ settings.images_size }}px; z-index:90;">
{% if user_rollover_thumbnail == 'caption' and searchEngine is not null %} <div class="doc_infos">
{% set extraclass = extraclass ~ ' captionTips' %} {% if settings.doctype_display == '1' %}
{% set tooltip = path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'answer', 'number' : record.position }) %} {{ record_doctype_icon(record) }}
{% elseif user_rollover_thumbnail == 'caption' and searchEngine is null %}
{% set extraclass = extraclass ~ ' captionTips' %}
{% set tooltip = path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'publi' }) %}
{% elseif user_rollover_thumbnail == 'preview' %}
{% set extraclass = extraclass ~ ' captionTips' %}
{% set tooltip = path('prod_tooltip_preview', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId }) %}
{% endif %}
<div class="thumb {{extraclass}} " tooltipsrc="{{tooltip}}" style="height:{{th_size}}px; z-index:90;">
<div class="doc_infos">
{% if app['settings'].getUserSetting(app['authentication'].user, 'doctype_display') == '1' %}
{{doctype_icons.format(record)}}
{% endif %} {% endif %}
<span class="duration"> <span class="duration">
{% if record.type == 'video' and attribute(record.exif, constant('\\media_subdef::TC_DATA_DURATION')) is defined %} {% 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')) }} {{ attribute(record.exif, constant('\\media_subdef::TC_DATA_DURATION')) }}
{% endif %} {% endif %}
</span> </span>
</div>
<div class="{% if rollover_thumbnail %}rollovable{% endif %}">
{% set extraclass = '' %}
{% if thumbnail is not none and thumbnail.path is defined and (thumbnail.path is not empty or thumbnail.path is not none) %}
{% set path = thumbnail.path %}
{% set width = thumbnail.width %}
{% set height = thumbnail.height %}
{% else %}
{% set path = app['root.path'] ~ '/www/skins/icons/substitution/' ~ record.mimeType|replace({'/': '_'}) ~ '.png' %}
{% set width = 256 %}
{% set height = 256 %}
{% endif %}
{% set url = app['phraseanet.static-file'].getUrl(path) %}
{{thumbnail_macro.format(record, url, width, height, th_size, th_size, extraclass, true, true)}}
{% if rollover_thumbnail %}
{% set extraclass = 'rollover-gif-out' %}
{% if rollover_thumbnail.path is defined and (rollover_thumbnail.path is not empty or rollover_thumbnail.path is not none) %}
{% set url = app['phraseanet.static-file'].getUrl(rollover_thumbnail.path) %}
{{thumbnail_macro.format(record, url, rollover_thumbnail.width, rollover_thumbnail.height, th_size, th_size, 'rollover-gif-hover', true, true)}}
{% endif %}
{% endif %}
</div>
</div> </div>
<div style="height: 25px; position:relative; text-align:left;"> {% set rollover = record.subdefs.containsKey('thumbnailgif') %}
<table class="bottom" style="width:100%; table-layout:fixed;"> {% set extraclass = '' %}
<tr> <div class="{% if rollover %}rollovable{% endif %}">
<td style="text-align:left;text-overflow:ellipsis;overflow:hidden;"> {% if rollover %}
{{record.baseId | get_collection_logo(app, true)|raw}} {% set extraclass = 'rollover-gif-out' %}
</td> {% endif %}
{% set l_width = 30 %}
{% if user_rollover_thumbnail == 'preview' %} {{ result_macro.thumbnail(record, settings.images_size, settings.images_size, extraclass) }}
{% set l_width = l_width + 20 %}
{% endif %} {% if rollover %}
{% if user_technical_display == '1' %} {% set extraclass = 'rollover-gif-hover' %}
{% set l_width = l_width + 20 %} {{ result_macro.thumbnailgif(record, settings.images_size, settings.images_size, extraclass) }}
{% endif %} {% endif %}
<td style='text-align:right;width:{{l_width}}px;' valign='bottom'>
{{drop_down.prod(record, entry_id)}}
{% if preview and app['acl'].get(app['authentication'].user).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.databoxId, 'record_id' : record.recordId, 'context' : 'answer', 'number' : record.position }) }}" class="captionRolloverTips"></div>
{% endif %}
{% if user_technical_display == '1' %}
<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>
</table>
</div> </div>
</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;">
{{ collection_logo(record.baseId) }}
</td>
{% set l_width = 30 %}
{% if settings.rollover_thumbnail == 'preview' %}
{% set l_width = l_width + 20 %}
{% elseif settings.technical_display == '1' %}
{% set l_width = l_width + 20 %}
{% endif %}
{# drop down options #}
<td style='text-align:right;width:{{l_width}}px;' valign='bottom'>
<a style="float:right;padding:0;margin:0;cursor:pointer;" class="contextMenuTrigger" id="contextTrigger_{{record.id}}">&#9660;</a>
<table cellspacing="0" cellpadding="0" style="display:none;" id="answerContext_{{record.id}}" class="contextMenu answercontextmenu">
<tbody>
<tr>
<td>
<div class="context-menu context-menu-theme-vista">
{% if granted_on_collection(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.databoxId}}','{{record.recordId}}',false,this);return(false);">
{{ 'action : ajouter au panier' | trans }}
</div>
</div>
{% endif %}
{% if granted_on_collection(record.baseId, 'candwnldpreview') or granted_on_collection(record.baseId, 'candwnldhd') %}
<div title="" class="context-menu-item">
<div class="context-menu-item-inner"
onclick="evt_dwnl('{{record.id}}',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.id}}');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 granted_on_databox(record.databoxId, 'bas_chupub')) %}
{% if record.story is empty %}
<div title="" class="context-menu-item">
<div class="context-menu-item-inner"
onclick="shareThis('{{record.baseId}}','{{record.recordId}}');">
{{ 'reponses:: partager' | trans }}
</div>
</div>
{% endif %}
{% endif %}
</div>
</td>
</tr>
</tbody>
</table>
{% if record.subdefs.containsKey('preview') and has_access_subdef(record, 'preview') %}
<div tooltipsrc="{{ path('prod_tooltip_preview', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId }) }}" class="previewTips"></div>
{% endif %}
{% if settings.rollover_thumbnail == 'preview' %}
<div tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'answer', 'number' : record.position|default(0) }) }}" class="captionRolloverTips"></div>
{% endif %}
{% if settings.technical_display == '1' %}
<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>
</table>
</div>
</div> </div>
{% endmacro %} </div>

View File

@@ -0,0 +1,39 @@
{% if results.error %}
{% block result_error %}
<div>
{{ results.error }}
</div>
{% endblock %}
{% else %}
{% if results.warning %}
{% block result_warning %}
<div>
{{ results.warning }}
</div>
{% endblock %}
{% endif %}
{% block content %}
{% set images_size = user_setting('images_size') %}
{% set technical_display = user_setting('technical_display') %}
{% set rollover_thumbnail = user_setting('rollover_thumbnail') %}
{% set doctype_display = user_setting('doctype_display') %}
<div class="selectable" style="margin:10px 0; float:left;">
{% for item in results.results %}
{% block content_item %}
{% include (user_setting('view', 'thumbs') == 'thumbs') ? 'prod/results/grid.html.twig' : 'prod/results/list.html.twig' with {
'record': item,
'context': context,
'settings': {
'images_size': images_size,
'technical_display': technical_display,
'rollover_thumbnail': rollover_thumbnail,
'doctype_display': doctype_display
}
} %}
{% endblock %}
{% endfor %}
</div>
{% endblock %}
{% endif %}