diff --git a/admin/include/plugins.class.php b/admin/include/plugins.class.php index c0f6826d1..5a08a9d20 100644 --- a/admin/include/plugins.class.php +++ b/admin/include/plugins.class.php @@ -376,7 +376,7 @@ DELETE FROM '. PLUGINS_TABLE .' } // Retrieve PEM versions - function get_versions_to_check($version=PHPWG_VERSION) + function get_versions_to_check($beta_test=false, $version=PHPWG_VERSION) { global $conf; @@ -384,30 +384,66 @@ DELETE FROM '. PLUGINS_TABLE .' $url = PEM_URL . '/api/get_version_list.php?category_id='. $conf['pem_plugins_category'] .'&format=php'; if (fetchRemote($url, $result) and $pem_versions = @unserialize($result)) { - if (!preg_match('/^\d+\.\d+\.\d+$/', $version)) + $i = 0; + + // If the actual version exist, put the PEM id in $versions_to_check + while ($i < count($pem_versions) && count($versions_to_check) == 0) { - $version = $pem_versions[0]['name']; - } - $branch = get_branch_from_version($version); - foreach ($pem_versions as $pem_version) - { - if (strpos($pem_version['name'], $branch) === 0) + if (get_branch_from_version($pem_versions[$i]['name']) == get_branch_from_version($version)) { - $versions_to_check[] = $pem_version['id']; + $versions_to_check[] = $pem_versions[$i]['id']; + } + $i++; + } + + // If $beta_test is true, search the previous version + if ($beta_test) + { + // If the actual version is not in PEM, put the latest PEM version + if (count($versions_to_check) == 0) + { + $versions_to_check[] = $pem_versions[0]['id']; + } + else // Else search the next version in PEM + { + $has_found_previous_version = false; + while ($i < count($pem_versions) && !$has_found_previous_version) + { + if ($pem_versions[$i]['id'] != $versions_to_check[0]) + { + $versions_to_check[] = $pem_versions[$i]['id']; + $has_found_previous_version = true; + } + $i++; + } } } + + // if (!preg_match('/^\d+\.\d+\.\d+$/', $version)) + // { + // $version = $pem_versions[0]['name']; + // } + // $branch = get_branch_from_version($version); + // foreach ($pem_versions as $pem_version) + // { + // if (strpos($pem_version['name'], $branch) === 0) + // { + // $versions_to_check[] = $pem_version['id']; + // } + // } } return $versions_to_check; } /** * Retrieve PEM server datas to $server_plugins + * $beta_test parameter add plugins compatible with the previous version */ - function get_server_plugins($new=false) + function get_server_plugins($new=false, $beta_test=false) { global $user, $conf; - $versions_to_check = $this->get_versions_to_check(); + $versions_to_check = $this->get_versions_to_check($beta_test); if (empty($versions_to_check)) { return false; @@ -424,7 +460,7 @@ DELETE FROM '. PLUGINS_TABLE .' } // Retrieve PEM plugins infos - $url = PEM_URL . '/api/get_revision_list.php'; + $url = PEM_URL . '/api/get_revision_list-next.php'; $get_data = array( 'category_id' => $conf['pem_plugins_category'], 'format' => 'php', diff --git a/admin/include/themes.class.php b/admin/include/themes.class.php index 70b6a1ed0..4b10a5198 100644 --- a/admin/include/themes.class.php +++ b/admin/include/themes.class.php @@ -509,7 +509,7 @@ SELECT } // Retrieve PEM themes infos - $url = PEM_URL . '/api/get_revision_list.php'; + $url = PEM_URL . '/api/get_revision_list-next.php'; $get_data = array_merge($get_data, array( 'last_revision_only' => 'true', 'version' => implode(',', $versions_to_check), diff --git a/admin/plugins_new.php b/admin/plugins_new.php index 3810f7f8e..946edc9f7 100644 --- a/admin/plugins_new.php +++ b/admin/plugins_new.php @@ -81,7 +81,15 @@ $template->assign('order_options', // +-----------------------------------------------------------------------+ // | start template output | // +-----------------------------------------------------------------------+ -if ($plugins->get_server_plugins(true)) + +$beta_test = false; + +if(isset($_GET['beta-test']) && $_GET['beta-test'] == 'true') +{ + $beta_test = true; +} + +if ($plugins->get_server_plugins(true, $beta_test)) { /* order plugins */ if (pwg_get_session_var('plugins_new_order') != null) @@ -107,6 +115,27 @@ if ($plugins->get_server_plugins(true)) . '&pwg_token='.get_pwg_token() ; + $last_revision_diff = date_diff(date_create($plugin['revision_date']), date_create()); + + $certification = 1; + + if (get_branch_from_version($plugin['compatible_with_versions'][0]) !== get_branch_from_version(PHPWG_VERSION)) + { + $certification = -1; + } + elseif ($last_revision_diff->days < 90) + { + $certification = 3; + } + elseif ($last_revision_diff->days < 180) + { + $certification = 2; + } + elseif ($last_revision_diff->y > 3) + { + $certification = 0; + } + $template->append('plugins', array( 'ID' => $plugin['extension_id'], 'EXT_NAME' => $plugin['extension_name'], @@ -114,12 +143,21 @@ if ($plugins->get_server_plugins(true)) 'SMALL_DESC' => trim($small_desc, " \r\n"), 'BIG_DESC' => $ext_desc, 'VERSION' => $plugin['revision_name'], - 'REVISION_DATE' => preg_replace('/[^0-9]/', '', $plugin['revision_date']), + 'REVISION_DATE' => preg_replace('/[^0-9]/', '', strtotime($plugin['revision_date'])), 'AUTHOR' => $plugin['author_name'], 'DOWNLOADS' => $plugin['extension_nb_downloads'], 'URL_INSTALL' => $url_auto_install, - 'URL_DOWNLOAD' => $plugin['download_url'] . '&origin=piwigo_download')); + 'CERTIFICATION' => $certification, + 'RATING' => $plugin['rating_score'], + 'NB_RATINGS' => $plugin['nb_ratings'], + 'SCREENSHOT' => (key_exists('screenshot_url', $plugin)) ? $plugin['screenshot_url']:'', + 'TAGS' => $plugin["tags"], + )); + + $template->assign('BETA_TEST', $beta_test); } + + } else { diff --git a/admin/themes/clear/theme.css b/admin/themes/clear/theme.css index e16d43045..1a07705aa 100644 --- a/admin/themes/clear/theme.css +++ b/admin/themes/clear/theme.css @@ -212,10 +212,8 @@ INPUT[type="text"].large { width: 317px; } #pwgHead A:hover, #footer A:hover {color:white;} .AlbumViewSelector {background: #fafafa;} -.pluginBox, .pluginMiniBox {background-color:#ddd;color:#353535;border-color:#ddd;} -.pluginBoxNameCell, .pluginMiniBoxNameCell {color:#111;} -.pluginBox.incompatible, .pluginMiniBox.incompatible {border-color:#a00 !important;} -.pluginBoxes .merged, .pluginBoxes .missing {background-color:#d99;border:1px solid #a00;} +.pluginName {color:#111;} +.pluginBox.incompatible {border-color:#a00 !important;} .languageBox {background-color:#ddd;} .languageName {color:black;} @@ -673,7 +671,7 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important; .addFilesButtonChanged:hover {background-color: #BBB;} #checkActions a, .deleteDerivButtons a {background-color: #E8E8E8;} -#filterList select, .pictureLevels select, #permitAction select {background-color: #FFF; color: #4E4E4E; border: 2px solid #7070704f !important; outline: none !important;} +#filterList select, .pictureLevels select, #permitAction select, .sort-by select {background-color: #FFF; color: #4E4E4E; border: 2px solid #7070704f !important; outline: none !important;} #filter_category .selectize-input.items.full.has-options.has-items, #filter_tags .selectize-input.items.not-full.has-options, #filter_tags .selectize-input.items.not-full, #filter_search input, #action_associate .selectize-input.items.full.has-options.has-items, #action_dissociate .selectize-input.items.full.has-options.has-items { diff --git a/admin/themes/default/css/components/general.css b/admin/themes/default/css/components/general.css new file mode 100644 index 000000000..d3a9fa19b --- /dev/null +++ b/admin/themes/default/css/components/general.css @@ -0,0 +1,147 @@ +/* ------------- +Advanced filter +------------- + +.advanced-filter-btn.icon-filter(.advanced-filter-open) +... +.advanced-filter(.advanced-filter-open) + .advanced-filter-header + .advanced-filter-title + .advanced-filter-close.icon-cancel + .advanced-filter-container + .advanced-filter-item + .advanced-filter-item-label + .advanced-filter-item-container + // Put here your filter + ... +*/ + +.advanced-filter-btn { + width: 70px; + z-index: 2; + position: relative; + cursor: pointer; + padding: 10px; + text-align: center; + font-weight: bold; + background-color: #F3F3F3; +} + +.advanced-filter-btn::before { /* Change icon size */ + font-size: 14px; +} + +.advanced-filter-btn.advanced-filter-open::after { + content: ""; + display: block; + width: 100%; + height: 16px; + background-color: inherit; + bottom: -16px; + left: 0; + position: absolute; +} + +.advanced-filter { + display: none; + padding: 15px; + font-size: 1em; + flex-direction: column; + + background-color: #F3F3F3; +} + +.advanced-filter.advanced-filter-open { + display: flex; +} + +.advanced-filter-header { + display: flex; + justify-content: space-between; + margin-bottom: 10px; +} + +.advanced-filter-title { + font-weight: bold; + + color: #3e3e3e; +} + +.advanced-filter-close { + font-size: 1.8em; + color: #C5C5C5; + cursor: pointer; +} + +.advanced-filter-close:hover { + color: #ff7700; +} + +.advanced-filter-container { + display: flex; +} + +.advanced-filter-item:not(:last-child) { + margin-right: 30px; +} + +.advanced-filter-item-label { + text-align: left; + display: flex; + margin-bottom: 5px; + + color:#3e3e3e; +} + +.advanced-filter-item-container { + position: relative; + text-align: left; + width: 100%; +} + +/* Set Margin if the last element is a slider */ +.advanced-filter-item:last-child .advanced-filter-item-container .slider-bar-wrapper { + margin-right: 10px; +} + +/* ------------- +Advanced filter Select +------------- + +.advanced-filter-select-container + select.advanced-filter-select + +or (generated by selectize.js) + +.advanced-filter-item-container + .selectize-control + .selectize-input +*/ + +.user-action-select-container::before, .advanced-filter-select-container::before { + content: '\e835'; font-size: 14px; position: absolute; font-family: "fontello"; color: #6E6E6E; pointer-events: none; +} + +.advanced-filter-select-container::before { + top: 8px; right:10px +} + +.advanced-filter-select { + display: block; + border: solid 1px #D4D4D4; + padding: 8px 10px; + height: 34px; + background: white; +} + +.advanced-filter-item-container .selectize-control .selectize-input { + border: solid 1px #D4D4D4 !important; + padding: 8px 10px !important; + height: 34px; + background: white !important; + box-shadow: none !important; +} + +.advanced-filter-item-container .selectize-control .selectize-input .item { + padding-right: 0 !important; +} \ No newline at end of file diff --git a/admin/themes/default/images/certification/Certification.svg b/admin/themes/default/images/certification/Certification.svg new file mode 100644 index 000000000..4a91ea199 --- /dev/null +++ b/admin/themes/default/images/certification/Certification.svg @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/admin/themes/default/images/certification/CertificationBlue.svg b/admin/themes/default/images/certification/CertificationBlue.svg new file mode 100644 index 000000000..b4f8a3159 --- /dev/null +++ b/admin/themes/default/images/certification/CertificationBlue.svg @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/admin/themes/default/images/certification/CertificationGhost.svg b/admin/themes/default/images/certification/CertificationGhost.svg new file mode 100644 index 000000000..0163c9150 --- /dev/null +++ b/admin/themes/default/images/certification/CertificationGhost.svg @@ -0,0 +1,44 @@ + + + + + + + + diff --git a/admin/themes/default/images/certification/CertificationOrange.svg b/admin/themes/default/images/certification/CertificationOrange.svg new file mode 100644 index 000000000..485d8bf41 --- /dev/null +++ b/admin/themes/default/images/certification/CertificationOrange.svg @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/admin/themes/default/images/certification/CertificationWarning.svg b/admin/themes/default/images/certification/CertificationWarning.svg new file mode 100644 index 000000000..8ff20cc36 --- /dev/null +++ b/admin/themes/default/images/certification/CertificationWarning.svg @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/admin/themes/default/js/plugins_installated.js b/admin/themes/default/js/plugins_installated.js index 557d48e8b..612845173 100644 --- a/admin/themes/default/js/plugins_installated.js +++ b/admin/themes/default/js/plugins_installated.js @@ -6,7 +6,7 @@ function setDisplayClassic() { $(".pluginActions").show(); $(".pluginActionsSmallIcons").hide(); - $(".pluginMiniBoxNameCell").removeClass("pluginMiniBoxNameCellCompact"); + $(".pluginName").removeClass("pluginNameCompact"); // normalTitle(); } @@ -19,7 +19,7 @@ function setDisplayCompact() { $(".pluginActions").hide(); $(".pluginActionsSmallIcons").show(); - $(".pluginMiniBoxNameCell").addClass("pluginMiniBoxNameCellCompact"); + $(".pluginName").addClass("pluginNameCompact"); // reduceTitle() } @@ -35,7 +35,7 @@ function setDisplayLine() { } function reduceTitle() { - var x = document.getElementsByClassName("pluginMiniBoxNameCell"); + var x = document.getElementsByClassName("pluginName"); var length = 22; for (const div of x) { @@ -51,7 +51,7 @@ function reduceTitle() { } function normalTitle() { - var x = document.getElementsByClassName("pluginMiniBoxNameCell"); + var x = document.getElementsByClassName("pluginName"); for (const div of x) { div.innerHTML = div.dataset.title @@ -277,13 +277,13 @@ $(document).ready(function () { $("#seeAll").on("change", function () { - $(".pluginMiniBox").show(); + $(".pluginBox").show(); $('.search-input').trigger("input"); }) $("#seeActive").on("change", function () { - $(".pluginMiniBox").show(); - $(".pluginMiniBox").each(function () { + $(".pluginBox").show(); + $(".pluginBox").each(function () { if (!$(this).hasClass("plugin-active")) { $(this).hide(); } @@ -292,8 +292,8 @@ $(document).ready(function () { }) $("#seeInactive").on("change", function () { - $(".pluginMiniBox").show(); - $(".pluginMiniBox").each(function () { + $(".pluginBox").show(); + $(".pluginBox").each(function () { if (!$(this).hasClass("plugin-inactive")) { $(this).hide(); } @@ -302,8 +302,8 @@ $(document).ready(function () { }) $("#seeOther").on("change", function () { - $(".pluginMiniBox").show(); - $(".pluginMiniBox").each(function () { + $(".pluginBox").show(); + $(".pluginBox").each(function () { if (($(this).hasClass("plugin-active") || $(this).hasClass("plugin-inactive"))) { $(this).hide(); } @@ -360,7 +360,7 @@ $(document).ready(function () { * Delete */ $(".pluginContent").find('.dropdown-option.delete-plugin-button').on('click', function () { - let plugin_name = $(this).closest(".pluginContent").find(".pluginMiniBoxNameCell").html().trim(); + let plugin_name = $(this).closest(".pluginContent").find(".pluginName").html().trim(); let plugin_id = $(this).closest(".pluginContent").parent().attr("id"); $.confirm({ title: delete_plugin_msg.replace("%s",plugin_name), @@ -384,7 +384,7 @@ $(document).ready(function () { * Restore */ $(".pluginContent").find('.dropdown-option.plugin-restore').on('click', function () { - let plugin_name = $(this).closest(".pluginContent").find(".pluginMiniBoxNameCell").html().trim(); + let plugin_name = $(this).closest(".pluginContent").find(".pluginName").html().trim(); let plugin_id = $(this).closest(".pluginContent").parent().attr("id"); $.confirm({ title: restore_plugin_msg.replace('%s', plugin_name), @@ -408,7 +408,7 @@ $(document).ready(function () { * Uninstall */ $(".pluginContent").find('.uninstall-plugin-button').on('click', function () { - let plugin_name = $(this).closest(".pluginContent").find(".pluginMiniBoxNameCell").html().trim(); + let plugin_name = $(this).closest(".pluginContent").find(".pluginName").html().trim(); let plugin_id = $(this).closest(".pluginContent").parent().attr("id"); $.confirm({ title: uninstall_plugin_msg.replace('%s', plugin_name), diff --git a/admin/themes/default/js/plugins_new.js b/admin/themes/default/js/plugins_new.js new file mode 100644 index 000000000..a82f6f5de --- /dev/null +++ b/admin/themes/default/js/plugins_new.js @@ -0,0 +1,297 @@ +var sortOrder = 'date'; +var sortPlugins = (function (a, b) { + if (sortOrder == 'downloads' || sortOrder == 'revision' || sortOrder == 'date') + return parseInt($(a).data(sortOrder)) + < parseInt($(b).data(sortOrder)) ? 1 : -1; + else + return $(a).data(sortOrder).toLowerCase() + > $(b).data(sortOrder).toLowerCase() ? 1 : -1; +}); + +$(function () { + + let betaTestPlugins = $('#showBetaTestPlugin')[0].hasAttribute('checked'); + let filters = {}; + + $(".advanced-filter-btn").click(advanced_filter_button_click); + $(".advanced-filter span.icon-cancel").click(advanced_filter_hide); + + function advanced_filter_button_click() { + if (!$(".advanced-filter").hasClass("advanced-filter-open")) { + advanced_filter_show(); + } else { + advanced_filter_hide(); + } + } + + function advanced_filter_show() { + $(".advanced-filter-btn, .advanced-filter").addClass("advanced-filter-open"); + } + + function advanced_filter_hide() { + $(".advanced-filter-btn, .advanced-filter").removeClass("advanced-filter-open"); + } + + jQuery('select[name="selectOrder"]').change(function () { + sortOrder = this.value; + $('.pluginBox').sortElements(sortPlugins); + $.get("admin.php?plugins_new_order=" + sortOrder); + }); + + jQuery('#search').on("input", function () { + applyFilter('search', this.value.toUpperCase()); + jQuery("#search").trigger("click"); + }); + + $('.search-cancel').on('click', () => { + applyFilter('search', ''); + }) + + $(".buttonInstall").each(function () { + let plugin_name = $(this).closest(".pluginBox").data('name'); + $(this).pwg_jconfirm_follow_href({ + alert_title: str_install_title.replace("%s", plugin_name), + alert_confirm: str_confirm_msg, + alert_cancel: str_cancel_msg + }); + }); + + jQuery('.certification').tipTip({ + 'delay': 0, + 'fadeIn': 200, + 'fadeOut': 200 + }); + + $('.pluginRating').each((i, node) => { + let ratingContainer = $(node); + let rating = ratingContainer.data('rating'); + displayStars(ratingContainer.find('.rating-star-container'), rating); + }) + + let authorNames = [{ value: '', text: str_all }]; + let tagsNames = [{ value: '', text: str_all }] + + $('.pluginBox').each((i,el) => { + let author = $(el).data('author'); + author.split(', ').forEach(name => { + if (!authorNames.find(el => el.value == name)) { + authorNames.push({ value: name, text: name}) + } + }); + + let tags = $(el).data('tags'); + tags.split(', ').forEach(tag => { + if (!tagsNames.find(el => el.value == tag)) { + tagsNames.push({ value: tag, text: tag }) + } + }); + }) + + // initialize the Selectize control + $select = $('#author-filter').selectize({ + onChange: function (value) { + applyFilter('author', value); + }, + plugins: ['remove_button'], + }); + + // fetch the instance + let selectizeAuthor = $select[0].selectize; + selectizeAuthor.addOption(authorNames); + + // initialize the Selectize control + $select = $('#tag-filter').selectize({ + onChange: function (value) { + applyFilter('tag', value); + }, + plugins: ['remove_button'], + }); + + // fetch the instance + let selectizeTag = $select[0].selectize; + selectizeTag.addOption(tagsNames); + + $('.notation-filter-slider').slider({ + range: 'min', + value: 0, + min: 0, + max: 5, + step: 0.5, + slide: function(event, ui) { + updateRatingFilterLabel(ui.value); + applyFilter("rating", ui.value); + } + }) + + $('.revision-date-filter-slider').slider({ + range: 'min', + value: 0, + min: 0, + max: 6, + slide: function (event, ui) { + let month; + [month, _] = value_to_month(ui.value); + updateRevisionFilterLabel(ui.value); + applyFilter("revision", month); + } + }); + + function value_to_month(val) { + switch (val) { + case 6: + return [1, str_x_month.replace('%d', 1)]; + break; + case 5: + return [3, str_x_months.replace('%d', 3)]; + break; + case 4: + return [6, str_x_months.replace('%d', 6)]; + break; + case 3: + return [12, str_x_year.replace('%d', 1)]; + break; + case 2: + return [24, str_x_years.replace('%d', 2)]; + break; + case 1: + return [60, str_x_years.replace('%d', 5)]; + break; + default: + return [240, str_x_years.replace('%d', 20)]; + break; + } + } + + let minCertification = betaTestPlugins ? -1 : 0; + + $('.certification-filter-slider').slider({ + range: 'min', + value: minCertification, + min: minCertification, + max: 3, + slide: function (event, ui) { + updateCertificationFilterLabel(ui.value); + applyFilter("certification", ui.value); + } + }); + + function monthDiff(d1, d2) { + var months; + months = (d2.getFullYear() - d1.getFullYear()) * 12; + months -= d1.getMonth(); + months += d2.getMonth(); + return months <= 0 ? 0 : months; + } + + updateRatingFilterLabel(0); + updateCertificationFilterLabel(minCertification); + updateRevisionFilterLabel(0); + + function displayStars(element, rating) { + + element.find('span').addClass('icon-star-empty'); + element.find('span i').attr('class',''); + + rating = Math.round(rating * 2); + + if (rating % 2 == 1) { + $(element).find('span[data-star=' + ((rating - 1) / 2) + '] i').addClass('icon-star-half') + rating -= 1; + } + + while (rating > 0) { + rating -= 2; + $(element).find('span[data-star=' + (rating / 2) + '] i').addClass('icon-star') + $(element).find('span[data-star=' + (rating / 2) + ']').removeClass('icon-star-empty') + } + } + + function updateRatingFilterLabel(value) { + displayStars($('.advanced-filter-rating .rating-star-container'), value); + } + + function updateCertificationFilterLabel(value) { + let certifNode = $('.advanced-filter-certification .certification'); + certifNode.attr('data-certification', value); + certifNode.attr('title', strs_certification[String(value)]); + certifNode.tipTip({ + 'delay': 0, + 'fadeIn': 200, + 'fadeOut': 200 + }); + } + + function updateRevisionFilterLabel(val) { + let label; + [_, label] = value_to_month(val); + $('.revision-date').html(label); + } + + filters = { + "search": $('#search').val(), + "author": '', + "tag": '', + "rating": $('.notation-filter-slider').slider('value'), + "certification": $('.certification-filter-slider').slider('value'), + "revision": value_to_month($('.certification-filter-slider').slider('value'))[0], + } + + selectizeAuthor.setValue(''); + selectizeTag.setValue(''); + + + function applyFilter(changed, value) { + + filters[changed] = value; + + sort((pluginBox) => { + let pluginRating = pluginBox.find('.pluginRating').data('rating') || 0; + let pluginCertification = pluginBox.find('.certification').data('certification'); + let pluginAuthors = pluginBox.data('author').split(', '); + let pluginName = pluginBox.data('name').toUpperCase(); + let pluginTags = pluginBox.data('tags').split(', '); + let pluginRevisionOld = monthDiff(new Date(pluginBox.data('revision')*1000), new Date()); // number of months between the last revision date and now + + return (pluginRating >= filters.rating) + && (pluginCertification >= filters.certification) + && (filters.search === '' || pluginName.indexOf(filters.search) != -1) + && (filters.author === '' || pluginAuthors.includes(filters.author)) + && (filters.tag === '' || pluginTags.includes(filters.tag)) + && pluginRevisionOld <= filters['revision']; + }) + } + + // Display or not plugin with a function handler + function sort(sortFunction) { + $('.pluginBox').each((i, el) => { + if (sortFunction($(el))) { + $(el).show(); + } else { + $(el).hide(); + } + }) + } + + function clearSort() { + $('.pluginBox').show(); + } + + // Crop the names of plugins if there are too long + $('.pluginName span').each((i,el) => { + let name = $(el) + if (name.html().length > 30) { + name.html(name.html().slice(0,30) + '...'); + } + }) + + $('#showBetaTestPlugin').on('change', (e) => { + let queryParams = new URLSearchParams(window.location.search); + + queryParams.set("beta-test", e.currentTarget.checked.toString()); + + history.replaceState(null, null, "?" + queryParams.toString()); + + window.location.reload(true); + }) + +}); \ No newline at end of file diff --git a/admin/themes/default/js/user_list.js b/admin/themes/default/js/user_list.js index 5fba10527..7db997ee1 100644 --- a/admin/themes/default/js/user_list.js +++ b/admin/themes/default/js/user_list.js @@ -190,7 +190,7 @@ $( document ).ready(function() { data.language = jQuery("#permitActionUserList select[name=language]").val(); break; case 'recent_period': - data.recent_period = recent_period_values[$('#permitActionUserList .period-select-bar .select-bar-container').slider("option", "value")];; + data.recent_period = recent_period_values[$('#permitActionUserList .period-select-bar .slider-bar-container').slider("option", "value")];; break; case 'expand': data.expand = $("#permitActionUserList .user-list-checkbox[name=expand_yes]").attr("data-selected") === "1" ? true : false; @@ -285,8 +285,8 @@ $( document ).ready(function() { $("#permitActionUserList select[name=selectAction]").val("-1"); - $("#advanced_filter_button").click(advanced_filter_button_click); - $("#advanced-filter-container span.icon-cancel").click(advanced_filter_hide); + $(".advanced-filter-btn").click(advanced_filter_button_click); + $(".advanced-filter span.icon-cancel").click(advanced_filter_hide); $(".advanced-filter-select").change(update_user_list); $("#user_search").on("input", update_user_list); @@ -459,7 +459,7 @@ function getRecentPeriodInfoFromIdx(idx) { } /* Photos bar slider */ -jQuery('#UserList .photos-select-bar .select-bar-container').slider({ +jQuery('#UserList .photos-select-bar .slider-bar-container').slider({ range: "min", min: 0, max: nb_image_page_values.length - 1, @@ -476,7 +476,7 @@ jQuery('#UserList .photos-select-bar .select-bar-container').slider({ }); -jQuery('#GuestUserList .photos-select-bar .select-bar-container').slider({ +jQuery('#GuestUserList .photos-select-bar .slider-bar-container').slider({ range: "min", min: 0, max: nb_image_page_values.length - 1, @@ -493,7 +493,7 @@ jQuery('#GuestUserList .photos-select-bar .select-bar-container').slider({ }); $('#permitActionUserList .photos-select-bar .nb-img-page-infos').html(getNbImagePageInfoFromIdx(0)); -jQuery('#permitActionUserList .photos-select-bar .select-bar-container').slider({ +jQuery('#permitActionUserList .photos-select-bar .slider-bar-container').slider({ range: "min", min: 0, max: nb_image_page_values.length - 1, @@ -510,7 +510,7 @@ jQuery('#permitActionUserList .photos-select-bar .select-bar-container').slider( }); /* recent_period slider */ -$('#UserList .period-select-bar .select-bar-container').slider({ +$('#UserList .period-select-bar .slider-bar-container').slider({ range: "min", min: 0, max: recent_period_values.length - 1, @@ -526,7 +526,7 @@ $('#UserList .period-select-bar .select-bar-container').slider({ } }); -$('#GuestUserList .period-select-bar .select-bar-container').slider({ +$('#GuestUserList .period-select-bar .slider-bar-container').slider({ range: "min", min: 0, max: recent_period_values.length - 1, @@ -542,7 +542,7 @@ $('#GuestUserList .period-select-bar .select-bar-container').slider({ } }); -$('#permitActionUserList .period-select-bar .select-bar-container').slider({ +$('#permitActionUserList .period-select-bar .slider-bar-container').slider({ range: "min", min: 0, max: recent_period_values.length - 1, @@ -557,7 +557,7 @@ $('#permitActionUserList .period-select-bar .select-bar-container').slider({ $('#permitActionUserList .period-select-bar input[name=recent_period]').val(recent_period_values[ui.value]).trigger('change'); } }); -$('#permitActionUserList .photos-select-bar .select-bar-container').slider("option", "value", 0); +$('#permitActionUserList .photos-select-bar .slider-bar-container').slider("option", "value", 0); let period_info = getRecentPeriodInfoFromIdx(0); $('#permitActionUserList .period-select-bar .recent_period_infos').html(period_info); @@ -666,23 +666,20 @@ Advanced filter ------------------*/ function advanced_filter_button_click() { - if ($("#advanced-filter-container").css("display") === "none") { - advanced_filter_show(); + if (!$(".advanced-filter").hasClass("advanced-filter-open")) { + advanced_filter_show(); } else { - advanced_filter_hide(); + advanced_filter_hide(); } + update_user_list(); } function advanced_filter_show() { - $("#advanced-filter-container").show(); - $("#advanced_filter_button").addClass("extended-filter-btn"); - // update_user_list(); + $(".advanced-filter-btn, .advanced-filter").addClass("advanced-filter-open"); } function advanced_filter_hide() { - $("#advanced-filter-container").hide(); - $("#advanced_filter_button").removeClass("extended-filter-btn"); - // update_user_list(); + $(".advanced-filter-btn, .advanced-filter").removeClass("advanced-filter-open"); } let months = []; @@ -694,24 +691,24 @@ function getDateStr(date) { } function setupRegisterDates(register_dates) { - $('#advanced-filter-container .dates-select-bar .select-bar-container').slider({ + $('.advanced-filter .dates-select-bar .slider-bar-container').slider({ range: true, min: 0, max: register_dates.length - 1, values: [0, register_dates.length - 1], change: function( event, ui ) { - $("#advanced-filter-container .dates-infos").html(sprintf(dates_infos, getDateStr(register_dates[ui.values[0]]), getDateStr(register_dates[ui.values[1]]))); + $(".advanced-filter .dates-infos").html(sprintf(dates_infos, getDateStr(register_dates[ui.values[0]]), getDateStr(register_dates[ui.values[1]]))); }, slide: function( event, ui ) { - $("#advanced-filter-container .dates-infos").html(sprintf(dates_infos, getDateStr(register_dates[ui.values[0]]), getDateStr(register_dates[ui.values[1]]))); + $(".advanced-filter .dates-infos").html(sprintf(dates_infos, getDateStr(register_dates[ui.values[0]]), getDateStr(register_dates[ui.values[1]]))); }, stop: function( event, ui ) { - $("#advanced-filter-container .dates-infos").html(sprintf(dates_infos, getDateStr(register_dates[ui.values[0]]), getDateStr(register_dates[ui.values[1]]))); + $(".advanced-filter .dates-infos").html(sprintf(dates_infos, getDateStr(register_dates[ui.values[0]]), getDateStr(register_dates[ui.values[1]]))); update_user_list(); } }); - $("#advanced-filter-container .dates-infos").html(sprintf(dates_infos, getDateStr(register_dates[0]), getDateStr(register_dates[register_dates.length - 1]))); + $(".advanced-filter .dates-infos").html(sprintf(dates_infos, getDateStr(register_dates[0]), getDateStr(register_dates[register_dates.length - 1]))); } /*------------------ @@ -1111,7 +1108,7 @@ function fill_user_edit_preferences(user_to_edit, pop_in) { let slider_key_photos = getSliderKeyFromValue(parseInt(user_to_edit.nb_image_page), nb_image_page_values); let slider_key_period = getSliderKeyFromValue(parseInt(user_to_edit.recent_period), recent_period_values); - pop_in.find('.photos-select-bar .select-bar-container').slider("option", "value", slider_key_photos); + pop_in.find('.photos-select-bar .slider-bar-container').slider("option", "value", slider_key_photos); pop_in.find('.user-property-theme select option').each(function () { if ($(this).val() == user_to_edit.theme) { $(this).prop('selected', true); @@ -1122,7 +1119,7 @@ function fill_user_edit_preferences(user_to_edit, pop_in) { $(this).prop('selected', true); } }); - pop_in.find('.period-select-bar .select-bar-container').slider("option", "value", slider_key_period); + pop_in.find('.period-select-bar .slider-bar-container').slider("option", "value", slider_key_period); pop_in.find('.user-list-checkbox[name="expand_all_albums"]').attr('data-selected', user_to_edit.expand == 'true' ? '1' : '0'); pop_in.find('.user-list-checkbox[name="show_nb_comments"]').attr('data-selected', user_to_edit.show_nb_comments == 'true' ? '1' : '0'); pop_in.find('.user-list-checkbox[name="show_nb_hits"]').attr('data-selected', user_to_edit.show_nb_hits == 'true' ? '1' : '0'); @@ -1267,8 +1264,8 @@ function fill_ajax_data_from_properties(ajax_data, pop_in) { function fill_ajax_data_from_preferences(ajax_data, pop_in) { ajax_data['theme'] = pop_in.find('.user-property-theme select').val(); ajax_data['language'] = pop_in.find('.user-property-lang select').val(); - ajax_data['nb_image_page'] = nb_image_page_values[pop_in.find('.photos-select-bar .select-bar-container').slider("option", "value")]; - ajax_data['recent_period'] = recent_period_values[pop_in.find('.period-select-bar .select-bar-container').slider("option", "value")]; + ajax_data['nb_image_page'] = nb_image_page_values[pop_in.find('.photos-select-bar .slider-bar-container').slider("option", "value")]; + ajax_data['recent_period'] = recent_period_values[pop_in.find('.period-select-bar .slider-bar-container').slider("option", "value")]; ajax_data['expand'] = pop_in.find('.user-list-checkbox[name="expand_all_albums"]').attr('data-selected') == '1' ? true : false; ajax_data['show_nb_comments'] = pop_in.find('.user-list-checkbox[name="show_nb_comments"]').attr('data-selected') == '1' ? true : false ; ajax_data['show_nb_hits'] = pop_in.find('.user-list-checkbox[name="show_nb_hits"]').attr('data-selected') == '1' ? true : false ; @@ -1522,13 +1519,13 @@ function update_user_list() { if ($("#user_search").val().length != 0) { update_data["filter"] = $("#user_search").val(); } - if ($("#advanced-filter-container").css("display") !== "none") { + if ($(".advanced-filter").hasClass('advanced-filter-open') !== "none") { update_data["status"] = $(".advanced-filter-select[name=filter_status]").val(); update_data["group_id"] = $(".advanced-filter-select[name=filter_group]").val(); update_data["min_level"] = $(".advanced-filter-select[name=filter_level]").val(); update_data["max_level"] = $(".advanced-filter-select[name=filter_level]").val(); - update_data["min_register"] = register_dates[$(".dates-select-bar .select-bar-container").slider("option", "values")[0]]; - update_data["max_register"] = register_dates[$(".dates-select-bar .select-bar-container").slider("option", "values")[1]]; + update_data["min_register"] = register_dates[$(".dates-select-bar .slider-bar-container").slider("option", "values")[0]]; + update_data["max_register"] = register_dates[$(".dates-select-bar .slider-bar-container").slider("option", "values")[1]]; } jQuery.ajax({ url: "ws.php?format=json&method=pwg.users.getList", diff --git a/admin/themes/default/template/plugins_installed.tpl b/admin/themes/default/template/plugins_installed.tpl index cd8139e3a..a36ee6fa3 100644 --- a/admin/themes/default/template/plugins_installed.tpl +++ b/admin/themes/default/template/plugins_installed.tpl @@ -93,7 +93,13 @@ jQuery(document).ready(function() { dataType: 'json', success: function(data) { for (i=0;i '); + {/literal} + {if $show_details} + jQuery('#'+data[i]+' .pluginName').prepend('') + {else} + jQuery('#'+data[i]+' .pluginName').prepend('') + {/if} + {literal} jQuery('#'+data[i]).addClass('incompatible'); jQuery('#'+data[i]+' .activate').each(function () { $(this).pwg_jconfirm_follow_href({ @@ -120,21 +126,6 @@ jQuery(document).ready(function() { 'keepAlive':false, }); - /* Add the '...' for the overflow of the description line*/ - jQuery( document ).ready(function () { - jQuery('.pluginDesc').each(function () { - var el = jQuery(this).context; - var wordArray = el.innerHTML.split(' '); - if (el.scrollHeight > el.offsetHeight) { - jQuery(this).attr('title', jQuery(this).html()) - } - while(el.scrollHeight > el.offsetHeight) { - wordArray.pop(); - el.innerHTML = wordArray.join(' ') + '...'; - } - }) - }); - /*Add the filter research*/ jQuery( document ).ready(function () { document.onkeydown = function(e) { @@ -152,7 +143,7 @@ jQuery(document).ready(function() { var searchInactive = 0; var searchOther = 0; - $(".pluginMiniBox").each(function() { + $(".pluginBox").each(function() { if (text == "") { jQuery(".nbPluginsSearch").hide(); if ($("#seeAll").is(":checked")) { @@ -185,8 +176,8 @@ jQuery(document).ready(function() { nb_plugin.other = searchOther; } else { + let name = jQuery(this).find(".pluginName").text().toLowerCase(); jQuery(".nbPluginsSearch").show(); - let name = jQuery(this).find(".pluginMiniBoxNameCell").text().toLowerCase(); let description = jQuery(this).find(".pluginDesc").text().toLowerCase(); if (name.search(text) != -1 || description.search(text) != -1){ searchNumber++; @@ -249,7 +240,7 @@ jQuery(document).ready(function() { $(document).mouseup(function (e) { e.stopPropagation(); - $(".pluginMiniBox").each(function() { + $(".pluginBox").each(function() { if ($(this).find(".showOptions").has(e.target).length === 0) { $(this).find(".PluginOptionsBlock").hide(); } @@ -257,11 +248,39 @@ $(document).mouseup(function (e) { }); function actualizeFilter() { - $("label[for='seeAll'] .filter-badge").html(nb_plugin.all); $("label[for='seeActive'] .filter-badge").html(nb_plugin.active); $("label[for='seeInactive'] .filter-badge").html(nb_plugin.inactive); $("label[for='seeOther'] .filter-badge").html(nb_plugin.other); + //console.log(nb_plugin) + $(".filterLabel").show(); + $(".pluginMiniBox").each(function () { + if (nb_plugin.active == 0) { + $("label[for='seeActive']").hide(); + if ($("#seeActive").is(":checked")) { + $("#seeAll").trigger("click") + } + } + if (nb_plugin.inactive == 0) { + $("label[for='seeInactive']").hide(); + if ($("#seeInactive").is(":checked")) { + $("#seeAll").trigger("click") + } + } + if (nb_plugin.other == 0) { + $("label[for='seeOther']").hide(); + if ($("#seeOther").is(":checked")) { + $("#seeAll").trigger("click") + } + } + }) +} + +jQuery(".pluginBox").each(function(index){ + + $("label[for='seeActive'] .filter-badge").html(nb_plugin.active); + $("label[for='seeInactive'] .filter-badge").html(nb_plugin.inactive); + $("label[for='seeOther'] .filter-badge").html(nb_plugin.other); //console.log(nb_plugin) @@ -347,7 +366,7 @@ jQuery(".pluginMiniBox").each(function(index){ {assign var='version' value=$plugin.VERSION} {/if} -
+
-
+
{$plugin.NAME}
@@ -530,7 +549,7 @@ jQuery(".pluginMiniBox").each(function(index){ display: flex; } -.pluginMiniBox.active .pluginActionsSmallIcons a span { +.pluginBox.active .pluginActionsSmallIcons a span { display: flex; align-items: center; justify-content: center; @@ -539,7 +558,7 @@ jQuery(".pluginMiniBox").each(function(index){ border-radius: 5px; } -.pluginMiniBox.active .pluginActionsSmallIcons a span:hover { +.pluginBox.active .pluginActionsSmallIcons a span:hover { display: flex; align-items: center; justify-content: center; @@ -548,7 +567,7 @@ jQuery(".pluginMiniBox").each(function(index){ border-radius: 5px; } -.pluginMiniBox.inactive .pluginActionsSmallIcons a span { +.pluginBox.inactive .pluginActionsSmallIcons a span { display: flex; align-items: center; justify-content: center; @@ -562,7 +581,7 @@ jQuery(".pluginMiniBox").each(function(index){ text-decoration: none; } -.pluginMiniBox { +.pluginBox { transition: 0.5s; position: relative; } @@ -669,26 +688,26 @@ jQuery(".pluginMiniBox").each(function(index){ background: transparent; } -.pluginContainer.line .pluginMiniBox { +.pluginContainer.line .pluginBox { width: 100%; height: 50px; margin: 0 0 10px 0; } -.pluginContainer.line .pluginMiniBox .pluginContent{ +.pluginContainer.line .pluginBox .pluginContent{ display: flex; flex-direction: row; align-items: center; width: calc(100% - 35px); } -.pluginContainer.line .pluginMiniBox .pluginActions{ +.pluginContainer.line .pluginBox .pluginActions{ width: auto; margin: 0 25px 0 auto; } -.pluginContainer.line .pluginMiniBox .PluginOptionsBlock{ +.pluginContainer.line .pluginBox .PluginOptionsBlock{ display:none; position:absolute; right: 30px; @@ -697,7 +716,7 @@ jQuery(".pluginMiniBox").each(function(index){ transform: translateY(calc(50% - 30px)); } -.pluginContainer.line .pluginMiniBox .dropdown::after { +.pluginContainer.line .pluginBox .dropdown::after { content: " "; position: absolute; bottom: 55%; @@ -710,15 +729,15 @@ jQuery(".pluginMiniBox").each(function(index){ } -.pluginContainer.line .pluginMiniBox .pluginActions a, -.pluginContainer.classic .pluginMiniBox .pluginActions a{ +.pluginContainer.line .pluginBox .pluginActions a, +.pluginContainer.classic .pluginBox .pluginActions a{ margin: 0; padding: 2px 10px; border-radius: 5px; color: #3c3c3c; } -.pluginContainer.line .pluginMiniBox .pluginDesc{ +.pluginContainer.line .pluginBox .pluginDesc{ margin: auto 10px auto 10px; display: block !important; align-items: center; @@ -740,7 +759,7 @@ jQuery(".pluginMiniBox").each(function(index){ flex-wrap: wrap; } -.pluginContainer.classic .pluginMiniBoxNameCell { +.pluginContainer.classic .pluginName { position: relative; margin-right: 10px; } @@ -750,7 +769,7 @@ jQuery(".pluginMiniBox").each(function(index){ top: 45px; } -.pluginContainer.classic .pluginMiniBox .pluginActions { +.pluginContainer.classic .pluginBox .pluginActions { position: absolute; top: 47px; right: 17px; @@ -769,13 +788,13 @@ jQuery(".pluginMiniBox").each(function(index){ flex-wrap: wrap; } -.pluginContainer.compact .pluginMiniBox { +.pluginContainer.compact .pluginBox { width: 350px; margin: 15px 15px 0 0; } -.pluginContainer.compact .pluginMiniBox .pluginContent { +.pluginContainer.compact .pluginBox .pluginContent { display: flex; flex-direction: row; diff --git a/admin/themes/default/template/plugins_new.tpl b/admin/themes/default/template/plugins_new.tpl index 1b7be30d7..a9d07f8b9 100644 --- a/admin/themes/default/template/plugins_new.tpl +++ b/admin/themes/default/template/plugins_new.tpl @@ -1,123 +1,213 @@ {combine_script id='jquery.sort' load='footer' path='themes/default/js/plugins/jquery.sort.js'} +{combine_script id='jquery.ui.slider' require='jquery.ui' load='header' path='themes/default/js/ui/minified/jquery.ui.slider.min.js'} +{combine_css path="themes/default/js/ui/theme/jquery.ui.slider.css"} + +{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'} +{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"} + {combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} {combine_script id='jquery.confirm' load='footer' require='jquery' path='themes/default/js/plugins/jquery-confirm.min.js'} +{combine_script id='pluginsNew' load='footer' require='jquery.ui.effect-blind,jquery.sort' path='admin/themes/default/js/plugins_new.js'} {combine_css path="themes/default/js/plugins/jquery-confirm.min.css"} -{footer_script require='jquery.ui.effect-blind,jquery.sort'} -const install_title = '{'Are you sure you want to install this plugin?'|@translate|@escape:'javascript'}'; -const confirm_msg = '{"Yes, I am sure"|@translate}'; -const cancel_msg = "{"No, I have changed my mind"|@translate}"; -let title = '{'Are you sure you want to install the plugin "%s"?'|@translate|@escape:'javascript'}'; -{literal} -var sortOrder = 'date'; -var sortPlugins = (function(a, b) { - if (sortOrder == 'downloads' || sortOrder == 'revision' || sortOrder == 'date') - return parseInt($(a).find('input[name="'+sortOrder+'"]').val()) - < parseInt($(b).find('input[name="'+sortOrder+'"]').val()) ? 1 : -1; - else - return $(a).find('input[name="'+sortOrder+'"]').val().toLowerCase() - > $(b).find('input[name="'+sortOrder+'"]').val().toLowerCase() ? 1 : -1; -}); +{combine_css path="admin/themes/default/css/components/general.css"} -jQuery(document).ready(function(){ - jQuery("td[id^='desc_']").click(function() { - id = this.id.split('_'); - nb_lines = jQuery("#bigdesc_"+id[1]).html().split('
').length; - - jQuery("#smalldesc_"+id[1]).toggle('blind', 1); - if (jQuery(this).hasClass('bigdesc')) { - jQuery("#bigdesc_"+id[1]).toggle('blind', 1); - } else { - jQuery("#bigdesc_"+id[1]).toggle('blind', 50 + (nb_lines * 30)); - } - jQuery(this).toggleClass('bigdesc'); - return false; - }); - - jQuery('select[name="selectOrder"]').change(function() { - sortOrder = this.value; - $('.pluginBox').sortElements(sortPlugins); - $.get("admin.php?plugins_new_order="+sortOrder); - }); - - jQuery('#filter').keyup(function(){ - var filter = $(this).val(); - if (filter.length>2) { - $('.pluginBox').hide(); - $('#availablePlugins .pluginBox input[name="name"]').each(function(){ - if ($(this).val().toUpperCase().indexOf(filter.toUpperCase()) != -1) { - $(this).parents('div').show(); - } - }); - } else { - $('.pluginBox').show(); - } - jQuery("#filter").focus(); - }); - $(".install-plugin-button").each(function() { - let plugin_name = $(this).closest(".pluginBox").find("input[name=\"name\"]").val(); - $(this).pwg_jconfirm_follow_href({ - alert_title: title.replace("%s", plugin_name), - alert_confirm: confirm_msg, - alert_cancel: cancel_msg - }); - }); -}); -{/literal}{/footer_script} +{footer_script} +const str_confirm_msg = '{"Yes, I am sure"|@translate}'; +const str_cancel_msg = "{"No, I have changed my mind"|@translate}"; +const str_install_title = '{'Are you sure you want to install the plugin "%s"?'|@translate|@escape:'javascript'}'; +const strs_certification = { + "-1" : '{'This plugin is incompatible with your version'|@translate}', + "0" : '{'This plugin have no update since 3 years ! It may be outdated'|@translate}', + "1" : '{'This plugin has no recent update'|@translate}', + "2" : '{'This plugin was updated less than 6 months ago'|@translate}', + "3" : '{'This plugin have been updated recently'|@translate}', +}; +const str_all = '{"All of them"|@translate}' +const str_x_month = '{"%d month"|@translate}'; +const str_x_months = '{"%d months"|@translate}'; +const str_x_year = '{"%d year"|@translate}'; +const str_x_years = '{"%d years"|@translate}'; +{/footer_script}
- - {'Filter'|@translate} - {'Sort order'|@translate} -{html_options name="selectOrder" options=$order_options selected=$order_selected} - +
+
+
+ + +
+ +
+ +
+ {html_options name="selectOrder" options=$order_options selected=$order_selected} +
+
+ +
{'Filters'|@translate}
+ +
+ + + +
+ +
+ +
+
+ {'Advanced filter'|@translate} + +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+

{'Plugins'|@translate}

{if not empty($plugins)}
-
- + +{assign var='color_tab' value=["icon-red", "icon-blue", "icon-yellow", "icon-purple", "icon-green"]} + {foreach from=$plugins item=plugin name=plugins_loop} -
- - - - - - - - -{if $plugin.BIG_DESC != $plugin.SMALL_DESC} - -{else} - -{/if} - - - - - -
{$plugin.EXT_NAME} - - {$plugin.SMALL_DESC}... - - - {$plugin.BIG_DESC|@nl2br}
- {'Install'|@translate} - | {'Download'|@translate} - - {'Downloads'|@translate}: {$plugin.DOWNLOADS} - {'Version'|@translate} {$plugin.VERSION} - | {'By %s'|@translate:$plugin.AUTHOR} - | {'Visit plugin site'|@translate} -
+
+
+
+ {if $plugin.SCREENSHOT == ''} + + {else} + + {/if} +
+
+
+
+ {$plugin.EXT_NAME} + +
+
{'By %s'|@translate:$plugin.AUTHOR}
+
+ +
+ {if !is_null($plugin.RATING)} +
+
+ + + + + +
+ {$plugin.RATING} +
+ {/if} +
{$plugin.DOWNLOADS}
+
{'Version'|@translate} {$plugin.VERSION}
+ {'Website'|@translate} +
+ + +
+
+
+ {foreach from=$plugin.TAGS key=tag_id item=tag_label} + {$tag_label} + {/foreach} +
+
+ {$plugin.BIG_DESC|@nl2br} +
+
+
{/foreach} -
{else}

{'There is no other plugin available.'|@translate}

diff --git a/admin/themes/default/template/updates_ext.tpl b/admin/themes/default/template/updates_ext.tpl index a3bb32ca6..6dea5ca69 100644 --- a/admin/themes/default/template/updates_ext.tpl +++ b/admin/themes/default/template/updates_ext.tpl @@ -191,7 +191,7 @@ $("#update_all").click(function() {
-
+ {$plugin.EXT_NAME} @@ -233,7 +233,7 @@ $("#update_all").click(function() {
-
+ {$theme.EXT_NAME} @@ -275,7 +275,7 @@ $("#update_all").click(function() {
-
+ {$language.EXT_NAME} diff --git a/admin/themes/default/template/user_list.tpl b/admin/themes/default/template/user_list.tpl index 7f689fcd4..9a6bc316a 100644 --- a/admin/themes/default/template/user_list.tpl +++ b/admin/themes/default/template/user_list.tpl @@ -13,6 +13,8 @@ {combine_script id='jquery.tipTip' load='header' path='themes/default/js/plugins/jquery.tipTip.minified.js'} +{combine_css path="admin/themes/default/css/components/general.css"} + {combine_css path="admin/themes/default/fontello/css/animation.css" order=10} {* order 10 is required, see issue 1080 *} {footer_script} @@ -141,7 +143,7 @@ $(".icon-help-circled").tipTip({
-
+
{'Filters'|@translate}
@@ -152,47 +154,47 @@ $(".icon-help-circled").tipTip({
-
-
- {'Advanced filters'|@translate} +
+
+ {'Advanced filter'|@translate}
-
-
- -
+
+
+ +
-
- -
+
+ +
-
- -
+
+ +
-
+
- {'Registered'|@translate} + {'Registered'|@translate}
-
-
+
+
@@ -359,8 +361,8 @@ $(".icon-help-circled").tipTip({
{'Photos per page'|translate}
-
-
+
+
@@ -390,8 +392,8 @@ $(".icon-help-circled").tipTip({
{'Recent period'|translate}
-
-
+
+
@@ -635,8 +637,8 @@ $(".icon-help-circled").tipTip({
{'Photos per page'|translate} -
-
+
+
@@ -658,8 +660,8 @@ $(".icon-help-circled").tipTip({
{'Recent period'|translate} -
-
+
+
@@ -793,8 +795,8 @@ $(".icon-help-circled").tipTip({
{'Photos per page'|translate} -
-
+
+
@@ -816,8 +818,8 @@ $(".icon-help-circled").tipTip({
{'Recent period'|translate} -
-
+
+
@@ -1388,45 +1390,10 @@ $(".icon-help-circled").tipTip({ margin-left: 220px; } -.advanced-filter-select-container { - position: relative; - text-align:left; - width:100%; -} - .user-action-select-container { position:relative; } - -.select-bar-wrapper { - padding-left:10px; - margin-top: 20px; - margin-bottom: 30px; -} - -.select-bar-wrapper .select-bar-container { - height: 2px; -} - -.select-bar-wrapper .ui-slider-horizontal .ui-slider-handle{ - background-color:#ffaf58; - border: 1px solid #ffaf58; - border-radius:25px; - top: -.7em !important; - width: 1.4em; - height: 1.4em; -} - -.select-bar-wrapper .ui-slider-horizontal .ui-slider-range { - background-color: #ffaf58; -} - -.select-bar-wrapper .ui-slider-horizontal{ - border:none; - border-radius:25px; -} - .user-list-checkbox { margin-bottom:15px; } @@ -1894,24 +1861,12 @@ Advanced filter margin-left: 500px; } -#advanced_filter_button { - - width: 70px; - +.advanced-filter-btn { position: absolute; - z-index: 2; right: 650px; - - - cursor:pointer; - padding:10px; margin-right:10px; } -#advanced_filter_button.icon-filter::before { - transform: scale(1.2); -} - #search-user { position: absolute; z-index: 2; @@ -1929,7 +1884,7 @@ Advanced filter font-size:1em; } -.advanced-filters-header { +.advanced-filter-header { display:flex; justify-content:space-between; margin-bottom:10px; @@ -1939,18 +1894,7 @@ Advanced filter font-weight:bold; } -.advanced-filters { - display:flex; - padding:5px; -} - .advanced-filter-status, -.advanced-filter-level, -.advanced-filter-group { - margin-right: 30px; - min-width: 130px; -} - .advanced-filter-level { max-width: 160px; width: 16%; @@ -1977,7 +1921,7 @@ Advanced filter flex-direction: row; } -.select-bar-wrapper { +.slider-bar-wrapper { margin-top: 12px; } diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css index 130e0bba1..2501c1d0a 100644 --- a/admin/themes/default/theme.css +++ b/admin/themes/default/theme.css @@ -150,6 +150,34 @@ TABLE.plugins A { border: 0; } TABLE.plugins TR TD { padding: 4px 10px; } TABLE.languages TR TD { padding: 7px 20px; } +/* Slider */ +.slider-bar-wrapper { + padding-left:10px; + margin-top: 20px; + margin-bottom: 30px; +} + +.slider-bar-wrapper .slider-bar-container { + height: 2px; +} + +.slider-bar-wrapper .ui-slider-horizontal .ui-slider-handle{ + background-color:#ffaf58; + border: 1px solid #ffaf58; + border-radius:25px; + top: -.7em !important; + width: 1.4em; + height: 1.4em; +} + +.slider-bar-wrapper .ui-slider-horizontal .ui-slider-range { + background-color: #ffaf58; +} + +.slider-bar-wrapper .ui-slider-horizontal{ + border:none; + border-radius:25px; +} /* Category List */ .categoryContainer { @@ -1885,8 +1913,6 @@ h2:lang(en) { text-transform:capitalize; } #helpContent LI, #ftpPage LI {margin-top:10px;} #helpContent P.nextStepLink {text-align:center; font-weight:bold; margin-bottom:20px;} -#availablePlugins FIELDSET {border:none;} - /** * Informations box in administration */ @@ -1954,63 +1980,231 @@ h2:lang(en) { text-transform:capitalize; } #checkActions {text-align:left; margin:0 0 20px 0;} .ActionUserList #checkActions {margin: 20px 0 20px 0;} -.pluginBoxes { - border: none; - padding: 20px; - padding-top: 0; - min-height: 271px; - text-align:left; -} - -.pluginBoxesContainer { - position:relative; - display: flex; - flex-wrap: wrap; - justify-content: left; - -} - -.pluginBoxesTitle {font-size: 16px;} -.pluginBoxesTitle p {margin-right: 10px;} -.pluginBoxesTitle span {border-radius: 50%; margin-right: 5px; padding: 4px} - -.pluginBoxesTitle {display: flex;align-items: center} -.pluginFilter {justify-content: end;position: absolute;right: 160px; z-index: 2; transform: translateY(6px);} - -.pluginBoxesCount { - background-color: rgb(150, 150, 150); - color: white; - border-radius: 25px; - text-align: center; - padding: 2px 10px; - font-weight: bold; - font-size: 12px; -} - -.pluginBox { - margin-bottom:10px; - border-width:1px; - border-style:solid; - border-radius:5px; - -moz-border-radius:5px; - } -.pluginBox table {width:99%;} -.pluginBox td {text-align:left;} -.pluginBox td.pluginDesc img {vertical-align:middle;} -.pluginBoxNameCell {width:180px; vertical-align:top;} -.pluginBoxes .inactive, .pluginBoxes .uninstalled {} .emptyResearch {opacity: 0.3;text-align: center;left: 45%;font-weight: bold;font-size: 30px; position: absolute; display: none;} -.pluginMiniBox { +/* Plugin */ + +.sort { + display: flex; + flex-direction: column; + margin-bottom: 15px; +} + +.sort-actions { + display: flex; + align-items: center; + justify-content: end; + margin-bottom: 10px; +} + +.sort-actions > * { + margin-left: 12px; +} + +.sort-by { + display: flex; + flex-direction: column; + position: relative; +} + +.sort-by label { + color: #A4A4A4; + font-weight: bold; + font-size: 1.1em; + position: absolute; + top: 0; + left: 0; + transform: translateY(-100%); +} + +.sort-by select { + display: block; + padding: 10px 18px; + width: 290px; + +} + +.sort-by .select-container::before { + right: 15px; + bottom: 50%; + transform: translateY(50%); +} + +#search-plugin { + position: relative; +} + +#availablePlugins { + display: flex; + flex-wrap: wrap; + padding: 0 2em; +} + +.advanced-filter-new-plugin .advanced-filter-container { + display: grid !important; + grid-template-columns: repeat(5, 20%); +} + +.revision-date { + color: #f70; + margin-left: 5px; +} + +.pluginFilter {justify-content: end;position: absolute;right: 160px; z-index: 2; transform: translateY(6px);} + +.pluginBox { display:flex; - width:260px; - margin:15px; + margin: 0 15px 15px 0; border-top-right-radius:5px; border-bottom-right-radius:5px; - margin-left: 0; - /* box-shadow: 0px 0px 5px #acacac; */ box-shadow: 1px 1px 0px 1px #e0e0e0; } + +.pluginMiniBox { + width: 260px; +} + +.pluginBigBox { + max-width: calc(50% - 15px); + min-width: calc(50% - 15px); + flex-grow: 1; + height: calc(180px + 2 * 15px); + overflow: hidden; +} + +@media (max-width: 1700px) { + .pluginBigBox { + max-width: 100%; + min-width: 100%; + margin-right: 0!important; + } +} + +.pluginBigBox .pluginContent { + display: grid; + grid-template-columns: 180px 195px auto; +} + +.pluginImage { + position: relative; + overflow: hidden; +} + +.pluginImage span { + height: 180px; + width: 180px; + position:absolute; + top:50%; + left:50%; + transform: translate(-50%,-50%); + box-sizing: border-box; +} + +.pluginImage .noImage i { + font-size: 40px; + position:absolute; + top:50%; + left:50%; + transform: translate(-50%,-50%); +} + +.pluginBigBox .pluginInfo, .pluginBigBox .pluginMoreInfo { + margin-left: 15px; + height: 180px; + overflow: hidden; +} + +.pluginInfo { + display: flex; + flex-direction: column; + justify-content: space-between; + position: relative; +} + +.pluginRating { + display: flex; +} + +.rating-star-container { + margin-right: 5px; + display: flex; +} + +.rating-star-container span, .pluginRating .rating-star-container span i{ + width: 14px; + display: block; +} + +.rating-star-container span { + position: relative; +} + +.rating-star-container span i { + color: #ff7700; + position: absolute; + top: 0; + left: 0; +} + +.rating-star-container span .icon-star-half { + left: -3px; +} + +.certification { + width: 18px; + height: 24px; + background-size: contain; + background-position: top; + display: inline-block; + background-repeat: no-repeat; + vertical-align: middle; +} + +.advanced-filter-certification .advanced-filter-item-label span{ + margin-left: 5px; + height: 19px; +} + +.certification[data-certification="3"] { + background-image: url("images/certification/CertificationBlue.svg"); +} + +.certification[data-certification="2"] { + background-image: url("images/certification/CertificationOrange.svg"); +} + +.certification[data-certification="-1"] { + background-image: url("images/certification/CertificationWarning.svg"); +} + +.certification[data-certification="0"] { + background-image: url("images/certification/CertificationGhost.svg"); +} + +.certification[data-certification="1"] { + background-image: url("images/certification/Certification.svg"); + opacity: 0.3; +} + +.pluginInstall { + display: flex; + align-items: center; +} + +.buttonInstall { + margin-left: 0px !important; + margin-right: 5px; +} + +.pluginImage .screenshot { + background-image: url(path-to-file/img.jpg); + background-repeat:no-repeat; + background-position: center center; + background-size: cover; +} +.pluginBox table {width:99%;} +.pluginBox td {text-align:left;} + .PluginOptionsBlock a:hover { color: white ;} .pluginContent { width: 100%; @@ -2025,26 +2219,69 @@ h2:lang(en) { text-transform:capitalize; } /* border-radius: 5px; */ } -.pluginMiniBoxNameCell { +.pluginName { font-size: 14px; font-weight: bold; } -.pluginMiniBoxNameCellCompact { +.pluginName span { + overflow: hidden; +} + +.pluginNameCompact { width: min-content; max-width: 170px; white-space: nowrap; cursor: default; } +.pluginMoreInfo { + margin-left: 15px; + position: relative; +} + .pluginDesc { - margin-top: 43px; font-size: 12px; color: grey; line-height: 1.5em; - height: 3em; position: relative; overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + -ms-box-orient: vertical; +} + +.pluginMiniBox .pluginDesc { + margin-top: 43px; + height: 3em; + -webkit-line-clamp: 2; + -moz-line-clamp: 2; + -ms-line-clamp: 2; + line-clamp: 2; +} + +.pluginBigBox .pluginDesc { + height: auto; + -webkit-line-clamp: 8; + -moz-line-clamp: 8; + -ms-line-clamp: 8; + line-clamp: 8; +} + +.pluginTags { + display: flex; + flex-wrap: wrap; +} + +.pluginTags > span { + background-color: #e0e0e0; + border-radius: 10px; + padding: 3px 10px; + margin-right: 5px; + margin-bottom: 5px; + white-space: nowrap; } .pluginActions a { @@ -2081,7 +2318,7 @@ h2:lang(en) { text-transform:capitalize; } font-size: 16px; } -.plugin-inactive .pluginMiniBox{ +.plugin-inactive .pluginBox{ border-radius:5px; } @@ -2092,7 +2329,7 @@ h2:lang(en) { text-transform:capitalize; } background-color:#ff9b32; } -.pluginMiniBox .PluginOptionsIcons, +.pluginBox .PluginOptionsIcons, .themeBox .PluginOptionsIcons{ display:flex; position:absolute; @@ -2153,22 +2390,22 @@ h2:lang(en) { text-transform:capitalize; } color: #8c8c8c; } -.pluginContainer.line .pluginMiniBox:hover .pluginContent{ +.pluginContainer.line .pluginBox:hover .pluginContent{ transition: 0.4s; background: #ffd7ad; } -.pluginContainer.line .pluginMiniBox:hover.plugin-inactive .slider { +.pluginContainer.line .pluginBox:hover.plugin-inactive .slider { transition: 0.4s; background: #999999; } -.pluginContainer.line .pluginMiniBox:hover .pluginContent .pluginActions a{ +.pluginContainer.line .pluginBox:hover .pluginContent .pluginActions a{ /* color: #ffffff; */ opacity: 1; } -.pluginContainer.line .pluginMiniBox.inactive:hover .pluginContent .pluginActions a{ +.pluginContainer.line .pluginBox.inactive:hover .pluginContent .pluginActions a{ background: transparent; opacity: 0.7; } @@ -5055,8 +5292,7 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important; #action_delete_derivatives input[name="del_derivatives_type[]"], #action_generate_derivatives input[name="generate_derivatives_type[]"] {margin-right: 3px;} .actionButtons:first-child::after,#filter_prefilter::before,#filter_category::before,#filter_level::before, .permitActionListButton div::before, #action_level::after, .pictureLevels::before, -.user-action-select-container::before, .advanced-filter-select-container::before, -.user-property-select-container::before { +.user-property-select-container::before, .sort-by .select-container::before { content: '\e835'; font-size: 17px; position: absolute; font-family: "fontello"; color: #6E6E6E; pointer-events: none; } .permitActionListButton div::before {margin-left: 250px; margin-top: 11px;} @@ -5064,8 +5300,6 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important; .permitActionListButton div.hidden::after {display: none;} .user-action-select-container::before {top: 5px; right:10px} .user-property-select-container::before {margin-top: 10px; margin-left:270px;} -.advanced-filter-select-container::before {top: 5px; right:10px} -.advanced-filter-select {border: solid 1px #d4d4d4;} #filter_prefilter::before {margin-left: 257px; margin-top: 35px;} #filter_category .selectize-control.single .selectize-input::after {content: none;} #filter_category {width: 600px;} @@ -5073,7 +5307,7 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important; #filter_level::before {margin-top: 34px; margin-left: 260px;} #batchManagerGlobal #action_level::after {margin-top: -56px; margin-left: 254px;} #filter_search input {width: 300px; box-sizing: border-box; padding: 11px 18px;} -#applyFilter, #addFilter,#filterList select, #filter_tags .selectize-input.items.not-full.has-options, .pictureLevels select, #permitAction select{ +#applyFilter, #addFilter,#filterList select, #filter_tags .selectize-input.items.not-full.has-options, .pictureLevels select, #permitAction select, .sort-by select{ font-family: "Open Sans", "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; -webkit-appearance: none; font-weight: 700; @@ -5402,18 +5636,6 @@ color:#FF7B00; background: #DDDDDD; } -#advanced_filter_button, #advanced-filter-container { - background-color:#F3F3F3; -} - -.advanced-filter-label, .advanced-filter-title { - color:#3e3e3e; -} - -.advanced-filter-close { - color: #C5C5C5; -} - .user-action-select { background: white; } @@ -5458,7 +5680,7 @@ color:#FF7B00; background-color: #F3F3F3; } -.select-bar-wrapper .ui-slider-horizontal{ +.slider-bar-wrapper .ui-slider-horizontal{ background-color:#e3e3e3; } diff --git a/admin/themes/roma/theme.css b/admin/themes/roma/theme.css index abe56855f..c9ab4fb41 100644 --- a/admin/themes/roma/theme.css +++ b/admin/themes/roma/theme.css @@ -287,11 +287,10 @@ a.stat-box:hover { #helpContent, #pLoaderPage, #ftpPage, #ftpPage LEGEND {color:#aaa;} -.pluginBox, .pluginContent, .pluginMiniBox, .groups li, .groups .GroupContainer {background-color:#333;color:#999;border-right-color:#333; box-shadow: none;} -.pluginMiniBox {border-left: none;} -.pluginBoxNameCell, .pluginMiniBoxNameCell {color:#aaa;} -.pluginBox.incompatible, .pluginMiniBox.incompatible {border-color:#800 !important;} -.pluginBoxes .merged, .pluginBoxes .missing {background-color:#422;border:1px solid #800;} +.pluginBox, .pluginContent, .groups .GroupContainer {background-color:#333;color:#999;border-right-color:#333; box-shadow: none;border-left: none;} + +.pluginName {color:#aaa;} +.pluginBox.incompatible {border-color:#800 !important;} .pluginActionLevel1, .pluginActionLevel2 {color: #333;} .pluginActionLevel2 {background-color: #bbbbbb;} .pluginFilter {color: #c1c1c1;} @@ -884,7 +883,7 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important; } #checkActions a, .deleteDerivButtons a {background-color: #393939;} -#addFilter, #filterList select, .pictureLevels select, #permitAction select {background-color: #444444; color: #BFBFBF} +#addFilter, #filterList select, .pictureLevels select, #permitAction select, .sort-by select {background-color: #444444; color: #BFBFBF} #filter_category .selectize-input.items.full.has-options.has-items, #filter_tags .selectize-input.items.not-full.has-options, #filter_tags .selectize-input.items.not-full, #filter_search input, #action_associate .selectize-input.items.full.has-options.has-items, #action_dissociate .selectize-input.items.full.has-options.has-items { @@ -1218,52 +1217,52 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important; color: #bababa; } -.pluginMiniBox.plugin-active .pluginActionsSmallIcons a span { +.pluginBox.plugin-active .pluginActionsSmallIcons a span { background: #ffa744 !important; color: #3c3c3c !important; } -.pluginContainer.line .pluginMiniBox:hover .pluginContent{ +.pluginContainer.line .pluginBox:hover .pluginContent{ transition: 0.4s; background: #333333; } -.pluginContainer.line .pluginMiniBox:hover.plugin-inactive .slider { +.pluginContainer.line .pluginBox:hover.plugin-inactive .slider { transition: 0.4s; background: #777777; } -.pluginContainer .pluginMiniBox.plugin-inactive .slider { +.pluginContainer .pluginBox.plugin-inactive .slider { transition: 0.4s; background: #777777; } -.pluginContainer.line .pluginMiniBox:hover .pluginContent .pluginActions a{ +.pluginContainer.line .pluginBox:hover .pluginContent .pluginActions a{ /* color: #ffffff; */ opacity: 1; } -.pluginContainer.line .pluginMiniBox.inactive:hover .pluginContent .pluginActions a{ +.pluginContainer.line .pluginBox.inactive:hover .pluginContent .pluginActions a{ background: transparent; opacity: 1; color: #777777; } -.pluginContainer.line .pluginMiniBox:hover .pluginUnavailableAction { +.pluginContainer.line .pluginBox:hover .pluginUnavailableAction { opacity: 0.5 !important; } -.pluginContainer.line .pluginMiniBox.plugin-inactive:hover .pluginUnavailableAction { +.pluginContainer.line .pluginBox.plugin-inactive:hover .pluginUnavailableAction { color: #3c3c3c !important; background: #dddddddd !important; } -.pluginMiniBox.active .pluginActionsSmallIcons a span { +.pluginBox.active .pluginActionsSmallIcons a span { background: #ffa500; color: #3c3c3c; } -.pluginMiniBox.active .pluginActionsSmallIcons a span:hover { +.pluginBox.active .pluginActionsSmallIcons a span:hover { background: #ff7700; color: #111; } @@ -1290,6 +1289,14 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important; color: #ffd5dc } +.pluginTags > span { + background-color: #444; +} + +.pluginLink { + color: #999; +} + .addAlbum label{ color:#aaa; margin:-5px 0; @@ -1423,11 +1430,11 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important; background: transparent; } -#advanced_filter_button, #advanced-filter-container { +.advanced-filter-btn, .advanced-filter { background-color:#333; } -.advanced-filter-label, .advanced-filter-title, .advanced-filter-close { +.advanced-filter-item-label, .advanced-filter-title, .advanced-filter-close { color:#777; } @@ -1489,7 +1496,7 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important; background-color: #333; } -.select-bar-wrapper .ui-slider-horizontal{ +.slider-bar-wrapper .ui-slider-horizontal{ background-color:#666; } diff --git a/admin/themes_new.php b/admin/themes_new.php index 1f2a18abd..ad44e6cf6 100644 --- a/admin/themes_new.php +++ b/admin/themes_new.php @@ -103,8 +103,8 @@ if ($themes->get_server_themes(true)) // only new themes 'new_themes', array( 'name' => $theme['extension_name'], - 'thumbnail' => PEM_URL.'/upload/extension-'.$theme['extension_id'].'/thumbnail.jpg', - 'screenshot' => PEM_URL.'/upload/extension-'.$theme['extension_id'].'/screenshot.jpg', + 'thumbnail' => (key_exists('thumbnail_src', $theme)) ? $theme['thumbnail_src']:'', + 'screenshot' => (key_exists('screenshot_url', $theme)) ? $theme['screenshot_url']:'', 'install_url' => $url_auto_install, ) );