From 77c1fdd138e448a1334acb048d19985b61b3cee6 Mon Sep 17 00:00:00 2001 From: Linty Date: Thu, 11 Sep 2025 16:54:52 +0200 Subject: [PATCH] fixes #2225 redesign quick search help popin --- admin/include/batch_manager_filters.inc.php | 2 + admin/themes/default/js/batchManagerFilter.js | 8 + .../default/template/batch_manager_global.tpl | 2 - .../include/batch_manager_filter.inc.tpl | 23 +- admin/themes/default/theme.css | 38 ++- admin/themes/roma/theme.css | 5 + language/en_UK/help_quick_search.lang.php | 58 ++++ language/fr_FR/help_quick_search.lang.php | 58 ++++ themes/default/css/help/quick_search.css | 71 ++++ themes/default/template/help/quick_search.tpl | 306 ++++++++++++++++++ 10 files changed, 567 insertions(+), 4 deletions(-) create mode 100644 language/en_UK/help_quick_search.lang.php create mode 100644 language/fr_FR/help_quick_search.lang.php create mode 100644 themes/default/css/help/quick_search.css create mode 100644 themes/default/template/help/quick_search.tpl diff --git a/admin/include/batch_manager_filters.inc.php b/admin/include/batch_manager_filters.inc.php index 4473576bc..1481ffc81 100644 --- a/admin/include/batch_manager_filters.inc.php +++ b/admin/include/batch_manager_filters.inc.php @@ -137,3 +137,5 @@ SELECT } $template->assign('associated_categories', $associated_categories); + +load_language('help_quick_search.lang'); \ No newline at end of file diff --git a/admin/themes/default/js/batchManagerFilter.js b/admin/themes/default/js/batchManagerFilter.js index 594cf3d4f..8e2bbf6ec 100644 --- a/admin/themes/default/js/batchManagerFilter.js +++ b/admin/themes/default/js/batchManagerFilter.js @@ -129,5 +129,13 @@ $(document).ready(function () { } } }); + + $('.help-popin-search').on('click', function() { + $('#modalQuickSearch').fadeIn(); + }); + + $('#closeModalQuickSearch').on('click', function() { + $('#modalQuickSearch').fadeOut(); + }); }) diff --git a/admin/themes/default/template/batch_manager_global.tpl b/admin/themes/default/template/batch_manager_global.tpl index c24db8242..94d1bec7d 100644 --- a/admin/themes/default/template/batch_manager_global.tpl +++ b/admin/themes/default/template/batch_manager_global.tpl @@ -73,8 +73,6 @@ const str_add_alb_associate = "{"Add Album"|@translate}"; const str_select_alb_associate = "{"Select an album"|@translate}"; $(document).ready(function() { - jQuery('.help-popin-search').colorbox({ width:"600px" }); - function checkPermitAction() { var nbSelected = 0; if ($("input[name=setSelected]").is(':checked')) { diff --git a/admin/themes/default/template/include/batch_manager_filter.inc.tpl b/admin/themes/default/template/include/batch_manager_filter.inc.tpl index e9311bd50..65e3892fd 100644 --- a/admin/themes/default/template/include/batch_manager_filter.inc.tpl +++ b/admin/themes/default/template/include/batch_manager_filter.inc.tpl @@ -209,7 +209,10 @@ let errorFilters = '';

{'Search'|@translate}

[x] - {'Search tips'|translate} + {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} {if (isset($no_search_results))}
{'No results for'|@translate} : @@ -265,4 +268,22 @@ let errorFilters = '';
+ +
+ +
{include file='include/album_selector.inc.tpl'} \ No newline at end of file diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css index 28a7f9ee8..a8b075766 100644 --- a/admin/themes/default/theme.css +++ b/admin/themes/default/theme.css @@ -4028,6 +4028,42 @@ LEGEND SPAN { opacity: 0.5; } +.help-popin-search { + cursor: pointer; + font-weight: normal !important; +} + +.help-popin-search:hover span, +.help-popin-search:hover .icon-help-circled::before { + color: #3C3C3C !important; +} + +#modalQuickSearch p { + margin: 0; +} + +#modalQuickSearch .modal-content { + max-height: 400px; + height: 100%; + width: 500px; + gap:20px; +} + +.quick-search-content { + height: 100%; + overflow-y: scroll; + display: flex; + flex-direction: column; + gap: 20px; +} + +.quick-search-header { + padding-top: 5px; + display: flex; + flex-direction: column; + align-items: center; +} + #order_filters a.removeFilter {font-weight:normal;} #order_filters span.property span.filter:first-child a.removeFilter {display:none;} /* can't delete the first field */ #order_filters span.filter {display:block;margin-left:20px;} @@ -8177,7 +8213,7 @@ color:#FF7B00; .bg-modal { display: none; position: fixed; - z-index: 100; + z-index: 999; left: 0; top: 0; width: 100%; diff --git a/admin/themes/roma/theme.css b/admin/themes/roma/theme.css index 9046e551b..5020d585e 100644 --- a/admin/themes/roma/theme.css +++ b/admin/themes/roma/theme.css @@ -1156,6 +1156,11 @@ li.plupload_delete a.remove-format:hover{color: #c0c0c0;} #batchManagerGlobal .ui-slider .ui-slider-range {background-color: #aaaaaa;} #batchManagerGlobal .ui-slider-range.ui-widget-header.ui-corner-all {border: 1px solid #ffaf58; background-color: #ffaf58;} +.help-popin-search:hover span, +.help-popin-search:hover .icon-help-circled::before { + color: #ededed !important; +} + .selected-associate-item { background-color: #333; box-shadow: 0px 2px #000000AA; diff --git a/language/en_UK/help_quick_search.lang.php b/language/en_UK/help_quick_search.lang.php new file mode 100644 index 000000000..f776baad1 --- /dev/null +++ b/language/en_UK/help_quick_search.lang.php @@ -0,0 +1,58 @@ + + {"Search using extended syntax"|translate} + +
+

+ {"The quick search engine allows you to use boolean operators to refine your search. By default, the search applies to all keywords. Searches are not case sensitive."|translate} +

+

{"Here is a list of actions you can perform:"|translate}

+
+ +

{"With keywords"|translate}

+ +
+ {* quoted keyword / phrase *} +
+
+
+

{"Exact search"|translate}

+
+
+

"george washington"

+
+
+
+

{"Use quotes to search for an exact keyword or phrase."|translate}

+
+
+ + {* OR inclusive *} +
+
+
+

{"OR inclusive"|translate}

+
+
+

john OR bill

+
+
+
+

{"Add an OR between words."|translate}

+
+
+ + {* exclude *} +
+
+
+

{"Exclude"|translate}

+
+
+

george washington NOT bush

+

-george

+
+
+
+ {"Add a dash (-) or NOT before a word to exclude from search. Note that NOT acts as a filtering operator so you cannot have a search containing only NOT operators. You cannot combine OR with NOT (john OR NOT bill is not valid)"|translate} +
+
+ + {* OR inclusive *} +
+
+
+

{"Grouping"|translate} ()

+
+
+

(mother OR father) AND (daugther OR son)

+
+
+
+
+ +

{"Others"|translate}

+
+
+
+
+

{"Supported numeric operators"|translate}

+
+
+

=100 {"equals 100"|translate}

+

>100 {"greater than 100"|translate}

+

<100 {"less than 100"|translate}

+

10..100 {"between 10 and 100 (inclusive)"|translate}

+

..100 {"up to 100 (inclusive)"|translate}

+

100.. {"from 100 and above"|translate}

+
+
+
+ {"These operators can be used with numeric fields such as"|translate} created:, posted:, width:, height:, size:, ratio:, hits:, score:, filesize:, id:. +
+
+ + {* tags: *} +
+
+
+

tag:

+

tags:

+
+
+

tag:(john OR bill)

+
+
+
+ {"Searches only in tag names without looking at photo titles or descriptions."|translate} +
+
+ + {* photos: *} +
+
+
+

photo:

+

photos:

+
+
+

photo:Tiger

+
+
+
+ {"Searches only for photos with the given words in title or description."|translate} +
+
+ + {* files: *} +
+
+
+

file:

+
+
+

file:DSC_

+

file:*.webp

+
+
+
+ {"Searches by file name."|translate} +
+
+ + {* author: *} +
+
+
+

author:

+
+
+

author:John

+
+
+
+ {"Searches by author."|translate} +
+
+ + {* created: taken: shot: *} +
+
+
+

created:

+

taken:

+

shot:

+
+
+

taken:2003 {"photos taken in 2003"|translate}

+

taken:20035, taken:2003-5, taken:2003-05 {"photos from may 2003"|translate}

+

taken:2003..2008 {"photos from 2003 to 2008"|translate}

+

taken:>2008, taken:2008*, taken:2008.. {"photos after Jan 1st 2008"|translate}

+
+
+
+ {"Searches photos by taken date."|translate} +
+
+ + {* posted: *} +
+
+
+

posted:

+
+
+

posted:2003 {"photos posted in 2003"|translate}

+
+
+
+ {"Searches photos by posted date."|translate} {"Same principle as for"|translate} created:. +
+
+ + {* width: height: *} +
+
+
+

width:

+

height:

+
+
+

width:>500 {"return photos wider than 500px"|translate}

+

height:<700 {"return photos less than 700px high"|translate}

+
+
+
+ {"Searches photos with a given width or height."|translate} +
+
+ + {* size: *} +
+
+
+

size:

+
+
+

size:5m {"returns photos of 5 megapixels"|translate}

+

size:>12m {"returns photos of 12 megapixels or more"|translate}

+
+
+
+ {"Searches photos by size in pixels."|translate} +
+
+ + {* ratio: *} +
+
+
+

ratio:

+
+
+

ratio:3/4 OR ratio:4/3 + {"finds photos from compact cameras in portrait or landscape modes"|translate}

+

ratio:>16/9 {"finds panoramas"|translate}

+
+
+
+ {"Searches photos by width/height ratio."|translate} +
+
+ + {* hits: *} +
+
+
+

hits:

+
+
+

hits:>1000 {"return photos with at least 1,000 views"|translate}

+
+
+
+

{"Searches for photos by number of views."|translate}

+
+
+ + {* score: rating:*} +
+
+
+

score:

+

rating:

+
+
+

score:* {"will give you all photos with at least one note."|translate}

+

score: {"will give you photos without notes."|translate}

+
+
+
+

{"Searches photos by rating."|translate}

+
+
+ + {* filesize: *} +
+
+
+

filesize:

+
+
+

filesize:1m..10m {"finds files between 1MB and 10MB."|translate}

+
+
+
+ {"Searches photos by file size."|translate} +
+
+ + {* id: *} +
+
+
+

id:

+
+
+

id:123..126 + {"finds photo 123 to 126 (it may find between 0 and 4 photos, because photos can be deleted)"|translate}

+
+
+
+ {"Searches photos by its numeric identifier in Piwigo."|translate} +
+
+
\ No newline at end of file