From 54320d4043ab74a04eafe92bbfcffc88c55dd222 Mon Sep 17 00:00:00 2001 From: MatthieuLP Date: Wed, 3 Mar 2021 13:28:54 +0100 Subject: [PATCH] fixes #1355 alternative view for plugin manager --- admin/themes/clear/theme.css | 1 + .../themes/default/js/plugins_installated.js | 75 +++++++ .../default/template/plugins_installed.tpl | 184 +++++++++++++++++- admin/themes/default/theme.css | 10 +- admin/themes/roma/theme.css | 5 +- 5 files changed, 269 insertions(+), 6 deletions(-) create mode 100644 admin/themes/default/js/plugins_installated.js diff --git a/admin/themes/clear/theme.css b/admin/themes/clear/theme.css index 03d08de42..1f0f78ac3 100644 --- a/admin/themes/clear/theme.css +++ b/admin/themes/clear/theme.css @@ -211,6 +211,7 @@ INPUT[type="text"].large { width: 317px; } #pwgHead A, #footer A {color:#ccc;} #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;} diff --git a/admin/themes/default/js/plugins_installated.js b/admin/themes/default/js/plugins_installated.js new file mode 100644 index 000000000..0d517ee1a --- /dev/null +++ b/admin/themes/default/js/plugins_installated.js @@ -0,0 +1,75 @@ +function setDisplayCompact() { + $(".pluginDesc").show(); + $(".pluginDescCompact").hide(); + $(".pluginActions").show(); + $(".pluginActionsSmallIcons").hide(); + + $(".PluginOptionsIcons a").removeClass("biggerIcon"); + $(".pluginActionsSmallIcons a").removeClass("biggerIcon"); + $(".pluginMiniBoxNameCell").removeClass("pluginMiniBoxNameCellCompact"); + + normalTitle(); +} + +function setDisplayTile() { + $(".pluginDesc").hide(); + $(".pluginDescCompact").show(); + $(".pluginActions").hide(); + $(".pluginActionsSmallIcons").show(); + + $(".PluginOptionsIcons a").addClass("biggerIcon"); + $(".pluginActionsSmallIcons a").addClass("biggerIcon"); + + $(".pluginMiniBoxNameCell").addClass("pluginMiniBoxNameCellCompact"); + + reduceTitle() +} + +function reduceTitle() { + var x = document.getElementsByClassName("pluginMiniBoxNameCell"); + var length = 20; + + for (const div of x) { + var text = div.innerHTML.trim() + if (text.length > length) { + var newText = text.substring(0, length); + newText = newText + "..."; + + div.innerHTML = newText; + div.title = text + } + } +} + +function normalTitle() { + var x = document.getElementsByClassName("pluginMiniBoxNameCell"); + + for (const div of x) { + div.innerHTML = div.dataset.title + } +} + +$(document).ready(function () { + + if (!$.cookie("pwg_plugin_manager_view")) { + $.cookie("pwg_plugin_manager_view", "tile"); + } + + if ($("#displayTile").is(":checked")) { + setDisplayTile(); + }; + + if ($("#displayCompact").is(":checked")) { + setDisplayCompact(); + }; + + $("#displayTile").change(function () { + setDisplayTile(); + $.cookie("pwg_plugin_manager_view", "tile"); + }) + + $("#displayCompact").change(function () { + setDisplayCompact(); + $.cookie("pwg_plugin_manager_view", "compact"); + }) +}) \ No newline at end of file diff --git a/admin/themes/default/template/plugins_installed.tpl b/admin/themes/default/template/plugins_installed.tpl index 436cd25bc..2aee119f5 100644 --- a/admin/themes/default/template/plugins_installed.tpl +++ b/admin/themes/default/template/plugins_installed.tpl @@ -1,5 +1,6 @@ {combine_script id='jquery.ajaxmanager' load='footer' require='jquery' path='themes/default/js/plugins/jquery.ajaxmanager.js' } {combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} +{combine_script id='jquery.cookie' path='themes/default/js/jquery.cookie.js' load='footer'} {footer_script require='jquery.ajaxmanager'} /* incompatible message */ @@ -225,6 +226,8 @@ jQuery(".pluginMiniBox").each(function(index){ {combine_css path="themes/default/js/plugins/jquery-confirm.min.css"} {combine_script id='tiptip' load='header' path='themes/default/js/plugins/jquery.tipTip.minified.js'} +{combine_script id='pluginInstallated' load='footer' path='admin/themes/default/js/plugins_installated.js'} +

{'Plugins'|@translate}

@@ -240,6 +243,10 @@ jQuery(".pluginMiniBox").each(function(index){ +
+ +
+
{'No plugins found'|@translate}
{foreach from=$plugins item=plugin name=plugins_loop} @@ -295,20 +302,49 @@ jQuery(".pluginMiniBox").each(function(index){
{if $plugin.STATE == 'active' || $plugin.STATE == 'inactive'} - + {/if}
+ +
+ {if $plugin.STATE == 'active'} + {if $plugin.SETTINGS_URL != ''} +
+ +
+ {else} +
+ +
+ {/if} + {elseif $plugin.STATE == 'inactive'} +
+ +
+ {elseif $plugin.STATE == 'missing'} +
+ +
+ {elseif $plugin.STATE == 'merged'} +
+ +
+ {/if} +
-
+
{$plugin.NAME}
@@ -348,3 +384,143 @@ jQuery(".pluginMiniBox").each(function(index){
{/if} + + + \ No newline at end of file diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css index 95e0baa5e..0d36781fd 100644 --- a/admin/themes/default/theme.css +++ b/admin/themes/default/theme.css @@ -1949,7 +1949,7 @@ h2:lang(en) { text-transform:capitalize; } .pluginBoxesTitle span {border-radius: 50%; margin-right: 5px; padding: 4px} .pluginBoxesTitle {display: flex;align-items: center} -.pluginFilter {justify-content: end;position: absolute;right: 20px; z-index: 2; transform: translateY(6px);} +.pluginFilter {justify-content: end;position: absolute;right: 130px; z-index: 2; transform: translateY(6px);} .pluginBoxesCount { background-color: rgb(150, 150, 150); @@ -2001,6 +2001,13 @@ h2:lang(en) { text-transform:capitalize; } font-weight: bold; } +.pluginMiniBoxNameCellCompact { + width: min-content; + max-width: 170px; + white-space: nowrap; + cursor: default; +} + .pluginDesc { margin-top: 5px; font-size: 12px; @@ -2036,6 +2043,7 @@ h2:lang(en) { text-transform:capitalize; } .pluginActionLevel3 {/*padding-left: 10px; opacity: 0.9;*/padding:5px 0} .plugin-inactive .pluginContent{ border:none; + border-left: solid 5px #999999; /*border-radius:10px;*/ } diff --git a/admin/themes/roma/theme.css b/admin/themes/roma/theme.css index 05f1a149d..2f80458b0 100644 --- a/admin/themes/roma/theme.css +++ b/admin/themes/roma/theme.css @@ -277,7 +277,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-color:#333; box-shadow: none;} +.AlbumViewSelector {background: #555555;} +.AlbumViewSelector input:checked + label span {color: #999999;} +.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;}