mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Merge pull request #1960 from jygaulier/PHRAS-1192_quarantaine-by-filenames_4.0
PHRAS-1192_quarantaine-by-filenames_4.0
This commit is contained in:
@@ -4,13 +4,13 @@
|
||||
{% set thumb_w = 256 %}
|
||||
{% set thumb_h = 256 %}
|
||||
|
||||
{% set thumbnail = record.subdefs.thumbnail|default(null) %}
|
||||
{% if thumbnail is not none %}
|
||||
{% set thumb_w = thumbnail.width %}
|
||||
{% set thumb_h = thumbnail.height %}
|
||||
{% set thumbnailSize = record_subdef_size(record, "thumbnail") %}
|
||||
{% if thumbnailSize is not null %}
|
||||
{% set thumb_w = thumbnailSize.width %}
|
||||
{% set thumb_h = thumbnailSize.height %}
|
||||
{% endif %}
|
||||
|
||||
{% set url = record_thumbnail_url(record) %}
|
||||
{% set url = record_subdef_url(record, "thumbnail") %}
|
||||
|
||||
{% set box_w = box_w|round %}
|
||||
{% set box_h = box_h|default(box_w)|round %}
|
||||
|
@@ -5,11 +5,11 @@
|
||||
sbas="{{ record.databoxId }}"
|
||||
id="{{ prefix|default('IMGT') }}_{{ record.id }}"
|
||||
class="IMGT diapo {% if record.story %}grouping{% endif %} type-{{ record.type }}"
|
||||
onDblClick="openPreview(this, '{{ record.story ? 'REG' : 'RESULT' }}', '{{ record.position|default(0) }}', '{{ record.id }}');">
|
||||
{% if settings.handle_dblclick %}onDblClick="openPreview(this, '{{ record.story ? 'REG' : 'RESULT' }}', '{{ record.position|default(0) }}', '{{ record.id }}');"{% 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.title(app.locale) }}">
|
||||
{{ record.title(app.locale)|highlight }}
|
||||
<div class="title" style="max-height:100%" title="{{ record.getTitle(app.locale) }}">
|
||||
{{ record.getTitle(app.locale)|highlight }}
|
||||
</div>
|
||||
<div class="status">
|
||||
{% for flag in record_flags(record) %}
|
||||
@@ -73,7 +73,7 @@
|
||||
<td style="text-align:right;width:{{l_width}}px;" valign="bottom">
|
||||
|
||||
{% if settings.rollover_thumbnail == 'caption' %}
|
||||
{% if record.subdefs.preview is defined and has_access_subdef(record, 'preview') %}
|
||||
{% if record_subdef_url(record, 'preview') is not null and has_access_subdef(record, 'preview') %}
|
||||
<span class="icon-stack previewTips" tooltipsrc="{{ path('prod_tooltip_preview', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId }) }}">
|
||||
<i class="icon-circle icon-stack-base"></i>
|
||||
<i class="icon-search icon-light"></i>
|
||||
@@ -94,6 +94,7 @@
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if settings.show_context_menu %}
|
||||
<span class="icon-stack contextMenuTrigger" id="contextTrigger_{{record.id}}"
|
||||
tooltipsrc="{{ path('prod_tooltip_technical_data', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId }) }}">
|
||||
<i class="icon-circle icon-stack-base"></i>
|
||||
@@ -143,6 +144,7 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@@ -28,7 +28,9 @@
|
||||
'images_size': images_size,
|
||||
'technical_display': technical_display,
|
||||
'rollover_thumbnail': rollover_thumbnail,
|
||||
'doctype_display': doctype_display
|
||||
'doctype_display': doctype_display,
|
||||
'handle_dblclick' : true,
|
||||
'show_context_menu': true
|
||||
}
|
||||
} %}
|
||||
{% endblock %}
|
||||
|
@@ -92,13 +92,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
$(".records-subititution", scope).bind('click', function(){
|
||||
$(this).closest('.lazaret-proposals').find('.records-subititution').removeClass("thumb-selected");
|
||||
$(this).closest('.lazaret-proposals').find('.thumbnail').css({'border-color': 'white'})
|
||||
$(this).find('.thumbnail').css({'border-color': 'blue'});
|
||||
$(this).addClass("thumb-selected");
|
||||
});
|
||||
$(".records-subititution .diapo", scope)
|
||||
.bind('click', function(e){
|
||||
$(this).closest('.lazaret-proposals').find('.diapo').removeClass('selected');
|
||||
$(this).addClass('selected');
|
||||
}
|
||||
);
|
||||
|
||||
$(".records-subititution .captionTips", scope).tooltip();
|
||||
$(".records-subititution .infoTips", scope).tooltip();
|
||||
$(".records-subititution .previewTips", scope).tooltip();
|
||||
|
||||
var emptying = false; // true=emptying, set to false to stop
|
||||
|
||||
@@ -198,14 +201,14 @@
|
||||
var html = _.template($("#alert_error_tpl").html(), {
|
||||
content:data.message
|
||||
});
|
||||
that.closest(".thumbnail").append(html);
|
||||
that.closest(".diapo").append(html);
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
var html = _.template($("#alert_error_tpl").html(), {
|
||||
content:language.errorAjaxRequest
|
||||
});
|
||||
that.closest(".thumbnail").append(html);
|
||||
that.closest(".diapo").append(html);
|
||||
},
|
||||
complete: function(){
|
||||
stopAjax(that);
|
||||
@@ -233,14 +236,14 @@
|
||||
var html = _.template($("#alert_error_tpl").html(), {
|
||||
content:data.message
|
||||
});
|
||||
that.closest(".thumbnail").append(html);
|
||||
that.closest(".diapo").append(html);
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
var html = _.template($("#alert_error_tpl").html(), {
|
||||
content:language.errorAjaxRequest
|
||||
});
|
||||
that.closest(".thumbnail").append(html);
|
||||
that.closest(".diapo").append(html);
|
||||
},
|
||||
complete: function(){
|
||||
stopAjax(that);
|
||||
@@ -253,14 +256,18 @@
|
||||
$("button.subtitute-lazaret", scope).bind('click', function(){
|
||||
var that = $(this);
|
||||
var lazaretId = getLazaretId(that);
|
||||
var nbProposals = $('.records-subititution', $(this).closest('.wrapper-item')).length;
|
||||
var container = $(this).closest('.wrapper-item');
|
||||
|
||||
var nbProposals = $('.records-subititution', container).length;
|
||||
var elements = [];
|
||||
var nbElement = 0;
|
||||
|
||||
if(nbProposals > 1){ // we got more than one proposals
|
||||
var elements = $(".thumb-selected", $(this).closest('.wrapper-item'));
|
||||
var nbElement = elements.length;
|
||||
elements = $(".selected", container);
|
||||
nbElement = elements.length;
|
||||
}else if(nbProposals == 1){
|
||||
var elements = $(this).closest('.wrapper-item').find(".records-subititution");
|
||||
var nbElement = 1
|
||||
elements = container.find(".records-subititution");
|
||||
nbElement = 1
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
@@ -274,8 +281,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
var recorThumb = elements.first().find('.record-thumb');
|
||||
var recordId = recorThumb.find('input[name=record_id]').val();
|
||||
var recordId = elements.first().attr("data-record_id");
|
||||
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
@@ -294,14 +300,14 @@
|
||||
var html = _.template($("#alert_error_tpl").html(), {
|
||||
content:data.message
|
||||
});
|
||||
that.closest(".thumbnail").append(html);
|
||||
that.closest(".diapo").append(html);
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
var html = _.template($("#alert_error_tpl").html(), {
|
||||
content:language.errorAjaxRequest
|
||||
});
|
||||
that.closest(".thumbnail").append(html);
|
||||
that.closest(".diapo").append(html);
|
||||
},
|
||||
complete: function(){
|
||||
stopAjax(that);
|
||||
@@ -311,10 +317,15 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.lazaret-proposals .diapo {
|
||||
float:none;
|
||||
}
|
||||
</style>
|
||||
|
||||
{% macro lazaretElement(app, file) %}
|
||||
{% import "common/thumbnail.html.twig" as thumb %}
|
||||
{% set records = file.getRecordsToSubstitute(app) %}
|
||||
{% set records = file.getRecordsToSubstitute(app, true) %}
|
||||
<div class="lazaret-file span4">
|
||||
<h5>{{ "Last uploaded version" | trans }}</h5>
|
||||
<ul class="thumbnails">
|
||||
@@ -370,17 +381,26 @@
|
||||
</h5>
|
||||
<ul class="thumbnails">
|
||||
{% for record in records %}
|
||||
{% set reasons = record['reasons'] %}
|
||||
{% set record = record['record'] %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), "canaddrecord")
|
||||
and app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), "candeleterecord") %}
|
||||
<li class="records-subititution span3">
|
||||
<div class="thumbnail">
|
||||
<div class="record-thumb" style="text-align:center;">
|
||||
{{ thumb.format(record.get_thumbnail(), 169, 180, "", false, false) }}
|
||||
<input name="record_id" value="{{ record.get_record_id() }}" type="hidden"/>
|
||||
</div>
|
||||
<div class="caption">
|
||||
<p><b>{{ record.get_title() }}</b></p>
|
||||
</div>
|
||||
<li class="records-subititution span3" style="width:210px">
|
||||
{% include 'prod/results/record.html.twig' with {
|
||||
'record': record,
|
||||
'settings': {
|
||||
'images_size': 169,
|
||||
'technical_display': '1',
|
||||
'rollover_thumbnail': 'caption',
|
||||
'doctype_display': '1',
|
||||
'handle_dblclick' : false,
|
||||
'show_context_menu': false
|
||||
}
|
||||
} %}
|
||||
<div class="caption">
|
||||
{% for reason in reasons %}
|
||||
<p>{{ reason }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user