mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 12:03:14 +00:00
load more,delete some fix displayed
#time 7h
This commit is contained in:
66
Phraseanet-production-client/dist/production.js
vendored
66
Phraseanet-production-client/dist/production.js
vendored
@@ -9950,8 +9950,10 @@ var workzone = function workzone(services) {
|
||||
}
|
||||
|
||||
function activeExpose() {
|
||||
var idFrameC = (0, _jquery2.default)('#idFrameC');
|
||||
|
||||
// drop on publication
|
||||
(0, _jquery2.default)('#idFrameC').find('.publication-droppable').droppable({
|
||||
idFrameC.find('.publication-droppable').droppable({
|
||||
scope: 'objects',
|
||||
hoverClass: 'baskDrop',
|
||||
tolerance: 'pointer',
|
||||
@@ -9971,11 +9973,12 @@ var workzone = function workzone(services) {
|
||||
}
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('#idFrameC').find('.publication-droppable').on('click', '.removeAsset', function () {
|
||||
// delete an asset from publication
|
||||
idFrameC.find('.publication-droppable').on('click', '.removeAsset', function () {
|
||||
var publicationId = (0, _jquery2.default)(this).attr('data-publication-id');
|
||||
var assetId = (0, _jquery2.default)(this).attr('data-asset-id');
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_drag_drop');
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_item_deployed');
|
||||
|
||||
var buttons = {};
|
||||
|
||||
@@ -9996,7 +9999,7 @@ var workzone = function workzone(services) {
|
||||
success: function success(data) {
|
||||
if (data.success === true) {
|
||||
$dialog.close();
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1);
|
||||
} else {
|
||||
$dialog.setContent(data.message);
|
||||
console.log(data);
|
||||
@@ -10015,7 +10018,12 @@ var workzone = function workzone(services) {
|
||||
$dialog.setContent(texte);
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('#idFrameC').find('.publication-droppable').on('click', '.delete-publication', function () {
|
||||
idFrameC.find('.publication-droppable').on('click', '.edit_expose', function (event) {
|
||||
openExposePublicationEdit((0, _jquery2.default)(this));
|
||||
});
|
||||
|
||||
// delete a publication
|
||||
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 = {};
|
||||
@@ -10052,16 +10060,18 @@ var workzone = function workzone(services) {
|
||||
$dialog.setContent(texte);
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('#idFrameC').find('.publication-droppable').on('click', '.refresh-publication', function () {
|
||||
// refresh publication content
|
||||
idFrameC.find('.publication-droppable').on('click', '.refresh-publication', function () {
|
||||
var publicationId = (0, _jquery2.default)(this).attr('data-publication-id');
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_item_deployed').find('.expose_drag_drop');
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_item_deployed');
|
||||
|
||||
assetsContainer.empty().addClass('loading');
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1);
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('#idFrameC').find('.publication-droppable').on('click', '.set-cover', function () {
|
||||
// set publication cover
|
||||
idFrameC.find('.publication-droppable').on('click', '.set-cover', function () {
|
||||
var publicationId = (0, _jquery2.default)(this).attr('data-publication-id');
|
||||
var assetId = (0, _jquery2.default)(this).attr('data-asset-id');
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
@@ -10084,6 +10094,17 @@ var workzone = function workzone(services) {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// load more asset and append it at the end
|
||||
idFrameC.find('.publication-droppable').on('click', '.load_more_asset', function () {
|
||||
var publicationId = (0, _jquery2.default)(this).attr('data-publication-id');
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_item_bottom').find('.expose_drag_drop');
|
||||
var page = assetsContainer.find('#list_assets_page').val();
|
||||
|
||||
(0, _jquery2.default)(this).find('.loading_more').removeClass('hidden');
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer, parseInt(page) + 1);
|
||||
});
|
||||
}
|
||||
|
||||
function updatePublicationList(exposeName) {
|
||||
@@ -10100,15 +10121,12 @@ var workzone = function workzone(services) {
|
||||
if ((0, _jquery2.default)(this).hasClass('open')) {
|
||||
var publicationId = (0, _jquery2.default)(this).attr('data-publication-id');
|
||||
var _exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_basket_item').find('.expose_drag_drop');
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_basket_item').find('.expose_item_deployed');
|
||||
|
||||
assetsContainer.addClass('loading');
|
||||
getPublicationAssetsList(publicationId, _exposeName, assetsContainer);
|
||||
getPublicationAssetsList(publicationId, _exposeName, assetsContainer, 1);
|
||||
}
|
||||
});
|
||||
(0, _jquery2.default)('.edit_expose').on('click', function (event) {
|
||||
openExposePublicationEdit((0, _jquery2.default)(this));
|
||||
});
|
||||
|
||||
activeExpose();
|
||||
}
|
||||
@@ -10116,13 +10134,21 @@ var workzone = function workzone(services) {
|
||||
}
|
||||
|
||||
function getPublicationAssetsList(publicationId, exposeName, assetsContainer) {
|
||||
var page = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
||||
|
||||
_jquery2.default.ajax({
|
||||
type: 'GET',
|
||||
url: '/prod/expose/get-publication/' + publicationId + '?exposeName=' + exposeName + '&onlyAssets=1',
|
||||
url: '/prod/expose/get-publication/' + publicationId + '/assets?exposeName=' + exposeName + '&page=' + page,
|
||||
success: function success(data) {
|
||||
if (typeof data.success === 'undefined') {
|
||||
assetsContainer.removeClass('loading');
|
||||
assetsContainer.empty().html(data);
|
||||
if (page === 1) {
|
||||
assetsContainer.removeClass('loading');
|
||||
assetsContainer.empty().html(data);
|
||||
} else {
|
||||
assetsContainer.append(data);
|
||||
assetsContainer.parents('.expose_item_bottom').find('.loading_more').addClass('hidden');
|
||||
assetsContainer.find('#list_assets_page').val(page);
|
||||
}
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
@@ -10429,9 +10455,9 @@ var workzone = function workzone(services) {
|
||||
} else {
|
||||
console.log(data.lst);
|
||||
|
||||
var publicationId = destKey.find('.edit_expose').attr('data-id');
|
||||
var publicationId = destKey.attr('data-publication-id');
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var assetsContainer = destKey.find('.expose_drag_drop');
|
||||
var assetsContainer = destKey.find('.expose_item_deployed');
|
||||
assetsContainer.empty().addClass('loading');
|
||||
|
||||
_jquery2.default.ajax({
|
||||
@@ -10445,7 +10471,7 @@ var workzone = function workzone(services) {
|
||||
dataType: 'json',
|
||||
success: function success(data) {
|
||||
setTimeout(function () {
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1);
|
||||
}, 6000);
|
||||
|
||||
console.log(data.message);
|
||||
|
@@ -9950,8 +9950,10 @@ var workzone = function workzone(services) {
|
||||
}
|
||||
|
||||
function activeExpose() {
|
||||
var idFrameC = (0, _jquery2.default)('#idFrameC');
|
||||
|
||||
// drop on publication
|
||||
(0, _jquery2.default)('#idFrameC').find('.publication-droppable').droppable({
|
||||
idFrameC.find('.publication-droppable').droppable({
|
||||
scope: 'objects',
|
||||
hoverClass: 'baskDrop',
|
||||
tolerance: 'pointer',
|
||||
@@ -9971,11 +9973,12 @@ var workzone = function workzone(services) {
|
||||
}
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('#idFrameC').find('.publication-droppable').on('click', '.removeAsset', function () {
|
||||
// delete an asset from publication
|
||||
idFrameC.find('.publication-droppable').on('click', '.removeAsset', function () {
|
||||
var publicationId = (0, _jquery2.default)(this).attr('data-publication-id');
|
||||
var assetId = (0, _jquery2.default)(this).attr('data-asset-id');
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_drag_drop');
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_item_deployed');
|
||||
|
||||
var buttons = {};
|
||||
|
||||
@@ -9996,7 +9999,7 @@ var workzone = function workzone(services) {
|
||||
success: function success(data) {
|
||||
if (data.success === true) {
|
||||
$dialog.close();
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1);
|
||||
} else {
|
||||
$dialog.setContent(data.message);
|
||||
console.log(data);
|
||||
@@ -10015,7 +10018,12 @@ var workzone = function workzone(services) {
|
||||
$dialog.setContent(texte);
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('#idFrameC').find('.publication-droppable').on('click', '.delete-publication', function () {
|
||||
idFrameC.find('.publication-droppable').on('click', '.edit_expose', function (event) {
|
||||
openExposePublicationEdit((0, _jquery2.default)(this));
|
||||
});
|
||||
|
||||
// delete a publication
|
||||
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 = {};
|
||||
@@ -10052,16 +10060,18 @@ var workzone = function workzone(services) {
|
||||
$dialog.setContent(texte);
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('#idFrameC').find('.publication-droppable').on('click', '.refresh-publication', function () {
|
||||
// refresh publication content
|
||||
idFrameC.find('.publication-droppable').on('click', '.refresh-publication', function () {
|
||||
var publicationId = (0, _jquery2.default)(this).attr('data-publication-id');
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_item_deployed').find('.expose_drag_drop');
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_item_deployed');
|
||||
|
||||
assetsContainer.empty().addClass('loading');
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1);
|
||||
});
|
||||
|
||||
(0, _jquery2.default)('#idFrameC').find('.publication-droppable').on('click', '.set-cover', function () {
|
||||
// set publication cover
|
||||
idFrameC.find('.publication-droppable').on('click', '.set-cover', function () {
|
||||
var publicationId = (0, _jquery2.default)(this).attr('data-publication-id');
|
||||
var assetId = (0, _jquery2.default)(this).attr('data-asset-id');
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
@@ -10084,6 +10094,17 @@ var workzone = function workzone(services) {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// load more asset and append it at the end
|
||||
idFrameC.find('.publication-droppable').on('click', '.load_more_asset', function () {
|
||||
var publicationId = (0, _jquery2.default)(this).attr('data-publication-id');
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_item_bottom').find('.expose_drag_drop');
|
||||
var page = assetsContainer.find('#list_assets_page').val();
|
||||
|
||||
(0, _jquery2.default)(this).find('.loading_more').removeClass('hidden');
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer, parseInt(page) + 1);
|
||||
});
|
||||
}
|
||||
|
||||
function updatePublicationList(exposeName) {
|
||||
@@ -10100,15 +10121,12 @@ var workzone = function workzone(services) {
|
||||
if ((0, _jquery2.default)(this).hasClass('open')) {
|
||||
var publicationId = (0, _jquery2.default)(this).attr('data-publication-id');
|
||||
var _exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_basket_item').find('.expose_drag_drop');
|
||||
var assetsContainer = (0, _jquery2.default)(this).parents('.expose_basket_item').find('.expose_item_deployed');
|
||||
|
||||
assetsContainer.addClass('loading');
|
||||
getPublicationAssetsList(publicationId, _exposeName, assetsContainer);
|
||||
getPublicationAssetsList(publicationId, _exposeName, assetsContainer, 1);
|
||||
}
|
||||
});
|
||||
(0, _jquery2.default)('.edit_expose').on('click', function (event) {
|
||||
openExposePublicationEdit((0, _jquery2.default)(this));
|
||||
});
|
||||
|
||||
activeExpose();
|
||||
}
|
||||
@@ -10116,13 +10134,21 @@ var workzone = function workzone(services) {
|
||||
}
|
||||
|
||||
function getPublicationAssetsList(publicationId, exposeName, assetsContainer) {
|
||||
var page = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
||||
|
||||
_jquery2.default.ajax({
|
||||
type: 'GET',
|
||||
url: '/prod/expose/get-publication/' + publicationId + '?exposeName=' + exposeName + '&onlyAssets=1',
|
||||
url: '/prod/expose/get-publication/' + publicationId + '/assets?exposeName=' + exposeName + '&page=' + page,
|
||||
success: function success(data) {
|
||||
if (typeof data.success === 'undefined') {
|
||||
assetsContainer.removeClass('loading');
|
||||
assetsContainer.empty().html(data);
|
||||
if (page === 1) {
|
||||
assetsContainer.removeClass('loading');
|
||||
assetsContainer.empty().html(data);
|
||||
} else {
|
||||
assetsContainer.append(data);
|
||||
assetsContainer.parents('.expose_item_bottom').find('.loading_more').addClass('hidden');
|
||||
assetsContainer.find('#list_assets_page').val(page);
|
||||
}
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
@@ -10429,9 +10455,9 @@ var workzone = function workzone(services) {
|
||||
} else {
|
||||
console.log(data.lst);
|
||||
|
||||
var publicationId = destKey.find('.edit_expose').attr('data-id');
|
||||
var publicationId = destKey.attr('data-publication-id');
|
||||
var exposeName = (0, _jquery2.default)('#expose_list').val();
|
||||
var assetsContainer = destKey.find('.expose_drag_drop');
|
||||
var assetsContainer = destKey.find('.expose_item_deployed');
|
||||
assetsContainer.empty().addClass('loading');
|
||||
|
||||
_jquery2.default.ajax({
|
||||
@@ -10445,7 +10471,7 @@ var workzone = function workzone(services) {
|
||||
dataType: 'json',
|
||||
success: function success(data) {
|
||||
setTimeout(function () {
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1);
|
||||
}, 6000);
|
||||
|
||||
console.log(data.message);
|
||||
|
@@ -7906,6 +7906,7 @@ dans l'onglet thesaurus : arbres, menus contextuels
|
||||
#idFrameC .expose_item_deployed.open {
|
||||
height: auto;
|
||||
max-height: 100vh;
|
||||
min-height: 130px;
|
||||
}
|
||||
|
||||
#idFrameC .top_image {
|
||||
|
File diff suppressed because one or more lines are too long
@@ -7921,6 +7921,7 @@ dans l'onglet thesaurus : arbres, menus contextuels
|
||||
#idFrameC .expose_item_deployed.open {
|
||||
height: auto;
|
||||
max-height: 100vh;
|
||||
min-height: 130px;
|
||||
}
|
||||
|
||||
#idFrameC .top_image {
|
||||
|
File diff suppressed because one or more lines are too long
@@ -7923,6 +7923,7 @@ dans l'onglet thesaurus : arbres, menus contextuels
|
||||
#idFrameC .expose_item_deployed.open {
|
||||
height: auto;
|
||||
max-height: 100vh;
|
||||
min-height: 130px;
|
||||
}
|
||||
|
||||
#idFrameC .top_image {
|
||||
|
File diff suppressed because one or more lines are too long
@@ -114,7 +114,7 @@ const workzone = (services) => {
|
||||
$('.publication-list').on('click', '.top-block' , function (event) {
|
||||
$(this).parent().find('.expose_item_deployed').toggleClass('open');
|
||||
$(this).toggleClass('open');
|
||||
})
|
||||
});
|
||||
|
||||
$('#idFrameC .ui-tabs-nav li').on('click', function (event) {
|
||||
if ($container.attr('data-status') === 'closed') {
|
||||
@@ -577,8 +577,10 @@ const workzone = (services) => {
|
||||
}
|
||||
|
||||
function activeExpose() {
|
||||
let idFrameC = $('#idFrameC');
|
||||
|
||||
// drop on publication
|
||||
$('#idFrameC').find('.publication-droppable')
|
||||
idFrameC.find('.publication-droppable')
|
||||
.droppable({
|
||||
scope: 'objects',
|
||||
hoverClass: 'baskDrop',
|
||||
@@ -599,11 +601,12 @@ const workzone = (services) => {
|
||||
}
|
||||
});
|
||||
|
||||
$('#idFrameC').find('.publication-droppable').on('click', '.removeAsset', function(){
|
||||
// delete an asset from publication
|
||||
idFrameC.find('.publication-droppable').on('click', '.removeAsset', function(){
|
||||
let publicationId = $(this).attr('data-publication-id');
|
||||
let assetId = $(this).attr('data-asset-id');
|
||||
let exposeName = $('#expose_list').val();
|
||||
let assetsContainer = $(this).parents('.expose_drag_drop');
|
||||
let assetsContainer = $(this).parents('.expose_item_deployed');
|
||||
|
||||
let buttons = {};
|
||||
|
||||
@@ -624,7 +627,7 @@ const workzone = (services) => {
|
||||
success: function (data) {
|
||||
if (data.success === true) {
|
||||
$dialog.close();
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1);
|
||||
} else {
|
||||
$dialog.setContent(data.message);
|
||||
console.log(data);
|
||||
@@ -643,7 +646,12 @@ const workzone = (services) => {
|
||||
$dialog.setContent(texte);
|
||||
});
|
||||
|
||||
$('#idFrameC').find('.publication-droppable').on('click', '.delete-publication', function() {
|
||||
idFrameC.find('.publication-droppable').on('click', '.edit_expose', function (event) {
|
||||
openExposePublicationEdit($(this));
|
||||
});
|
||||
|
||||
// delete a publication
|
||||
idFrameC.find('.publication-droppable').on('click', '.delete-publication', function() {
|
||||
let publicationId = $(this).attr('data-publication-id');
|
||||
let exposeName = $('#expose_list').val();
|
||||
let buttons = {};
|
||||
@@ -680,16 +688,18 @@ const workzone = (services) => {
|
||||
$dialog.setContent(texte);
|
||||
});
|
||||
|
||||
$('#idFrameC').find('.publication-droppable').on('click', '.refresh-publication', function() {
|
||||
// refresh publication content
|
||||
idFrameC.find('.publication-droppable').on('click', '.refresh-publication', function() {
|
||||
let publicationId = $(this).attr('data-publication-id');
|
||||
let exposeName = $('#expose_list').val();
|
||||
let assetsContainer = $(this).parents('.expose_item_deployed').find('.expose_drag_drop');
|
||||
let assetsContainer = $(this).parents('.expose_item_deployed');
|
||||
|
||||
assetsContainer.empty().addClass('loading');
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1);
|
||||
});
|
||||
|
||||
$('#idFrameC').find('.publication-droppable').on('click', '.set-cover', function(){
|
||||
// set publication cover
|
||||
idFrameC.find('.publication-droppable').on('click', '.set-cover', function(){
|
||||
let publicationId = $(this).attr('data-publication-id');
|
||||
let assetId = $(this).attr('data-asset-id');
|
||||
let exposeName = $('#expose_list').val();
|
||||
@@ -712,6 +722,17 @@ const workzone = (services) => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// load more asset and append it at the end
|
||||
idFrameC.find('.publication-droppable').on('click', '.load_more_asset', function() {
|
||||
let publicationId = $(this).attr('data-publication-id');
|
||||
let exposeName = $('#expose_list').val();
|
||||
let assetsContainer = $(this).parents('.expose_item_bottom').find('.expose_drag_drop');
|
||||
let page = assetsContainer.find('#list_assets_page').val();
|
||||
|
||||
$(this).find('.loading_more').removeClass('hidden');
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer, parseInt(page) + 1);
|
||||
});
|
||||
}
|
||||
|
||||
function updatePublicationList(exposeName)
|
||||
@@ -729,15 +750,12 @@ const workzone = (services) => {
|
||||
if ($(this).hasClass('open')) {
|
||||
let publicationId = $(this).attr('data-publication-id');
|
||||
let exposeName = $('#expose_list').val();
|
||||
let assetsContainer = $(this).parents('.expose_basket_item').find('.expose_drag_drop');
|
||||
let assetsContainer = $(this).parents('.expose_basket_item').find('.expose_item_deployed');
|
||||
|
||||
assetsContainer.addClass('loading');
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1);
|
||||
}
|
||||
});
|
||||
$('.edit_expose').on('click',function (event) {
|
||||
openExposePublicationEdit($(this));
|
||||
});
|
||||
|
||||
activeExpose();
|
||||
}
|
||||
@@ -745,14 +763,20 @@ const workzone = (services) => {
|
||||
}
|
||||
|
||||
|
||||
function getPublicationAssetsList(publicationId, exposeName, assetsContainer) {
|
||||
function getPublicationAssetsList(publicationId, exposeName, assetsContainer, page=1) {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: `/prod/expose/get-publication/${publicationId}?exposeName=${exposeName}&onlyAssets=1`,
|
||||
url: `/prod/expose/get-publication/${publicationId}/assets?exposeName=${exposeName}&page=${page}`,
|
||||
success: function (data) {
|
||||
if (typeof data.success === 'undefined') {
|
||||
assetsContainer.removeClass('loading');
|
||||
assetsContainer.empty().html(data);
|
||||
if (page ===1) {
|
||||
assetsContainer.removeClass('loading');
|
||||
assetsContainer.empty().html(data);
|
||||
} else {
|
||||
assetsContainer.append(data);
|
||||
assetsContainer.parents('.expose_item_bottom').find('.loading_more').addClass('hidden');
|
||||
assetsContainer.find('#list_assets_page').val(page);
|
||||
}
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
@@ -1074,9 +1098,9 @@ const workzone = (services) => {
|
||||
} else {
|
||||
console.log(data.lst);
|
||||
|
||||
let publicationId = destKey.find('.edit_expose').attr('data-id');
|
||||
let publicationId = destKey.attr('data-publication-id');
|
||||
let exposeName = $('#expose_list').val();
|
||||
let assetsContainer = destKey.find('.expose_drag_drop');
|
||||
let assetsContainer = destKey.find('.expose_item_deployed');
|
||||
assetsContainer.empty().addClass('loading');
|
||||
|
||||
$.ajax({
|
||||
@@ -1090,7 +1114,7 @@ const workzone = (services) => {
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
setTimeout(function(){
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer);
|
||||
getPublicationAssetsList(publicationId, exposeName, assetsContainer, 1);
|
||||
}
|
||||
, 6000);
|
||||
|
||||
|
@@ -34,6 +34,7 @@
|
||||
&.open {
|
||||
height: auto;
|
||||
max-height: 100vh;
|
||||
min-height: 130px;
|
||||
}
|
||||
}
|
||||
.top_image {
|
||||
|
@@ -122,6 +122,57 @@ class PSExposeController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Require params "exposeName" and "publicationId"
|
||||
* optionnal param "page"
|
||||
*
|
||||
* @param PhraseaApplication $app
|
||||
* @param Request $request
|
||||
* @return string|\Symfony\Component\HttpFoundation\JsonResponse
|
||||
*/
|
||||
public function getPublicationAssetsAction(PhraseaApplication $app, Request $request)
|
||||
{
|
||||
$page = $request->get('page')?:1;
|
||||
|
||||
$exposeConfiguration = $app['conf']->get(['phraseanet-service', 'expose-service', 'exposes'], []);
|
||||
$exposeConfiguration = $exposeConfiguration[$request->get('exposeName')];
|
||||
|
||||
$exposeClient = new Client(['base_uri' => $exposeConfiguration['expose_base_uri'], 'http_errors' => false]);
|
||||
|
||||
if (!isset($exposeConfiguration['token'])) {
|
||||
$exposeConfiguration = $this->generateAndSaveToken($exposeConfiguration, $request->get('exposeName'));
|
||||
}
|
||||
|
||||
$resPublication = $exposeClient->get('/publications/' . $request->get('publicationId') . '/assets?page=' . $page , [
|
||||
'headers' => [
|
||||
'Authorization' => 'Bearer '. $exposeConfiguration['token'],
|
||||
'Content-Type' => 'application/json'
|
||||
]
|
||||
]);
|
||||
|
||||
if ($resPublication->getStatusCode() != 200) {
|
||||
return $app->json([
|
||||
'success' => false,
|
||||
'message' => "An error occurred when getting publication assets: status-code " . $resPublication->getStatusCode()
|
||||
]);
|
||||
}
|
||||
|
||||
$pubAssets = [];
|
||||
$totalItems = 0;
|
||||
if ($resPublication->getStatusCode() == 200) {
|
||||
$body = json_decode($resPublication->getBody()->getContents(),true);
|
||||
$pubAssets = $body['hydra:member'];
|
||||
$totalItems = $body['hydra:totalItems'];
|
||||
}
|
||||
|
||||
return $this->render("prod/WorkZone/ExposePublicationAssets.html.twig", [
|
||||
'pubAssets' => $pubAssets,
|
||||
'publicationId' => $request->get('publicationId'),
|
||||
'totalItems' => $totalItems,
|
||||
'page' => $page
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Require params "exposeName"
|
||||
*
|
||||
@@ -493,17 +544,17 @@ class PSExposeController extends Controller
|
||||
|
||||
private function removeAssetPublication(Client $exposeClient, $publicationId, $assetId, $token)
|
||||
{
|
||||
return $exposeClient->delete('/publication-assets/'.$publicationId.'/'.$assetId, [
|
||||
$exposeClient->delete('/publication-assets/'.$publicationId.'/'.$assetId, [
|
||||
'headers' => [
|
||||
'Authorization' => 'Bearer '. $token
|
||||
]
|
||||
]);
|
||||
|
||||
// $exposeClient->delete('/assets/'. $assetId, [
|
||||
// 'headers' => [
|
||||
// 'Authorization' => 'Bearer '. $token
|
||||
// ]
|
||||
// ]);
|
||||
return $exposeClient->delete('/assets/'. $assetId, [
|
||||
'headers' => [
|
||||
'Authorization' => 'Bearer '. $token
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -42,6 +42,10 @@ class PSExposeServiceProvider implements ControllerProviderInterface, ServicePro
|
||||
->method('GET')
|
||||
->bind('ps_expose_list_publication');
|
||||
|
||||
$controllers->match('/get-publication/{publicationId}/assets', 'controller.ps.expose:getPublicationAssetsAction')
|
||||
->method('GET')
|
||||
->bind('ps_expose_get_publication_assets');
|
||||
|
||||
$controllers->match('/get-publication/{publicationId}', 'controller.ps.expose:getPublicationAction')
|
||||
->method('GET')
|
||||
->bind('ps_expose_get_publication');
|
||||
|
@@ -354,12 +354,12 @@
|
||||
exposeName: "{{ exposeName }}",
|
||||
publicationData: advancedSetting.val()
|
||||
},
|
||||
success: function (data) {
|
||||
success: function (data) {console.log(data.success);
|
||||
if (data.success) {
|
||||
publicationEdit.find("#pub-success").removeClass("hidden").html(data.message);
|
||||
document.getElementById("publication-data-form").reset();
|
||||
setTimeout(function(){
|
||||
$('#DIALOG-expose-add').dialog('close');
|
||||
$('#DIALOG-expose-edit').dialog('close');
|
||||
}
|
||||
, 2000
|
||||
);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{% for publication in publications %}
|
||||
<div class="expose_basket_item publication-droppable basketTips ui-accordion-header ui-state-default
|
||||
ui-corner-all header">
|
||||
ui-corner-all header" data-publication-id="{{ publication.id }}">
|
||||
<div class="top_block" data-publication-id="{{ publication.id }}">
|
||||
<div class="diapo">
|
||||
{% if publication.cover %}
|
||||
@@ -13,26 +13,6 @@
|
||||
|
||||
</div>
|
||||
<div class="expose_item_deployed">
|
||||
<div class="expose_item_top">
|
||||
<button class="btn-success refresh-publication pull-right" data-publication-id="{{ publication.id }}">{{ 'Refresh Publication' | trans }}</button>
|
||||
<span class="green_button edit_expose" data-id="{{ publication.id }}"><i class="fa fa-edit"></i></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">
|
||||
</div>
|
||||
<div class="load_more_asset">
|
||||
<button type="button">
|
||||
{{ "Load More" | trans }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
@@ -1,25 +1,45 @@
|
||||
<div>
|
||||
<span class="item_numbers">{{ assets|length }} assets</span>
|
||||
</div>
|
||||
{% if page == 1 %}
|
||||
<div class="expose_item_top">
|
||||
<button class="btn-success refresh-publication pull-right" data-publication-id="{{ publicationId }}">{{ 'Refresh Publication' | trans }}</button>
|
||||
<span class="green_button edit_expose" data-id="{{ publicationId }}"><i class="fa fa-edit"></i></span>
|
||||
{% if pubAssets[0].publication.children|length == 0 %}
|
||||
<button type="button" class="delete-publication btn-danger" data-publication-id="{{ publicationId }}">
|
||||
<i class="fa fa-trash"></i> Delete
|
||||
</button>
|
||||
{% else %}
|
||||
<span>Parent publication</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% for asset in assets %}
|
||||
<div class="expose_item_bottom">
|
||||
<div class="expose_drag_drop">
|
||||
|
||||
<input type="hidden" id="list_assets_page" value="1"/>
|
||||
|
||||
<div>
|
||||
<span class="item_numbers">{{ totalItems }} assets</span>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% for pubAsset in pubAssets %}
|
||||
<div class="chim-wrapper">
|
||||
<div class="chim-content">
|
||||
<div class="CHIM diapo">
|
||||
<div class="thumb_wrapper">
|
||||
<img
|
||||
data-kind="image" oncontextMenu="return(false);"
|
||||
src="{{ asset.asset.thumbUrl|trim }}" data-original="{{ asset.asset.thumbUrl|trim }}" ondragstart="return false;">
|
||||
src="{{ pubAsset.asset.thumbUrl|trim }}" data-original="{{ pubAsset.asset.thumbUrl|trim }}" ondragstart="return false;">
|
||||
</div>
|
||||
|
||||
<div class="set-cover" style="position: absolute;bottom: 0;cursor: pointer;" title="Set as Cover"
|
||||
data-publication-id="{{ publicationId }}" data-asset-id="{{ asset.asset.id }}">
|
||||
data-publication-id="{{ pubAsset.publication.id }}" data-asset-id="{{ pubAsset.asset.id }}">
|
||||
|
||||
<img src="/assets/common/images/icons/icon_story.gif" title="Set as Cover">
|
||||
</div>
|
||||
|
||||
<div class="bottom">
|
||||
<a class="WorkZoneElementRemover removeAsset" data-asset-id="{{ asset.asset.id }}" data-publication-id="{{ publicationId }}">
|
||||
<a class="WorkZoneElementRemover removeAsset" data-asset-id="{{ pubAsset.asset.id }}" data-publication-id="{{ pubAsset.publication.id }}">
|
||||
<i class="icomoon icon-circle fa-stack-2x" aria-hidden="true"></i>
|
||||
<i class="icomoon icon-round-close-24px fa-stack-1x " aria-hidden="true"></i>
|
||||
</a>
|
||||
@@ -29,4 +49,14 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% if page == 1 %}
|
||||
</div>
|
||||
|
||||
<div class="load_more_asset" data-publication-id="{{ publicationId }}">
|
||||
<div class="loading_more loading hidden" style="height:40px;"></div>
|
||||
<button type="button">
|
||||
{{ "Load More" | trans }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user