Optical rendering of file and image listings
Some checks failed
DokuWiki Default Tasks / all (push) Has been cancelled

This commit is contained in:
2026-01-06 14:34:05 +01:00
parent f8d5dafc62
commit f83248d605
8 changed files with 48 additions and 3 deletions

View File

@@ -13,3 +13,6 @@ $lang['lastmodified'] = 'Letzte Änderung';
$lang['openlocation'] = 'Ort öffnen'; $lang['openlocation'] = 'Ort öffnen';
$lang['error_nomatch'] = 'Keine Treffer'; $lang['error_nomatch'] = 'Keine Treffer';
$lang['error_outsidejail'] = 'Zugriff verweigert'; $lang['error_outsidejail'] = 'Zugriff verweigert';
$lang['empty_files'] = 'Keine Dateien';
$lang['empty_images'] = 'Keine Bilder';

View File

@@ -13,3 +13,6 @@ $lang['lastmodified'] = 'Last modified';
$lang['openlocation'] = 'Open Location'; $lang['openlocation'] = 'Open Location';
$lang['error_nomatch'] = 'No match'; $lang['error_nomatch'] = 'No match';
$lang['error_outsidejail'] = 'Access denied'; $lang['error_outsidejail'] = 'Access denied';
$lang['empty_files'] = 'No Files';
$lang['empty_images'] = 'No Images';

View File

@@ -12,3 +12,6 @@ $lang['lastmodified'] = 'Laatst gewijzigd';
$lang['openlocation'] = 'Locatie openen'; $lang['openlocation'] = 'Locatie openen';
$lang['error_nomatch'] = 'Niets gevonden'; $lang['error_nomatch'] = 'Niets gevonden';
$lang['error_outsidejail'] = 'Toegang geweigerd'; $lang['error_outsidejail'] = 'Toegang geweigerd';
$lang['empty_files'] = 'Geen bestanden';
$lang['empty_images'] = 'Geen afbeeldingen';

View File

@@ -29,3 +29,20 @@ div.filetools-plugin a.media.mediafile.mf_folder,
div.filetools-plugin a.mediafile.mf_folder { div.filetools-plugin a.mediafile.mf_folder {
background-image: url(../../images/fileicons/svg/folder.svg) !important; background-image: url(../../images/fileicons/svg/folder.svg) !important;
} }
/* Muted empty-state message when a listing has no results. */
div.filetools-plugin .luxtools-empty {
opacity: 0.65;
font-style: italic;
padding: 0.25em 0;
}
/* Image gallery spacing. */
div.filetools-gallery {
padding-bottom: 0.5em;
}
div.filetools-gallery a.media {
display: inline-block;
margin: 0 0.35em 0.35em 0;
}

View File

@@ -238,6 +238,25 @@ abstract class syntax_plugin_luxtools_abstract extends SyntaxPlugin
$renderer->cdata('[n/a: ' . $this->getLang($langKey) . ']'); $renderer->cdata('[n/a: ' . $this->getLang($langKey) . ']');
} }
/**
* Render a muted empty-state message (used when a listing has no results).
*
* @param \Doku_Renderer $renderer
* @param string $langKey
* @return void
*/
protected function renderEmptyState(\Doku_Renderer $renderer, string $langKey): void
{
$text = (string)$this->getLang($langKey);
if ($renderer instanceof \Doku_Renderer_xhtml) {
$renderer->doc .= '<div class="filetools-plugin"><div class="luxtools-empty">' . hsc($text) . '</div></div>';
return;
}
$renderer->cdata($text);
}
/** /**
* Separate a path into base directory and pattern. * Separate a path into base directory and pattern.
* *

View File

@@ -55,7 +55,7 @@ class syntax_plugin_luxtools_directory extends syntax_plugin_luxtools_abstract
); );
if ($items == []) { if ($items == []) {
$this->renderError($renderer, 'error_nomatch'); $this->renderEmptyState($renderer, 'empty_files');
return true; return true;
} }

View File

@@ -42,7 +42,7 @@ class syntax_plugin_luxtools_files extends syntax_plugin_luxtools_abstract
); );
if ($result == []) { if ($result == []) {
$this->renderError($renderer, 'error_nomatch'); $this->renderEmptyState($renderer, 'empty_files');
return true; return true;
} }

View File

@@ -58,7 +58,7 @@ class syntax_plugin_luxtools_images extends syntax_plugin_luxtools_abstract
$items = $this->filterImages($items); $items = $this->filterImages($items);
if ($items == []) { if ($items == []) {
$this->renderError($renderer, 'error_nomatch'); $this->renderEmptyState($renderer, 'empty_images');
return true; return true;
} }