diff --git a/admin/themes/default/js/batchManagerUnit.js b/admin/themes/default/js/batchManagerUnit.js index c4ae0f098..3172f0fc6 100644 --- a/admin/themes/default/js/batchManagerUnit.js +++ b/admin/themes/default/js/batchManagerUnit.js @@ -1,5 +1,38 @@ $(document).ready(function () { + //DELETE FUNCTION + $('#action-delete-picture').on('click', function() { + var pictureId = $(this).parents("fieldset").data("image_id") + var this_url_delete = window["url_delete_" + pictureId]; + console.log(pictureId + " - " + this_url_delete); + $.confirm({ + title: str_are_you_sure, + draggable: false, + titleClass: "groupDeleteConfirm", + theme: "modern", + content: "", + animation: "zoom", + boxWidth: '30%', + useBootstrap: false, + type: 'red', + animateFromElement: false, + backgroundDismiss: true, + typeAnimated: false, + buttons: { + confirm: { + text: str_yes, + btnClass: 'btn-red', + action: function () { + window.location.href = this_url_delete.replaceAll('amp;', ''); + } + }, + cancel: { + text: str_no + } + } + }); + }) + $(".linked-albums.add-item").on("click", function () { var pictureId = $(this).parents("fieldset").data("image_id") linked_albums_open(pictureId); @@ -119,6 +152,9 @@ function fill_results(cats, pictureId) { $("#"+pictureId+" .orphan-photo").hide(); } } + + + // $(function () { // $('.privacy-filter-slider').each(function() { // var id = $(this).attr('id'); @@ -138,4 +174,74 @@ function fill_results(cats, pictureId) { // function updateCertificationFilterLabel(value, id) { // let label = strs_privacy[value]; // $('#' + id + ' .privacy').html(label); -// } \ No newline at end of file +// } + + +/* ********** Filters*/ +// function filter_enable(filter) { +// /* show the filter*/ +// $("#"+filter).show(); + +// /* check the checkbox to declare we use this filter */ +// $("input[type=checkbox][name="+filter+"_use]").prop("checked", true); + +// /* forbid to select this filter in the addFilter list */ +// $("#addFilter").find("a[data-value="+filter+"]").addClass("disabled", "disabled"); + +// /* hide the no filter message */ +// $('.noFilter').hide(); +// $('.addFilter-button').removeClass('highlight'); +// } + +// function filter_disable(filter) { +// /* hide the filter line */ +// $("#"+filter).hide(); + +// /* uncheck the checkbox to declare we do not use this filter */ +// $("input[name="+filter+"_use]").prop("checked", false); + +// /* give the possibility to show it again */ +// $("#addFilter").find("a[data-value="+filter+"]").removeClass("disabled"); + +// /* show the no filter message if no filter selected */ +// if ($('#filterList li:visible').length == 0) { +// $('.noFilter').show(); +// $('.addFilter-button').addClass('highlight'); +// } + +// } + +// $(".removeFilter").addClass("icon-cancel-circled"); + +// $(".removeFilter").click(function () { +// var filter = $(this).parent('li').attr("id"); +// filter_disable(filter); + +// return false; +// }); + +// $("#addFilter a").on('click', function () { +// var filter = $(this).attr("data-value"); +// filter_enable(filter); +// }); + +// $("#removeFilters").click(function() { +// $("#filterList li").each(function() { +// var filter = $(this).attr("id"); +// filter_disable(filter); +// }); +// return false; +// }); + +// $('[data-slider=widths]').pwgDoubleSlider(sliders.widths); +// $('[data-slider=heights]').pwgDoubleSlider(sliders.heights); +// $('[data-slider=ratios]').pwgDoubleSlider(sliders.ratios); +// $('[data-slider=filesizes]').pwgDoubleSlider(sliders.filesizes); + + +// $(document).mouseup(function (e) { +// e.stopPropagation(); +// if (!$(event.target).hasClass('addFilter-button')) { +// $('.addFilter-dropdown').slideUp(); +// } +// }); \ No newline at end of file diff --git a/admin/themes/default/template/batch_manager_unit.tpl b/admin/themes/default/template/batch_manager_unit.tpl index b9abcf8a1..86df67f21 100644 --- a/admin/themes/default/template/batch_manager_unit.tpl +++ b/admin/themes/default/template/batch_manager_unit.tpl @@ -53,37 +53,6 @@ str_orphan = '{'This photo is an orphan'|@translate|escape:javascript}'; str_no_search_in_progress = '{'No search in progress'|@translate|escape:javascript}'; str_already_in_related_cats = '{'This albums is already in related categories list'|translate|escape:javascript}'; -{literal} -$('#action-delete-picture').on('click', function() { - $.confirm({ - title: str_are_you_sure, - draggable: false, - titleClass: "groupDeleteConfirm", - theme: "modern", - content: "", - animation: "zoom", - boxWidth: '30%', - useBootstrap: false, - type: 'red', - animateFromElement: false, - backgroundDismiss: true, - typeAnimated: false, - buttons: { - confirm: { - text: str_yes, - btnClass: 'btn-red', - action: function () { - window.location.href = url_delete.replaceAll('amp;', ''); - } - }, - cancel: { - text: str_no - } - } - }); -}) -{/literal} - }()); const strs_privacy = { "0" : "{$level_options[8]}", @@ -92,7 +61,44 @@ const strs_privacy = { "3" : "{$level_options[1]}", "4" : "{$level_options[0]}", }; +{* +var sliders = { + widths: { + values: [{$dimensions.widths}], + selected: { + min: {$dimensions.selected.min_width}, + max: {$dimensions.selected.max_width}, + }, + text: '{'between %d and %d pixels'|translate|escape:'javascript'}' + }, + heights: { + values: [{$dimensions.heights}], + selected: { + min: {$dimensions.selected.min_height}, + max: {$dimensions.selected.max_height}, + }, + text: '{'between %d and %d pixels'|translate|escape:'javascript'}' + }, + + ratios: { + values: [{$dimensions.ratios}], + selected: { + min: {$dimensions.selected.min_ratio}, + max: {$dimensions.selected.max_ratio}, + }, + text: '{'between %.2f and %.2f'|translate|escape:'javascript'}' + }, + + filesizes: { + values: [{$filesize.list}], + selected: { + min: {$filesize.selected.min}, + max: {$filesize.selected.max}, + }, + text: '{'between %s and %s MB'|translate|escape:'javascript'}' + } +}; *} {/footer_script} {combine_script id='batchManagerUnit' load='footer' require='jquery.ui.effect-blind,jquery.sort' path='admin/themes/default/js/batchManagerUnit.js'} @@ -114,16 +120,213 @@ const strs_privacy = { {if !empty($elements) }
+{*
+{'Filter'|@translate} + +
+ + +
{'No filter, add one'|@translate}
+ + +
+ +
*} {foreach from=$elements item=element} {footer_script} var related_category_ids_{$element.ID} = {$element.related_category_ids}; - console.log(related_category_ids_{$element.ID}); - url_delete = '{$element.U_DELETE}'; - id = '{$element.ID}'; - + url_delete_{$element.id} = '{$element.U_DELETE}'; {/footer_script} {debug} +
imagename @@ -250,15 +453,16 @@ const strs_privacy = { {/foreach} {if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if} +{/if} +
+
+
+
- - - {* {'Submit'|@translate} *} - {* *} +
-{/if} {include file='include/album_selector.inc.tpl' @@ -514,12 +718,12 @@ const strs_privacy = { .bottom-save-bar{ position: fixed; bottom: 0; - left: 0; - width: 100%; + right: 0; + width: calc(100% - 205px); background-color: #ffffff; text-align: right; - z-index: 4; - border-top: 1px solid #CCCCCC + z-index: 101; + border-top: 1px solid #CCCCCC; } .bottom-save-bar button{