mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
fix edit and list
This commit is contained in:
36
Phraseanet-production-client/dist/production.js
vendored
36
Phraseanet-production-client/dist/production.js
vendored
@@ -9461,7 +9461,7 @@ var workzone = function workzone(services) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
(0, _jquery2.default)('.add_expose').on('click', function (event) {
|
(0, _jquery2.default)('.add_expose').on('click', function (event) {
|
||||||
openExposeModalOnBasket('#DIALOG-expose-add');
|
openExposePublicationAdd();
|
||||||
});
|
});
|
||||||
|
|
||||||
(0, _jquery2.default)('#expose_list').on('change', function () {
|
(0, _jquery2.default)('#expose_list').on('change', function () {
|
||||||
@@ -9477,7 +9477,7 @@ var workzone = function workzone(services) {
|
|||||||
(0, _jquery2.default)(this).toggleClass('open');
|
(0, _jquery2.default)(this).toggleClass('open');
|
||||||
});
|
});
|
||||||
(0, _jquery2.default)('.edit_expose').on('click', function (event) {
|
(0, _jquery2.default)('.edit_expose').on('click', function (event) {
|
||||||
openExposeModalOnBasket();
|
openExposePublicationEdit();
|
||||||
});
|
});
|
||||||
|
|
||||||
activeExpose();
|
activeExpose();
|
||||||
@@ -10102,10 +10102,8 @@ var workzone = function workzone(services) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function openExposeModalOnBasket() {
|
function openExposePublicationAdd() {
|
||||||
var edit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '#DIALOG-expose-edit';
|
(0, _jquery2.default)('#DIALOG-expose-add').attr('title', localeService.t('Edit expose title')).dialog({
|
||||||
|
|
||||||
(0, _jquery2.default)(edit).attr('title', localeService.t('Edit expose title')).dialog({
|
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
closeOnEscape: true,
|
closeOnEscape: true,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
@@ -10116,10 +10114,34 @@ var workzone = function workzone(services) {
|
|||||||
overlay: {
|
overlay: {
|
||||||
backgroundColor: '#000',
|
backgroundColor: '#000',
|
||||||
opacity: 0.7
|
opacity: 0.7
|
||||||
|
},
|
||||||
|
close: function close(e, ui) {}
|
||||||
|
}).dialog('open');
|
||||||
|
(0, _jquery2.default)('.ui-dialog').addClass('black-dialog-wrap publish-dialog');
|
||||||
|
(0, _jquery2.default)('#DIALOG-expose-add').on('click', '.close-expose-modal', function () {
|
||||||
|
(0, _jquery2.default)('#DIALOG-expose-add').dialog('close');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function openExposePublicationEdit() {
|
||||||
|
(0, _jquery2.default)('#DIALOG-expose-edit').attr('title', localeService.t('Edit expose title')).dialog({
|
||||||
|
autoOpen: false,
|
||||||
|
closeOnEscape: true,
|
||||||
|
resizable: true,
|
||||||
|
draggable: true,
|
||||||
|
width: 900,
|
||||||
|
height: 575,
|
||||||
|
modal: true,
|
||||||
|
overlay: {
|
||||||
|
backgroundColor: '#000',
|
||||||
|
opacity: 0.7
|
||||||
|
},
|
||||||
|
close: function close(e, ui) {
|
||||||
|
(0, _jquery2.default)('#DIALOG-expose-edit').empty();
|
||||||
}
|
}
|
||||||
}).dialog('open');
|
}).dialog('open');
|
||||||
(0, _jquery2.default)('.ui-dialog').addClass('black-dialog-wrap publish-dialog');
|
(0, _jquery2.default)('.ui-dialog').addClass('black-dialog-wrap publish-dialog');
|
||||||
(0, _jquery2.default)('.close-expose-modal').on('click', function () {
|
(0, _jquery2.default)('#DIALOG-expose-edit').on('click', '.close-expose-modal', function () {
|
||||||
(0, _jquery2.default)('#DIALOG-expose-edit').dialog('close');
|
(0, _jquery2.default)('#DIALOG-expose-edit').dialog('close');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -9461,7 +9461,7 @@ var workzone = function workzone(services) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
(0, _jquery2.default)('.add_expose').on('click', function (event) {
|
(0, _jquery2.default)('.add_expose').on('click', function (event) {
|
||||||
openExposeModalOnBasket('#DIALOG-expose-add');
|
openExposePublicationAdd();
|
||||||
});
|
});
|
||||||
|
|
||||||
(0, _jquery2.default)('#expose_list').on('change', function () {
|
(0, _jquery2.default)('#expose_list').on('change', function () {
|
||||||
@@ -9477,7 +9477,7 @@ var workzone = function workzone(services) {
|
|||||||
(0, _jquery2.default)(this).toggleClass('open');
|
(0, _jquery2.default)(this).toggleClass('open');
|
||||||
});
|
});
|
||||||
(0, _jquery2.default)('.edit_expose').on('click', function (event) {
|
(0, _jquery2.default)('.edit_expose').on('click', function (event) {
|
||||||
openExposeModalOnBasket();
|
openExposePublicationEdit();
|
||||||
});
|
});
|
||||||
|
|
||||||
activeExpose();
|
activeExpose();
|
||||||
@@ -10102,10 +10102,8 @@ var workzone = function workzone(services) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function openExposeModalOnBasket() {
|
function openExposePublicationAdd() {
|
||||||
var edit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '#DIALOG-expose-edit';
|
(0, _jquery2.default)('#DIALOG-expose-add').attr('title', localeService.t('Edit expose title')).dialog({
|
||||||
|
|
||||||
(0, _jquery2.default)(edit).attr('title', localeService.t('Edit expose title')).dialog({
|
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
closeOnEscape: true,
|
closeOnEscape: true,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
@@ -10116,10 +10114,34 @@ var workzone = function workzone(services) {
|
|||||||
overlay: {
|
overlay: {
|
||||||
backgroundColor: '#000',
|
backgroundColor: '#000',
|
||||||
opacity: 0.7
|
opacity: 0.7
|
||||||
|
},
|
||||||
|
close: function close(e, ui) {}
|
||||||
|
}).dialog('open');
|
||||||
|
(0, _jquery2.default)('.ui-dialog').addClass('black-dialog-wrap publish-dialog');
|
||||||
|
(0, _jquery2.default)('#DIALOG-expose-add').on('click', '.close-expose-modal', function () {
|
||||||
|
(0, _jquery2.default)('#DIALOG-expose-add').dialog('close');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function openExposePublicationEdit() {
|
||||||
|
(0, _jquery2.default)('#DIALOG-expose-edit').attr('title', localeService.t('Edit expose title')).dialog({
|
||||||
|
autoOpen: false,
|
||||||
|
closeOnEscape: true,
|
||||||
|
resizable: true,
|
||||||
|
draggable: true,
|
||||||
|
width: 900,
|
||||||
|
height: 575,
|
||||||
|
modal: true,
|
||||||
|
overlay: {
|
||||||
|
backgroundColor: '#000',
|
||||||
|
opacity: 0.7
|
||||||
|
},
|
||||||
|
close: function close(e, ui) {
|
||||||
|
(0, _jquery2.default)('#DIALOG-expose-edit').empty();
|
||||||
}
|
}
|
||||||
}).dialog('open');
|
}).dialog('open');
|
||||||
(0, _jquery2.default)('.ui-dialog').addClass('black-dialog-wrap publish-dialog');
|
(0, _jquery2.default)('.ui-dialog').addClass('black-dialog-wrap publish-dialog');
|
||||||
(0, _jquery2.default)('.close-expose-modal').on('click', function () {
|
(0, _jquery2.default)('#DIALOG-expose-edit').on('click', '.close-expose-modal', function () {
|
||||||
(0, _jquery2.default)('#DIALOG-expose-edit').dialog('close');
|
(0, _jquery2.default)('#DIALOG-expose-edit').dialog('close');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -90,7 +90,7 @@ const workzone = (services) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('.add_expose').on('click',function (event) {
|
$('.add_expose').on('click',function (event) {
|
||||||
openExposeModalOnBasket('#DIALOG-expose-add');
|
openExposePublicationAdd();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#expose_list').on('change', function () {
|
$('#expose_list').on('change', function () {
|
||||||
@@ -106,7 +106,7 @@ const workzone = (services) => {
|
|||||||
$(this).toggleClass('open');
|
$(this).toggleClass('open');
|
||||||
});
|
});
|
||||||
$('.edit_expose').on('click',function (event) {
|
$('.edit_expose').on('click',function (event) {
|
||||||
openExposeModalOnBasket();
|
openExposePublicationEdit();
|
||||||
});
|
});
|
||||||
|
|
||||||
activeExpose();
|
activeExpose();
|
||||||
@@ -741,8 +741,8 @@ const workzone = (services) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function openExposeModalOnBasket(edit = '#DIALOG-expose-edit') {
|
function openExposePublicationAdd() {
|
||||||
$(edit).attr('title', localeService.t('Edit expose title'))
|
$('#DIALOG-expose-add').attr('title', localeService.t('Edit expose title'))
|
||||||
.dialog({
|
.dialog({
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
closeOnEscape: true,
|
closeOnEscape: true,
|
||||||
@@ -754,10 +754,36 @@ const workzone = (services) => {
|
|||||||
overlay: {
|
overlay: {
|
||||||
backgroundColor: '#000',
|
backgroundColor: '#000',
|
||||||
opacity: 0.7
|
opacity: 0.7
|
||||||
|
},
|
||||||
|
close: function(e, ui) {
|
||||||
}
|
}
|
||||||
}).dialog('open');
|
}).dialog('open');
|
||||||
$('.ui-dialog').addClass('black-dialog-wrap publish-dialog');
|
$('.ui-dialog').addClass('black-dialog-wrap publish-dialog');
|
||||||
$('.close-expose-modal').on('click', function () {
|
$('#DIALOG-expose-add').on('click', '.close-expose-modal', function () {
|
||||||
|
$('#DIALOG-expose-add').dialog('close');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function openExposePublicationEdit() {
|
||||||
|
$('#DIALOG-expose-edit').attr('title', localeService.t('Edit expose title'))
|
||||||
|
.dialog({
|
||||||
|
autoOpen: false,
|
||||||
|
closeOnEscape: true,
|
||||||
|
resizable: true,
|
||||||
|
draggable: true,
|
||||||
|
width: 900,
|
||||||
|
height: 575,
|
||||||
|
modal: true,
|
||||||
|
overlay: {
|
||||||
|
backgroundColor: '#000',
|
||||||
|
opacity: 0.7
|
||||||
|
},
|
||||||
|
close: function(e, ui) {
|
||||||
|
$('#DIALOG-expose-edit').empty();
|
||||||
|
}
|
||||||
|
}).dialog('open');
|
||||||
|
$('.ui-dialog').addClass('black-dialog-wrap publish-dialog');
|
||||||
|
$('#DIALOG-expose-edit').on('click', '.close-expose-modal', function () {
|
||||||
$('#DIALOG-expose-edit').dialog('close');
|
$('#DIALOG-expose-edit').dialog('close');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -65,7 +65,12 @@ class PSExposeController extends Controller
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
if ($resPublication->getStatusCode() == 200) {
|
if ($resPublication->getStatusCode() == 200) {
|
||||||
$publications[] = json_decode($resPublication->getBody()->getContents(),true);
|
$publication = json_decode($resPublication->getBody()->getContents(),true);
|
||||||
|
$publications[] = $publication;
|
||||||
|
|
||||||
|
foreach ($publication['children'] as $child ) {
|
||||||
|
$publications[] = $child;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,14 +25,22 @@
|
|||||||
<select id="publication_parent" name="parentId" tabindex="-1" aria-hidden="true"
|
<select id="publication_parent" name="parentId" tabindex="-1" aria-hidden="true"
|
||||||
class="publication-field">
|
class="publication-field">
|
||||||
<option value="">Select a parent publication</option>
|
<option value="">Select a parent publication</option>
|
||||||
|
{% if publication.parent %}
|
||||||
|
<option value="{{ publication.parent.id }}" selected="selected">{{ publication.parent.title }}</option>
|
||||||
|
{% endif %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-widget profile-wrapper hide">
|
<div class="ui-widget profile-wrapper hide">
|
||||||
<label>Profile </label>
|
<label>Profile </label>
|
||||||
|
{% set nbProfile = publication.profile|length %}
|
||||||
|
|
||||||
<select id="profile-field" name="profile" tabindex="-1" aria-hidden="true"
|
<select id="profile-field" name="profile" tabindex="-1" aria-hidden="true"
|
||||||
class="publication-field">
|
class="publication-field">
|
||||||
<option value="">Select Profile</option>
|
<option value="">Select Profile</option>
|
||||||
|
{% if nbProfile %}
|
||||||
|
<option value="{{ publication.profile.id }}">{{ publication.profile.name }}</option>
|
||||||
|
{% endif %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-widget">
|
<div class="ui-widget">
|
||||||
@@ -183,8 +191,6 @@
|
|||||||
publicationParent.empty().html('<option value="">Select a parent publication</option>');
|
publicationParent.empty().html('<option value="">Select a parent publication</option>');
|
||||||
for (i = 0; i < data.publications.length; i++) {
|
for (i = 0; i < data.publications.length; i++) {
|
||||||
let selected = '';
|
let selected = '';
|
||||||
console.log({{ publication.parent.id }} + '::::' + data.publications[i].id);
|
|
||||||
|
|
||||||
if (data.publications[i].id == '{{ parentId }}') {
|
if (data.publications[i].id == '{{ parentId }}') {
|
||||||
selected = 'selected="selected"';
|
selected = 'selected="selected"';
|
||||||
}
|
}
|
||||||
@@ -195,6 +201,28 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: `/prod/expose/list-profile?exposeName={{ exposeName }}`,
|
||||||
|
success: function (data) {
|
||||||
|
profileField.empty().html('<option value="">Select Profile</option>');;
|
||||||
|
for (i = 0; i < data.profiles.length; i++) {
|
||||||
|
let selected = '';
|
||||||
|
if ({{ nbProfile }} && data.profiles[i].id === '{{ publication.profile.id }}') {
|
||||||
|
selected = 'selected="selected"';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#DIALOG-expose-edit select#profile-field').append('<option ' +
|
||||||
|
'value=' + data.basePath + '/' + data.profiles[i].id + ' ' + selected + ' >'
|
||||||
|
+ data.profiles[i].name +
|
||||||
|
'</option>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**convert Object data to Json**/
|
/**convert Object data to Json**/
|
||||||
|
@@ -162,15 +162,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$(".toggleSetting").click(function (e) {
|
$("#DIALOG-expose-add .toggleSetting").click(function (e) {
|
||||||
$(this).toggleClass('open');
|
$(this).toggleClass('open');
|
||||||
$('#advancedSettingInner').toggleClass('hidden');
|
$('#DIALOG-expose-add #advancedSettingInner').toggleClass('hidden');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function buildData() {
|
function buildData() {
|
||||||
try {
|
try {
|
||||||
var allData = $('#publication-data-form').serializeArray();
|
var allData = $('#DIALOG-expose-add #publication-data-form').serializeArray();
|
||||||
// console.log(allData);
|
// console.log(allData);
|
||||||
var dataValue = allData.reduce((acc, it) => {
|
var dataValue = allData.reduce((acc, it) => {
|
||||||
acc[it.name] = it.value;
|
acc[it.name] = it.value;
|
||||||
@@ -227,11 +227,11 @@
|
|||||||
function removeSecurityField() {
|
function removeSecurityField() {
|
||||||
var datavalueMinus = buildData();
|
var datavalueMinus = buildData();
|
||||||
|
|
||||||
if ($("#publication_parent").val() == "") {
|
if ($("#DIALOG-expose-add #publication_parent").val() == "") {
|
||||||
delete datavalueMinus['parentId'];
|
delete datavalueMinus['parentId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($("#profile-field").val() == "") {
|
if ($("#DIALOG-expose-add #profile-field").val() == "") {
|
||||||
delete datavalueMinus['profile'];
|
delete datavalueMinus['profile'];
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
@@ -245,12 +245,12 @@
|
|||||||
delete datavalueMinus['beginsAt'];
|
delete datavalueMinus['beginsAt'];
|
||||||
delete datavalueMinus['expiresAt'];
|
delete datavalueMinus['expiresAt'];
|
||||||
|
|
||||||
$('#advancedSetting').val(JSON.stringify(datavalueMinus, undefined, 4));
|
$('#DIALOG-expose-add #advancedSetting').val(JSON.stringify(datavalueMinus, undefined, 4));
|
||||||
console.log(JSON.stringify(datavalueMinus, undefined, 4));
|
console.log(JSON.stringify(datavalueMinus, undefined, 4));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.publication-field').on('keyup change', function (e) {
|
$('#DIALOG-expose-add .publication-field').on('keyup change', function (e) {
|
||||||
removeSecurityField();
|
removeSecurityField();
|
||||||
/**Toggle display the Security option field**/
|
/**Toggle display the Security option field**/
|
||||||
$("#publication_securityMethod").change(function (e) {
|
$("#publication_securityMethod").change(function (e) {
|
||||||
@@ -268,13 +268,13 @@
|
|||||||
dataValue["securityMethod"] = Svalue;
|
dataValue["securityMethod"] = Svalue;
|
||||||
|
|
||||||
if (Svalue == 'authentication') {
|
if (Svalue == 'authentication') {
|
||||||
$("#publication_password").val('');
|
$("#DIALOG-expose-add #publication_password").val('');
|
||||||
$("#publication_securityMethod_error").removeClass('hidden');
|
$("#DIALOG-expose-add #publication_securityMethod_error").removeClass('hidden');
|
||||||
} else {
|
} else {
|
||||||
$("#publication_securityMethod_error").addClass('hidden');
|
$("#DIALOG-expose-add #publication_securityMethod_error").addClass('hidden');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$("#publication_password").val('');
|
$("#DIALOG-expose-add #publication_password").val('');
|
||||||
};
|
};
|
||||||
removeSecurityField();
|
removeSecurityField();
|
||||||
|
|
||||||
@@ -293,7 +293,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('#publication-json').on('submit', function (e) {
|
$('#DIALOG-expose-add #publication-json').on('submit', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
try {
|
try {
|
||||||
$("#pub-error").addClass("hidden");
|
$("#pub-error").addClass("hidden");
|
||||||
@@ -308,7 +308,7 @@
|
|||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: {
|
data: {
|
||||||
exposeName: $('#expose_name').val(),
|
exposeName: $('#expose_name').val(),
|
||||||
publicationData: $('#advancedSetting').val()
|
publicationData: $('#DIALOG-expose-add #advancedSetting').val()
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
@@ -320,7 +320,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('.publication-field').on('keyup change', function (e) {
|
$('#DIALOG-expose-add .publication-field').on('keyup change', function (e) {
|
||||||
try {
|
try {
|
||||||
$("#pub-success").addClass("hidden");
|
$("#pub-success").addClass("hidden");
|
||||||
$("#pub-error").addClass("hidden");
|
$("#pub-error").addClass("hidden");
|
||||||
@@ -339,9 +339,9 @@
|
|||||||
type: "GET",
|
type: "GET",
|
||||||
url: `/prod/expose/list-publication/?format=json&exposeName=` + this.value,
|
url: `/prod/expose/list-publication/?format=json&exposeName=` + this.value,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('#publication_parent').empty().html('<option value="">Select a parent publication</option>');
|
$('#DIALOG-expose-add #publication_parent').empty().html('<option value="">Select a parent publication</option>');
|
||||||
for (i = 0; i < data.publications.length; i++) {
|
for (i = 0; i < data.publications.length; i++) {
|
||||||
$('select#publication_parent').append('<option value='+data.publications[i].id+' >'+data.publications[i].title+'</option>');
|
$('#DIALOG-expose-add select#publication_parent').append('<option value='+data.publications[i].id+' >'+data.publications[i].title+'</option>');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -351,7 +351,7 @@
|
|||||||
type: "GET",
|
type: "GET",
|
||||||
url: `/prod/expose/list-profile?exposeName=` + this.value,
|
url: `/prod/expose/list-profile?exposeName=` + this.value,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('#profile-field').empty().html('<option value="">Select Profile</option>');;
|
$('#DIALOG-expose-add select#profile-field').empty().html('<option value="">Select Profile</option>');;
|
||||||
for (i = 0; i < data.profiles.length; i++) {
|
for (i = 0; i < data.profiles.length; i++) {
|
||||||
$('select#profile-field').append('<option ' +
|
$('select#profile-field').append('<option ' +
|
||||||
'value=' + data.basePath + '/' + data.profiles[i].id + ' >'
|
'value=' + data.basePath + '/' + data.profiles[i].id + ' >'
|
||||||
|
Reference in New Issue
Block a user