mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 02:13:15 +00:00
PHRAS-2761 #comment Port of PHRAS-2801 (Fix on firefox)
This commit is contained in:
@@ -176,25 +176,32 @@
|
|||||||
emptying = true;
|
emptying = true;
|
||||||
f();
|
f();
|
||||||
});
|
});
|
||||||
|
var data;
|
||||||
//add lazaret file click action
|
//add lazaret file click action
|
||||||
$("button.add-lazaret", scope).bind('click', function () {
|
$("button.add-lazaret", scope).bind('click', function () {
|
||||||
var that = $(this);
|
var that = $(this);
|
||||||
var lazaretId = getLazaretId(that);
|
var lazaretId = getLazaretId(that);
|
||||||
var destinationCollectionId = getDestinationId(that);
|
var destinationCollectionId = getDestinationId(that);
|
||||||
|
var container = $(this).closest('.wrapper-item');
|
||||||
var form = $(this).closest("form");
|
var form = $(this).closest("form");
|
||||||
|
|
||||||
|
/*fix POST on firefox*/
|
||||||
|
data = form.serializeArray();
|
||||||
|
var allData = that.parent().closest('.wrapper-item').find(".change-record-wrapper").html();
|
||||||
|
that.closest(".form-backup ").append(allData);
|
||||||
|
that.parent().closest('.wrapper-item').find(".change-record ").remove();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: '/prod/lazaret/' + lazaretId + '/force-add/',
|
url: '/prod/lazaret/' + lazaretId + '/force-add/',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: form.serializeArray(),
|
data: data,
|
||||||
beforeSend: function () {
|
beforeSend: function () {
|
||||||
startAjax(that);
|
startAjax(that);
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
that.closest(".wrapper-item").remove();
|
container.remove();
|
||||||
} else {
|
} else {
|
||||||
var html = _.template($("#alert_error_tpl").html(), {
|
var html = _.template($("#alert_error_tpl").html(), {
|
||||||
content: data.message
|
content: data.message
|
||||||
@@ -219,6 +226,12 @@
|
|||||||
$("button.delete-lazaret", scope).bind('click', function () {
|
$("button.delete-lazaret", scope).bind('click', function () {
|
||||||
var that = $(this);
|
var that = $(this);
|
||||||
var lazaretId = getLazaretId(that);
|
var lazaretId = getLazaretId(that);
|
||||||
|
var container = $(this).closest('.wrapper-item');
|
||||||
|
var form = $(this).closest("form");
|
||||||
|
data = form.serializeArray();
|
||||||
|
var allData = that.parent().closest('.wrapper-item').find(".change-record-wrapper").html();
|
||||||
|
that.closest(".form-backup ").append(allData);
|
||||||
|
that.parent().closest('.wrapper-item').find(".change-record ").remove();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
@@ -229,7 +242,7 @@
|
|||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
that.closest(".wrapper-item").remove();
|
container.remove();
|
||||||
} else {
|
} else {
|
||||||
var html = _.template($("#alert_error_tpl").html(), {
|
var html = _.template($("#alert_error_tpl").html(), {
|
||||||
content: data.message
|
content: data.message
|
||||||
@@ -362,17 +375,24 @@
|
|||||||
var form = $(this).closest("form");
|
var form = $(this).closest("form");
|
||||||
$(".record_id").val(recordId);
|
$(".record_id").val(recordId);
|
||||||
|
|
||||||
|
|
||||||
|
var form = $(this).closest("form");
|
||||||
|
data = form.serializeArray();
|
||||||
|
var allData = that.parent().closest('.wrapper-item').find(".change-record-wrapper").html();
|
||||||
|
that.closest(".form-backup ").append(allData);
|
||||||
|
that.parent().closest('.wrapper-item').find(".change-record ").remove();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: '/prod/lazaret/' + lazaretId + '/accept/',
|
url: '/prod/lazaret/' + lazaretId + '/accept/',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: form.serializeArray(),
|
data: data,
|
||||||
beforeSend: function () {
|
beforeSend: function () {
|
||||||
startAjax(that);
|
startAjax(that);
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
that.closest(".wrapper-item").remove();
|
container.remove();
|
||||||
} else {
|
} else {
|
||||||
var html = _.template($("#alert_error_tpl").html(), {
|
var html = _.template($("#alert_error_tpl").html(), {
|
||||||
content: data.message
|
content: data.message
|
||||||
@@ -425,82 +445,85 @@
|
|||||||
<p>{{ border_checker_from_fqcn(check.getCheckClassname()).getMessage(app['translator']) }}</p>
|
<p>{{ border_checker_from_fqcn(check.getCheckClassname()).getMessage(app['translator']) }}</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<form name="change-records-status" action="/" method="POST">
|
<form class="change-record" name="change-records-status" action="/" method="POST">
|
||||||
|
<div class="change-record-wrapper">
|
||||||
{% set collection = file.getCollection(app) %}
|
{% set collection = file.getCollection(app) %}
|
||||||
<input type="hidden" name="bas_id" value="{{ collection.get_base_id() }}">
|
<input type="hidden" name="bas_id" value="{{ collection.get_base_id() }}">
|
||||||
<input type="hidden" name="keep_attributes" value="1">
|
<input type="hidden" name="keep_attributes" value="1">
|
||||||
<input class="record_id" type="hidden" name="record_id">
|
<input class="record_id" type="hidden" name="record_id">
|
||||||
<div class="update-status">
|
<div class="update-status">
|
||||||
<div id="status-{{ collection.get_base_id() }}" class='collection-status'>
|
<div id="status-{{ collection.get_base_id() }}" class='collection-status'>
|
||||||
<a href="#" class="reset-status btn">Reset status</a>
|
<a href="#" class="reset-status btn">Reset status</a>
|
||||||
<h5 class="toggle-status">{{ 'upload:: Status :' | trans }} <img src="/assets/common/images/icons/icon-right-arrow.svg" width="10" height="10" class="btn-status"></h5>
|
<h5 class="toggle-status">{{ 'upload:: Status :' | trans }} <img src="/assets/common/images/icons/icon-right-arrow.svg" width="10" height="10" class="btn-status"></h5>
|
||||||
<div class="status-wrapper hidden">
|
<div class="status-wrapper hidden">
|
||||||
<table style="margin: auto">
|
<table style="margin: auto">
|
||||||
<tbody class="status-container">
|
<tbody class="status-container">
|
||||||
{% if file.getStatus(app) is not null %}
|
{% if file.getStatus(app) is not null %}
|
||||||
{% for bit, status in file.getStatus(app) %}
|
{% for bit, status in file.getStatus(app) %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="status-tab-left">
|
<td class="status-tab-left">
|
||||||
{% if status['img_off'] is not empty %}
|
{% if status['img_off'] is not empty %}
|
||||||
<img src="{{ status['img_off'] }}" width="16" height="16" />
|
<img src="{{ status['img_off'] }}" width="16" height="16" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span>{{ status['labels_off_i18n'][app['locale']]|default('off') }}</span>
|
<span>{{ status['labels_off_i18n'][app['locale']]|default('off') }}</span>
|
||||||
<input type="radio" name="status[{{ collection.get_sbas_id() }}][{{ bit }}]" value="0" {% if status['flag'] == 0 %}checked="checked"{% endif%}/>
|
<input type="radio" name="status[{{ collection.get_sbas_id() }}][{{ bit }}]" value="0" {% if status['flag'] == 0 %}checked="checked"{% endif%}/>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="status-tab-right">
|
<td class="status-tab-right">
|
||||||
<input type="radio" name="status[{{ collection.get_sbas_id() }}][{{ bit }}]" value="1" {% if status['flag'] == 1 %}checked="checked"{% endif%} />
|
<input type="radio" name="status[{{ collection.get_sbas_id() }}][{{ bit }}]" value="1" {% if status['flag'] == 1 %}checked="checked"{% endif%} />
|
||||||
<span for="labelon">{{ status['labels_on_i18n'][app['locale']]|default('on') }}</span>
|
<span for="labelon">{{ status['labels_on_i18n'][app['locale']]|default('on') }}</span>
|
||||||
{% if status['img_on'] is not empty %}
|
{% if status['img_on'] is not empty %}
|
||||||
<img src="{{ status['img_on'] }}" width="16" height="16" />
|
<img src="{{ status['img_on'] }}" width="16" height="16" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% for bit, status in collection.get_databox().getStatusStructure() %}
|
{% for bit, status in collection.get_databox().getStatusStructure() %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="status-tab-left">
|
<td class="status-tab-left">
|
||||||
{% if status['img_off'] is not empty %}
|
{% if status['img_off'] is not empty %}
|
||||||
<img src="{{ status['img_off'] }}" width="16" height="16" />
|
<img src="{{ status['img_off'] }}" width="16" height="16" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span>{{ status['labels_off_i18n'][app['locale']]|default('off') }}</span>
|
<span>{{ status['labels_off_i18n'][app['locale']]|default('off') }}</span>
|
||||||
<input type="radio" name="status[{{ collection.get_sbas_id() }}][{{ bit }}]" value="0" checked="checked"/>
|
<input type="radio" name="status[{{ collection.get_sbas_id() }}][{{ bit }}]" value="0" checked="checked"/>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="status-tab-right">
|
<td class="status-tab-right">
|
||||||
<input type="radio" name="status[{{ collection.get_sbas_id() }}][{{ bit }}]" value="1" />
|
<input type="radio" name="status[{{ collection.get_sbas_id() }}][{{ bit }}]" value="1" />
|
||||||
<span for="labelon">{{ status['labels_on_i18n'][app['locale']]|default('on') }}</span>
|
<span for="labelon">{{ status['labels_on_i18n'][app['locale']]|default('on') }}</span>
|
||||||
{% if status['img_on'] is not empty %}
|
{% if status['img_on'] is not empty %}
|
||||||
<img src="{{ status['img_on'] }}" width="16" height="16" />
|
<img src="{{ status['img_on'] }}" width="16" height="16" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="btn-group" style="text-align:center; padding:5px;">
|
<div class="btn-group" style="text-align:center; padding:5px;">
|
||||||
<button class="btn add-lazaret" title="{{ "Add" | trans }}">
|
<button class="btn add-lazaret" title="{{ "Add" | trans }}">
|
||||||
<img src="/assets/common/images/icons/add.png" width="16" height="16" class="btn-image">{{ "Add" | trans }}
|
<img src="/assets/common/images/icons/add.png" width="16" height="16" class="btn-image">{{ "Add" | trans }}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn delete-lazaret" title="{{ "Delete" | trans }}">
|
<button class="btn delete-lazaret" title="{{ "Delete" | trans }}">
|
||||||
<img src="/assets/common/images/icons/delete.png" width="16" height="16" class="btn-image">{{ "Delete" | trans }}
|
<img src="/assets/common/images/icons/delete.png" width="16" height="16" class="btn-image">{{ "Delete" | trans }}
|
||||||
</button>
|
</button>
|
||||||
{% if records|length > 0 %}
|
{% if records|length > 0 %}
|
||||||
<button class="btn subtitute-lazaret" title="{{ "Substitute" | trans }}">
|
<button class="btn subtitute-lazaret" title="{{ "Substitute" | trans }}">
|
||||||
<img src="/assets/common/images/icons/reload.png" width="16" height="16" class="btn-image">{{ "Substitute" | trans }}
|
<img src="/assets/common/images/icons/reload.png" width="16" height="16" class="btn-image">{{ "Substitute" | trans }}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<div class="hidden form-backup"></div>
|
||||||
{# bloc to backup initial value of status list#}
|
{# bloc to backup initial value of status list#}
|
||||||
<table class="hidden">
|
<table class="hidden">
|
||||||
<tbody class="status-backup"
|
<tbody class="status-backup">
|
||||||
{% if file.getStatus(app) is not null %}
|
{% if file.getStatus(app) is not null %}
|
||||||
{% for bit, status in file.getStatus(app) %}
|
{% for bit, status in file.getStatus(app) %}
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user