mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
fixes #1523 Search plugin and status filter compatible + nb search results
This commit is contained in:
@@ -321,6 +321,7 @@ $(document).ready(function () {
|
||||
$("#seeAll").on("change", function () {
|
||||
console.log("All");
|
||||
$(".pluginMiniBox").show();
|
||||
$('.search-input').trigger("input");
|
||||
})
|
||||
|
||||
$("#seeActive").on("change", function () {
|
||||
@@ -331,6 +332,7 @@ $(document).ready(function () {
|
||||
$(this).hide();
|
||||
}
|
||||
})
|
||||
$('.search-input').trigger("input");
|
||||
})
|
||||
|
||||
$("#seeInactive").on("change", function () {
|
||||
@@ -341,6 +343,7 @@ $(document).ready(function () {
|
||||
$(this).hide();
|
||||
}
|
||||
})
|
||||
$('.search-input').trigger("input");
|
||||
})
|
||||
|
||||
$("#seeOther").on("change", function () {
|
||||
@@ -351,6 +354,7 @@ $(document).ready(function () {
|
||||
$(this).hide();
|
||||
}
|
||||
})
|
||||
$('.search-input').trigger("input");
|
||||
})
|
||||
|
||||
console.log(nb_plugin);
|
||||
|
||||
@@ -21,7 +21,7 @@ var nb_plugin = {
|
||||
'active' : {$count_types_plugins["active"]},
|
||||
'inactive' : {$count_types_plugins["inactive"]},
|
||||
'other' : {$count_types_plugins["missing"]} + {$count_types_plugins["merged"]},
|
||||
}
|
||||
};
|
||||
const are_you_sure_msg = '{'Are you sure?'|@translate|@escape:'javascript'}';
|
||||
const confirm_msg = '{"Yes, I am sure"|@translate}';
|
||||
const cancel_msg = "{"No, I have changed my mind"|@translate}";
|
||||
@@ -34,6 +34,9 @@ const plugin_deactivated_str = '{'Deactivated'|@translate}';
|
||||
const plugin_restored_str = '{'Restored'|@translate}';
|
||||
const plugin_action_error = '{'an error happened'|@translate}';
|
||||
const not_webmaster = '{'Webmaster status required'|@translate}';
|
||||
const nothing_found = '{'No plugins found'|@translate}';
|
||||
const x_plugins_found = '{'%s plugins found'|@translate}';
|
||||
const plugin_found = '{'%s plugin found'|@translate}';
|
||||
const isWebmaster = {$isWebmaster};
|
||||
{literal}
|
||||
var queuedManager = jQuery.manageAjax.create('queued', {
|
||||
@@ -146,39 +149,52 @@ jQuery(document).ready(function() {
|
||||
|
||||
$(".pluginMiniBox").each(function() {
|
||||
if (text == "") {
|
||||
jQuery(this).fadeIn();
|
||||
jQuery(".nbPluginsSearch").hide();
|
||||
if ($("#seeAll").is(":checked")) {
|
||||
jQuery(this).show();
|
||||
}
|
||||
if ($("#seeActive").is(":checked") && jQuery(this).hasClass("plugin-active")) {
|
||||
jQuery(this).show();
|
||||
}
|
||||
if ($("#seeInactive").is(":checked") && jQuery(this).hasClass("plugin-inactive")) {
|
||||
jQuery(this).show();
|
||||
}
|
||||
if ($("#seeOther").is(":checked") && (jQuery(this).hasClass("plugin-merged") || jQuery(this).hasClass("plugin-missing"))) {
|
||||
jQuery(this).show();
|
||||
}
|
||||
searchNumber++
|
||||
} else {
|
||||
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++;
|
||||
|
||||
if ($("#seeAll").is(":checked")) {
|
||||
jQuery(this).fadeIn();
|
||||
jQuery(this).show();
|
||||
}
|
||||
if ($("#seeActive").is(":checked") && jQuery(this).hasClass("plugin-active")) {
|
||||
jQuery(this).fadeIn();
|
||||
jQuery(this).show();
|
||||
}
|
||||
if ($("#seeInactive").is(":checked") && jQuery(this).hasClass("plugin-inactive")) {
|
||||
|
||||
jQuery(this).fadeIn();
|
||||
jQuery(this).show();
|
||||
}
|
||||
if ($("#seeOther").is(":checked") && (jQuery(this).hasClass("plugin-merged") || jQuery(this).hasClass("plugin-missing"))) {
|
||||
jQuery(this).fadeIn();
|
||||
jQuery(this).show();
|
||||
}
|
||||
|
||||
} else {
|
||||
jQuery(this).fadeOut();
|
||||
jQuery(this).hide();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
if (searchNumber == 0) {
|
||||
jQuery(".emptyResearch").fadeIn();
|
||||
} else {
|
||||
jQuery(".emptyResearch").fadeOut();
|
||||
}
|
||||
jQuery(".nbPluginsSearch").html(nothing_found);
|
||||
} else if (searchNumber == 1) {
|
||||
jQuery(".nbPluginsSearch").html(plugin_found.replace("%s", searchNumber));
|
||||
} else {
|
||||
jQuery(".nbPluginsSearch").html(x_plugins_found.replace("%s", searchNumber));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -226,6 +242,8 @@ jQuery(".pluginMiniBox").each(function(index){
|
||||
<input type="radio" name="p-filter" class="filter" id="seeAll" {if $count_types_plugins["active"] <= 0} checked {/if}><label for="seeAll">{'All'|@translate}<span class="filter-badge">X</span></label><input type="radio" name="p-filter" class="filter" id="seeActive" {if $count_types_plugins["active"] > 0} checked {/if}><label class="filterLabel" for="seeActive">{'Activated'|@translate}<span class="filter-badge">X</span></label><input type="radio" name="p-filter" class="filter" id="seeInactive"><label class="filterLabel" for="seeInactive">{'Deactivated'|@translate}<span class="filter-badge">X</span></label><input type="radio" name="p-filter" class="filter" id="seeOther"><label class="filterLabel" for="seeOther">{'Other'|@translate}<span class="filter-badge">X</span></label>
|
||||
</div>
|
||||
|
||||
<div class="nbPluginsSearch"></div>
|
||||
|
||||
<div class="pluginFilter">
|
||||
<span class="icon-search search-icon"></span>
|
||||
<span class="icon-cancel search-cancel"></span>
|
||||
@@ -236,8 +254,6 @@ jQuery(".pluginMiniBox").each(function(index){
|
||||
<input type="radio" name="layout" class="switchLayout" id="displayClassic" {if $smarty.cookies.pwg_plugin_manager_view == 'classic' || !$smarty.cookies.pwg_plugin_manager_view}checked{/if}/><label for="displayClassic"><span class="icon-pause firstIcon tiptip" title="{'Classic View'|translate}"></span></label><input type="radio" name="layout" class="switchLayout" id="displayLine" {if $smarty.cookies.pwg_plugin_manager_view == 'line'}checked{/if}/><label for="displayLine"><span class="icon-th-list tiptip" title="{'Line View'|translate}"></span></label><input type="radio" name="layout" class="switchLayout" id="displayCompact" {if $smarty.cookies.pwg_plugin_manager_view == 'compact'}checked{/if}/><label for="displayCompact"><span class="icon-th-large lastIcon tiptip" title="{'Compact View'|translate}"></span></label>
|
||||
</div>
|
||||
|
||||
<div class="emptyResearch"> {'No plugins found'|@translate} </div>
|
||||
|
||||
<div class="pluginContainer {if $smarty.cookies.pwg_plugin_manager_view == 'classic'} classic {elseif $smarty.cookies.pwg_plugin_manager_view == 'line'} line {elseif $smarty.cookies.pwg_plugin_manager_view == 'compact'} compact {else} {/if}">
|
||||
|
||||
{foreach from=$plugins item=plugin name=plugins_loop}
|
||||
@@ -700,4 +716,10 @@ jQuery(".pluginMiniBox").each(function(index){
|
||||
.pluginMiniBox.incompatible .pluginMiniBoxNameCell i {
|
||||
color:#c64444;
|
||||
}
|
||||
|
||||
.nbPluginsSearch {
|
||||
position: absolute;
|
||||
right: 415px;
|
||||
transform: translateY(18px);
|
||||
}
|
||||
</style>
|
||||
@@ -1246,3 +1246,5 @@ $lang['%s lines'] = "%s lines";
|
||||
$lang['%s line'] = "%s line";
|
||||
$lang['Locked albums are disabled for maintenance. Only administrators can view them in the gallery. Lock this album will also lock his Sub-albums'] = 'Locked albums are disabled for maintenance. Only administrators can view them in the gallery. Lock this album will also lock his Sub-albums';
|
||||
$lang['Webmaster status required'] = 'Webmaster status required';
|
||||
$lang['%s plugins found'] = '<b>%s</b> plugins found';
|
||||
$lang['%s plugin found'] = '<b>%s</b> plugin found';
|
||||
|
||||
@@ -1253,3 +1253,5 @@ $lang['%s lines'] = "%s lignes";
|
||||
$lang['%s line'] = "%s ligne";
|
||||
$lang['Locked albums are disabled for maintenance. Only administrators can view them in the gallery. Lock this album will also lock his Sub-albums'] = 'Les albums vérrouillés sont désactivé pour maintenance. Seul les administrateurs peuvent les voir dans la gallerie. Vérrouiller cet album vérouillera aussi ses sous-albums';
|
||||
$lang['Webmaster status required'] = 'Statut Webmaster nécéssaire';
|
||||
$lang['%s plugins found'] = '<b>%s</b> plugins trouvés';
|
||||
$lang['%s plugin found'] = '<b>%s</b> plugin trouvé';
|
||||
|
||||
Reference in New Issue
Block a user