mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-08 10:34:34 +00:00
PHRAS-3189 add confirm dialog an button
This commit is contained in:
102
Phraseanet-production-client/dist/production.js
vendored
102
Phraseanet-production-client/dist/production.js
vendored
@@ -9374,6 +9374,10 @@ var _alert = __webpack_require__(44);
|
||||
|
||||
var _alert2 = _interopRequireDefault(_alert);
|
||||
|
||||
var _dialog = __webpack_require__(1);
|
||||
|
||||
var _dialog2 = _interopRequireDefault(_dialog);
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
@@ -9464,6 +9468,12 @@ var workzone = function workzone(services) {
|
||||
openExposePublicationAdd();
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('.refresh-list').on('click', function (event) {
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
(0, _jquery2.default)('.publication-list').empty().html('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
updatePublicationList(exposeName);
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('#expose_list').on('change', function () {
|
||||
(0, _jquery2.default)('.publication-list').empty().html('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
updatePublicationList(this.value);
|
||||
@@ -9961,38 +9971,80 @@ var workzone = function workzone(services) {
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_drag_drop');
|
||||
|
||||
_jquery2.default.ajax({
|
||||
type: 'POST',
|
||||
url: '/prod/expose/publication/delete-asset/' + publicationId + '/' + assetId + '/?exposeName=' + exposeName,
|
||||
beforeSend: function beforeSend() {
|
||||
assetsContainer.addClass('loading');
|
||||
},
|
||||
success: function success(data) {
|
||||
if (data.success === true) {
|
||||
assetsContainer.removeClass('loading');
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
var buttons = {};
|
||||
|
||||
var $dialog = _dialog2.default.create(services, {
|
||||
size: '480x160',
|
||||
title: localeService.t('warning')
|
||||
});
|
||||
|
||||
buttons[localeService.t('valider')] = function () {
|
||||
$dialog.setContent('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
|
||||
_jquery2.default.ajax({
|
||||
type: 'POST',
|
||||
url: '/prod/expose/publication/delete-asset/' + publicationId + '/' + assetId + '/?exposeName=' + exposeName,
|
||||
beforeSend: function beforeSend() {
|
||||
assetsContainer.addClass('loading');
|
||||
},
|
||||
success: function success(data) {
|
||||
if (data.success === true) {
|
||||
$dialog.close();
|
||||
assetsContainer.removeClass('loading');
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
} else {
|
||||
$dialog.setContent(data.message);
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
buttons[localeService.t('annuler')] = function () {
|
||||
$dialog.close();
|
||||
};
|
||||
|
||||
var texte = '<p>' + localeService.t('removeAssetPublication') + '</p>';
|
||||
|
||||
$dialog.setOption('buttons', buttons);
|
||||
$dialog.setContent(texte);
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('#idFrameC').find('.publication-droppable').on('click', '.delete-publication', function () {
|
||||
var publicationId = (0, _jquery2.default)(this).attr('data-publication-id');
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var buttons = {};
|
||||
|
||||
_jquery2.default.ajax({
|
||||
type: 'POST',
|
||||
url: '/prod/expose/delete-publication/' + publicationId + '/?exposeName=' + exposeName,
|
||||
success: function success(data) {
|
||||
if (data.success === true) {
|
||||
updatePublicationList(exposeName);
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
var $dialog = _dialog2.default.create(services, {
|
||||
size: '480x160',
|
||||
title: localeService.t('warning')
|
||||
});
|
||||
|
||||
buttons[localeService.t('valider')] = function () {
|
||||
$dialog.setContent('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
_jquery2.default.ajax({
|
||||
type: 'POST',
|
||||
url: '/prod/expose/delete-publication/' + publicationId + '/?exposeName=' + exposeName,
|
||||
success: function success(data) {
|
||||
if (data.success === true) {
|
||||
$dialog.close();
|
||||
updatePublicationList(exposeName);
|
||||
} else {
|
||||
$dialog.setContent(data.message);
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
buttons[localeService.t('annuler')] = function () {
|
||||
$dialog.close();
|
||||
};
|
||||
|
||||
var texte = '<p>' + localeService.t('removeExposePublication') + '</p>';
|
||||
|
||||
$dialog.setOption('buttons', buttons);
|
||||
$dialog.setContent(texte);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10021,7 +10073,7 @@ var workzone = function workzone(services) {
|
||||
type: 'GET',
|
||||
url: '/prod/expose/get-publication/' + publicationId + '?exposeName=' + exposeName + '&onlyAssets=1',
|
||||
beforeSend: function beforeSend() {
|
||||
assetsContainer.addClass('loading');
|
||||
assetsContainer.empty().addClass('loading');
|
||||
},
|
||||
success: function success(data) {
|
||||
if (typeof data.success === 'undefined') {
|
||||
|
102
Phraseanet-production-client/dist/production.min.js
vendored
102
Phraseanet-production-client/dist/production.min.js
vendored
@@ -9374,6 +9374,10 @@ var _alert = __webpack_require__(44);
|
||||
|
||||
var _alert2 = _interopRequireDefault(_alert);
|
||||
|
||||
var _dialog = __webpack_require__(1);
|
||||
|
||||
var _dialog2 = _interopRequireDefault(_dialog);
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
@@ -9464,6 +9468,12 @@ var workzone = function workzone(services) {
|
||||
openExposePublicationAdd();
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('.refresh-list').on('click', function (event) {
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
(0, _jquery2.default)('.publication-list').empty().html('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
updatePublicationList(exposeName);
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('#expose_list').on('change', function () {
|
||||
(0, _jquery2.default)('.publication-list').empty().html('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
updatePublicationList(this.value);
|
||||
@@ -9961,38 +9971,80 @@ var workzone = function workzone(services) {
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_drag_drop');
|
||||
|
||||
_jquery2.default.ajax({
|
||||
type: 'POST',
|
||||
url: '/prod/expose/publication/delete-asset/' + publicationId + '/' + assetId + '/?exposeName=' + exposeName,
|
||||
beforeSend: function beforeSend() {
|
||||
assetsContainer.addClass('loading');
|
||||
},
|
||||
success: function success(data) {
|
||||
if (data.success === true) {
|
||||
assetsContainer.removeClass('loading');
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
var buttons = {};
|
||||
|
||||
var $dialog = _dialog2.default.create(services, {
|
||||
size: '480x160',
|
||||
title: localeService.t('warning')
|
||||
});
|
||||
|
||||
buttons[localeService.t('valider')] = function () {
|
||||
$dialog.setContent('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
|
||||
_jquery2.default.ajax({
|
||||
type: 'POST',
|
||||
url: '/prod/expose/publication/delete-asset/' + publicationId + '/' + assetId + '/?exposeName=' + exposeName,
|
||||
beforeSend: function beforeSend() {
|
||||
assetsContainer.addClass('loading');
|
||||
},
|
||||
success: function success(data) {
|
||||
if (data.success === true) {
|
||||
$dialog.close();
|
||||
assetsContainer.removeClass('loading');
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
} else {
|
||||
$dialog.setContent(data.message);
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
buttons[localeService.t('annuler')] = function () {
|
||||
$dialog.close();
|
||||
};
|
||||
|
||||
var texte = '<p>' + localeService.t('removeAssetPublication') + '</p>';
|
||||
|
||||
$dialog.setOption('buttons', buttons);
|
||||
$dialog.setContent(texte);
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('#idFrameC').find('.publication-droppable').on('click', '.delete-publication', function () {
|
||||
var publicationId = (0, _jquery2.default)(this).attr('data-publication-id');
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var buttons = {};
|
||||
|
||||
_jquery2.default.ajax({
|
||||
type: 'POST',
|
||||
url: '/prod/expose/delete-publication/' + publicationId + '/?exposeName=' + exposeName,
|
||||
success: function success(data) {
|
||||
if (data.success === true) {
|
||||
updatePublicationList(exposeName);
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
var $dialog = _dialog2.default.create(services, {
|
||||
size: '480x160',
|
||||
title: localeService.t('warning')
|
||||
});
|
||||
|
||||
buttons[localeService.t('valider')] = function () {
|
||||
$dialog.setContent('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
_jquery2.default.ajax({
|
||||
type: 'POST',
|
||||
url: '/prod/expose/delete-publication/' + publicationId + '/?exposeName=' + exposeName,
|
||||
success: function success(data) {
|
||||
if (data.success === true) {
|
||||
$dialog.close();
|
||||
updatePublicationList(exposeName);
|
||||
} else {
|
||||
$dialog.setContent(data.message);
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
buttons[localeService.t('annuler')] = function () {
|
||||
$dialog.close();
|
||||
};
|
||||
|
||||
var texte = '<p>' + localeService.t('removeExposePublication') + '</p>';
|
||||
|
||||
$dialog.setOption('buttons', buttons);
|
||||
$dialog.setContent(texte);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10021,7 +10073,7 @@ var workzone = function workzone(services) {
|
||||
type: 'GET',
|
||||
url: '/prod/expose/get-publication/' + publicationId + '?exposeName=' + exposeName + '&onlyAssets=1',
|
||||
beforeSend: function beforeSend() {
|
||||
assetsContainer.addClass('loading');
|
||||
assetsContainer.empty().addClass('loading');
|
||||
},
|
||||
success: function success(data) {
|
||||
if (typeof data.success === 'undefined') {
|
||||
|
@@ -5,6 +5,7 @@ import workzoneFacets from './facets/index';
|
||||
import workzoneBaskets from './baskets/index';
|
||||
import Selectable from '../../utils/selectable';
|
||||
import Alerts from '../../utils/alert';
|
||||
import dialog from './../../../phraseanet-common/components/dialog';
|
||||
const humane = require('humane-js');
|
||||
require('./../../../phraseanet-common/components/tooltip');
|
||||
require('./../../../phraseanet-common/components/vendors/contextMenu');
|
||||
@@ -93,6 +94,12 @@ const workzone = (services) => {
|
||||
openExposePublicationAdd();
|
||||
});
|
||||
|
||||
$('.refresh-list').on('click',function (event) {
|
||||
let exposeName = $('#expose_list').val();
|
||||
$('.publication-list').empty().html('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
updatePublicationList(exposeName);
|
||||
});
|
||||
|
||||
$('#expose_list').on('change', function () {
|
||||
$('.publication-list').empty().html('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
updatePublicationList(this.value);
|
||||
@@ -592,40 +599,81 @@ const workzone = (services) => {
|
||||
let exposeName = $('#expose_list').val();
|
||||
let assetsContainer = $(this).parents('.expose_drag_drop');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: `/prod/expose/publication/delete-asset/${publicationId}/${assetId}/?exposeName=${exposeName}`,
|
||||
beforeSend: function () {
|
||||
assetsContainer.addClass('loading');
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.success === true) {
|
||||
assetsContainer.removeClass('loading');
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
let buttons = {};
|
||||
|
||||
let $dialog = dialog.create(services, {
|
||||
size: '480x160',
|
||||
title: localeService.t('warning')
|
||||
});
|
||||
|
||||
buttons[localeService.t('valider')] = function () {
|
||||
$dialog.setContent('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: `/prod/expose/publication/delete-asset/${publicationId}/${assetId}/?exposeName=${exposeName}`,
|
||||
beforeSend: function () {
|
||||
assetsContainer.addClass('loading');
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.success === true) {
|
||||
$dialog.close();
|
||||
assetsContainer.removeClass('loading');
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
} else {
|
||||
$dialog.setContent(data.message);
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
buttons[localeService.t('annuler')] = function () {
|
||||
$dialog.close();
|
||||
};
|
||||
|
||||
let texte = '<p>' + localeService.t('removeAssetPublication') + '</p>';
|
||||
|
||||
$dialog.setOption('buttons', buttons);
|
||||
$dialog.setContent(texte);
|
||||
});
|
||||
|
||||
$('#idFrameC').find('.publication-droppable').on('click', '.delete-publication', function(){
|
||||
$('#idFrameC').find('.publication-droppable').on('click', '.delete-publication', function() {
|
||||
let publicationId = $(this).attr('data-publication-id');
|
||||
let exposeName = $('#expose_list').val();
|
||||
let buttons = {};
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: `/prod/expose/delete-publication/${publicationId}/?exposeName=${exposeName}`,
|
||||
success: function (data) {
|
||||
if (data.success === true) {
|
||||
updatePublicationList(exposeName);
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
let $dialog = dialog.create(services, {
|
||||
size: '480x160',
|
||||
title: localeService.t('warning')
|
||||
});
|
||||
});
|
||||
|
||||
buttons[localeService.t('valider')] = function () {
|
||||
$dialog.setContent('<img src="/assets/common/images/icons/main-loader.gif" alt="loading"/>');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: `/prod/expose/delete-publication/${publicationId}/?exposeName=${exposeName}`,
|
||||
success: function (data) {
|
||||
if (data.success === true) {
|
||||
$dialog.close();
|
||||
updatePublicationList(exposeName);
|
||||
} else {
|
||||
$dialog.setContent(data.message);
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
buttons[localeService.t('annuler')] = function () {
|
||||
$dialog.close();
|
||||
};
|
||||
|
||||
let texte = '<p>' + localeService.t('removeExposePublication') + '</p>';
|
||||
|
||||
$dialog.setOption('buttons', buttons);
|
||||
$dialog.setContent(texte);
|
||||
});
|
||||
}
|
||||
|
||||
function updatePublicationList(exposeName)
|
||||
@@ -655,7 +703,7 @@ const workzone = (services) => {
|
||||
type: 'GET',
|
||||
url: `/prod/expose/get-publication/${publicationId}?exposeName=${exposeName}&onlyAssets=1`,
|
||||
beforeSend: function () {
|
||||
assetsContainer.addClass('loading');
|
||||
assetsContainer.empty().addClass('loading');
|
||||
},
|
||||
success: function (data) {
|
||||
if (typeof data.success === 'undefined') {
|
||||
|
@@ -59,6 +59,8 @@ class LanguageController
|
||||
'feed_require_fields' => $translator->trans('Vous n\'avez pas rempli tous les champ requis'),
|
||||
'feed_require_feed' => $translator->trans('Vous n\'avez pas selectionne de fil de publication'),
|
||||
'removeTitle' => $translator->trans('panier::Supression d\'un element d\'un reportage'),
|
||||
'removeExposePublication' => $translator->trans('expose::Your are about to delete a publication from expose, please confirm your action !'),
|
||||
'removeAssetPublication' => $translator->trans('expose::Your are about to delete an asset from a publication, please confirm your action !'),
|
||||
'confirmRemoveReg' => $translator->trans('panier::Attention, vous etes sur le point de supprimer un element du reportage. Merci de confirmer votre action.'),
|
||||
'advsearch_title' => $translator->trans('phraseanet::recherche avancee'),
|
||||
'bask_rename' => $translator->trans('panier:: renommer le panier'),
|
||||
|
@@ -14,9 +14,13 @@
|
||||
<div class="expose_item_deployed">
|
||||
<div class="expose_item_top">
|
||||
<span class="green_button edit_expose" data-id="{{ publication.id }}"><i class="fa fa-edit"></i></span>
|
||||
<span class="delete-publication" data-publication-id="{{ publication.id }}">
|
||||
<i class="fa fa-trash"></i> Delete
|
||||
</span>
|
||||
{% if publication.children|length == 0 %}
|
||||
<button type="button" class="delete-publication btn-danger" data-publication-id="{{ publication.id }}">
|
||||
<i class="fa fa-trash"></i> Delete
|
||||
</button>
|
||||
{% else %}
|
||||
<span>Parent publication</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="expose_item_bottom">
|
||||
<div class="expose_drag_drop">
|
||||
|
@@ -479,13 +479,21 @@
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="add_expose_block"><a id="add_expose" class="add_expose" href="#" ><span>{{ 'prod:: workzone:expose: Add publication' | trans }}</span><img src="/assets/common/images/icons/Basket-New.png" title="New Expose"></a></div>
|
||||
<div class="add_expose_block">
|
||||
<a id="add_expose" class="add_expose" href="#" >
|
||||
<span>{{ 'prod:: workzone:expose: Add publication' | trans }}</span>
|
||||
<img src="/assets/common/images/icons/Basket-New.png" title="New Expose">
|
||||
</a>
|
||||
<button class="btn-success refresh-list">{{ 'Refresh' | trans }}</button>
|
||||
</div>
|
||||
|
||||
<div class="insidebloc expose_insidebloc">
|
||||
<div id="validations-block" class="validations-block publication-list">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{# <div id="DIALOG-expose"></div>#}
|
||||
<div id='DIALOG-expose-edit' style="display: none"></div>
|
||||
|
||||
{% import 'prod/WorkZone/ExposeNew.html.twig' as ExposeNew %}
|
||||
|
Reference in New Issue
Block a user