mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Fix language-search fragment
- mots-clé and language where sharing the same q variable for the input value; they now have unique variables. The admin language-search-fragment was missing App::boot() which the tag-search fragment had. This caused the language suggestion dropdown to not return results in Firefox. Both fragments now follow the same bootstrap pattern. Rewrote language-search-fragment.php to use the same clean pattern as tag-search-fragment.php: ->searchLanguages(), simple exact match check, no predefined exclusion list. Both fragments now share identical structure. fix: exclude main languages (français, anglais, néerlandais) from language-search suggestions
This commit is contained in:
@@ -155,6 +155,19 @@
|
||||
+%%%%%%% diff from: somsyvxz 249f7943 "Bulk bar anti-shift, tags icons, AP no-wrap, credits reorder" (rebased revision)
|
||||
+\\\\\\\ to: xvqonoyt a3f280bc "Add sidebar TOC, simplify Données Secondaires section" (rebased revision)
|
||||
++ $linkName = $link['name'] ?? '';
|
||||
++ $linkExpiresVal = $link['expires_at'] ? date('Y-m-d\TH:i', strtotime($link['expires_at'])) : '';
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff from: xvqonoyt a3f280bc "Add sidebar TOC, simplify Données Secondaires section" (rebased revision)
|
||||
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ to: somsyvxz 249f7943 "Bulk bar anti-shift, tags icons, AP no-wrap, credits reorder" (rebased revision)
|
||||
- $linkName = $link['name'] ?? '';
|
||||
- $linkExpiresVal = $link['expires_at'] ? date('Y-m-d\TH:i', strtotime($link['expires_at'])) : '';
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff from: somsyvxz 14a3cd10 "Bulk bar anti-shift, tags icons, AP no-wrap, credits reorder" (rebase destination)
|
||||
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ to: moumuszm 68c0e60c "Fix language-search fragment" (rebased revision)
|
||||
$linkName = $link['name'] ?? '';
|
||||
$linkExpiresVal = $link['expires_at'] ? date('Y-m-d\TH:i', strtotime($link['expires_at'])) : '';
|
||||
$linkLockedYear = $link['locked_year'] ?? null;
|
||||
+%%%%%%% diff from: somsyvxz 249f7943 "Bulk bar anti-shift, tags icons, AP no-wrap, credits reorder" (rebased revision)
|
||||
+\\\\\\\ to: moumuszm 1e2ae09f "Fix language-search fragment" (rebased revision)
|
||||
++ $linkName = $link['name'] ?? '';
|
||||
++ $linkExpiresVal = $link['expires_at'] ? date('Y-m-d\TH:i', strtotime($link['expires_at'])) : '';
|
||||
?>
|
||||
<tr class="admin-table-row" onclick="event.stopPropagation(); window.open('/partage/<?= urlencode($link['slug']) ?>', '_blank')" style="cursor:pointer">
|
||||
|
||||
@@ -62,7 +62,7 @@ $langCount = count($selectedLanguages);
|
||||
<!-- Search input (hidden when max languages reached) -->
|
||||
<div class="tag-search-input-wrap"<?= $langCount >= $maxLanguages ? ' style="display:none"' : '' ?>>
|
||||
<input type="text"
|
||||
name="q"
|
||||
name="language_search_q"
|
||||
id="<?= htmlspecialchars($id) ?>-search"
|
||||
class="tag-search-input"
|
||||
placeholder="<?= htmlspecialchars($placeholder) ?>"
|
||||
@@ -188,8 +188,10 @@ $langCount = count($selectedLanguages);
|
||||
|
||||
// Click on suggestion
|
||||
dropdown.addEventListener('click', function(e) {
|
||||
console.log('[lang-search] dropdown click, target:', e.target.tagName, e.target.className);
|
||||
const btn = e.target.closest('.tag-search-item');
|
||||
if (!btn) return;
|
||||
if (!btn) { console.log('[lang-search] no .tag-search-item found in click path'); return; }
|
||||
console.log('[lang-search] found btn:', btn.getAttribute('data-tag-name'), btn.className);
|
||||
selectLang(btn);
|
||||
});
|
||||
|
||||
@@ -224,12 +226,21 @@ $langCount = count($selectedLanguages);
|
||||
search.addEventListener('blur', function() {
|
||||
setTimeout(function() {
|
||||
if (!dropdown.contains(document.activeElement)) {
|
||||
console.log('[lang-search] blur: hiding dropdown');
|
||||
dropdown.innerHTML = '';
|
||||
selectedIdx = -1;
|
||||
}
|
||||
}, 150);
|
||||
});
|
||||
|
||||
// Log HTMX responses
|
||||
document.body.addEventListener('htmx:afterSwap', function(e) {
|
||||
if (e.detail.target && e.detail.target.id === '<?= htmlspecialchars($id) ?>-suggestions') {
|
||||
console.log('[lang-search] htmx:afterSwap, target:', e.detail.target.id, 'html length:', e.detail.target.innerHTML.length);
|
||||
console.log('[lang-search] innerHTML:', e.detail.target.innerHTML);
|
||||
}
|
||||
});
|
||||
|
||||
function htmlEscape(str) {
|
||||
const el = document.createElement('span');
|
||||
el.textContent = str;
|
||||
|
||||
@@ -60,7 +60,7 @@ $tagCount = count($selectedTags);
|
||||
<!-- Search input (hidden when max tags reached) -->
|
||||
<div class="tag-search-input-wrap"<?= $tagCount >= $maxTags ? ' style="display:none"' : '' ?>>
|
||||
<input type="text"
|
||||
name="q"
|
||||
name="tag_search_q"
|
||||
id="<?= htmlspecialchars($id) ?>-search"
|
||||
class="tag-search-input"
|
||||
placeholder="<?= htmlspecialchars($placeholder) ?>"
|
||||
|
||||
Reference in New Issue
Block a user