Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
feat: Add config option to toggle figure caption in gallery view
Browse files Browse the repository at this point in the history
  • Loading branch information
mhellmeier authored and andi34 committed Mar 17, 2022
1 parent cbd7cec commit db65c14
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
3 changes: 2 additions & 1 deletion config/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$config['ui']['skip_welcome'] = false;
$config['event']['enabled'] = true;
$config['event']['textLeft'] = 'We';
// possible event symbol values: 'fa-camera-retro', 'fa-birthday-cake', 'fa-gift', 'fa-tree', 'fa-snowflake-o', 'fa-heart-o',
// possible event symbol values: 'fa-camera-retro', 'fa-birthday-cake', 'fa-gift', 'fa-tree', 'fa-snowflake-o', 'fa-heart-o',
// 'fa-heart', 'fa-heartbeat', 'fa-apple', 'fa-anchor', 'fa-glass', 'fa-gears', 'fa-users'
$config['event']['symbol'] = 'fa-heart-o';
$config['event']['textRight'] = 'OpenSource';
Expand Down Expand Up @@ -137,6 +137,7 @@
$config['gallery']['allow_delete'] = true;
$config['gallery']['scrollbar'] = false;
$config['gallery']['bottom_bar'] = true;
$config['gallery']['figcaption'] = true;
$config['pswp']['clickToCloseNonZoomable'] = false;
$config['pswp']['closeOnScroll'] = false;
$config['pswp']['closeOnOutsideClick'] = false;
Expand Down
6 changes: 6 additions & 0 deletions lib/configsetup.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,12 @@
'name' => 'gallery[bottom_bar]',
'value' => $config['gallery']['bottom_bar'],
],
'gallery_figcaption' => [
'view' => 'expert',
'type' => 'checkbox',
'name' => 'gallery[figcaption]',
'value' => $config['gallery']['figcaption'],
],
'pswp_clickToCloseNonZoomable' => [
'view' => 'expert',
'type' => 'checkbox',
Expand Down
2 changes: 2 additions & 0 deletions resources/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"gallery:gallery_db_check_enabled": "Regelmäßig nach neuen Bildern in der Standalone-Galerie suchen",
"gallery:gallery_db_check_time": "Intervall, in dem die Datenbank auf neue Bilder überprüft wird (in Sekunden):",
"gallery:gallery_enabled": "Galerie aktivieren",
"gallery:gallery_figcaption": "Bildunterschrift aktivieren",
"gallery:gallery_newest_first": "Neueste Bilder zuerst anzeigen",
"gallery:gallery_pictureTime": "Millisekunden die ein Bild während der Diashow angezeigt wird",
"gallery:gallery_scrollbar": "Scrollbar in Galerie aktivieren",
Expand Down Expand Up @@ -269,6 +270,7 @@
"manual:gallery:gallery_db_check_enabled": "Wenn aktiviert, prüft Photobooth in der Standalone-Galerie kontinuierlich auf neue Bilder und lädt die Seite bei Inaktivität neu (Zeit der Inaktivität hängt von der Option \"Bildanzeige nach Aufnahme:\" ab).",
"manual:gallery:gallery_db_check_time": "Geben Sie das Intervall (in Sekunden) ein, in welchem die Datenbank auf neue Bilder überprüft wird.",
"manual:gallery:gallery_enabled": "Wenn diese Option aktiviert ist, kann der Benutzer vom Startbildschirm aus auf die Galerie zugreifen.",
"manual:gallery:gallery_figcaption": "Wenn diese Option aktiviert ist, wird unter jedem Bild in der Galerie eine Unterschrift angezeigt.",
"manual:gallery:gallery_newest_first": "Wenn diese Option aktiviert ist, werden die neuesten Bilder in der Galerie zuerst angezeigt.",
"manual:gallery:gallery_pictureTime": "Geben Sie in Millisekunden an, wie lange ein Bild während der Diashow in der Galerie angezeigt wird.",
"manual:gallery:gallery_scrollbar": "Wenn diese Option aktiviert ist, wird eine Bildlaufleiste in der Galerie angezeigt.",
Expand Down
2 changes: 2 additions & 0 deletions resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"gallery:gallery_db_check_enabled": "Continuously check for new pictures in standalone gallery",
"gallery:gallery_db_check_time": "Interval at which the database is checked for new images (in seconds):",
"gallery:gallery_enabled": "Show Gallery",
"gallery:gallery_figcaption": "Show figure caption",
"gallery:gallery_newest_first": "Show latest images first",
"gallery:gallery_pictureTime": "Milliseconds an image is displayed at slideshow",
"gallery:gallery_scrollbar": "Show scrollbar in Gallery",
Expand Down Expand Up @@ -269,6 +270,7 @@
"manual:gallery:gallery_db_check_enabled": "If enabled, Photobooth continuously checks for new pictures in standalone gallery and reloads the page on inactivity (time of inactivity depends on \"Show image after capture:\" option).",
"manual:gallery:gallery_db_check_time": "Add the interval (in seconds) the database get checked for new images.",
"manual:gallery:gallery_enabled": "If enabled, user can access the gallery from start screen.",
"manual:gallery:gallery_figcaption": "If enabled, a figure caption is shown in the gallery view.",
"manual:gallery:gallery_newest_first": "If enabled, latest images will be shown first inside the gallery.",
"manual:gallery:gallery_pictureTime": "Add a value which is used as milliseconds an image is displayed at slideshow inside the gallery.",
"manual:gallery:gallery_scrollbar": "If enabled, a scrollbar is visible in gallery.",
Expand Down
4 changes: 3 additions & 1 deletion slideshow/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
<div class="center">
<figure>
<img src="<?=$filename_photo?>" alt="<?=$image?>" />
<figcaption><?=$date?></figcaption>
<?php if ($config['gallery']['figcaption']): ?>
<figcaption><?=$date?></figcaption>
<?php endif; ?>
</figure>
</div>
<?php } ?>
Expand Down
6 changes: 4 additions & 2 deletions template/gallery.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@
data-med="<?=$filename_thumb?>" data-med-size="<?=$imageinfoThumb[0]?>x<?=$imageinfoThumb[1]?>">
<figure>
<img src="<?=$filename_thumb?>" alt="<?=$image?>" />
<figcaption><?=$date?></figcaption>
<?php if ($config['gallery']['figcaption']): ?>
<figcaption><?=$date?></figcaption>
<?php endif; ?>
</figure>
</a>
<?php } ?>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>

0 comments on commit db65c14

Please sign in to comment.