Skip to content

Commit c1373a8

Browse files
committed
fix: Caption alignment on pictures
1 parent c0926aa commit c1373a8

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

website/app-templates/smarty/extension/SmartyGeokretyExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,6 @@ class="{if $isChart}elevation-profile{/if}"
697697
</div>
698698
699699
<figcaption>
700-
<p class="text-center picture-caption" title="{$caption}">{$caption}</p>
701700
{if $showItemLink && $picture}
702701
<p class="text-center">
703702
{if $picture->isType(Geokrety\PictureType::PICTURE_USER_AVATAR)}
@@ -708,6 +707,8 @@ class="{if $isChart}elevation-profile{/if}"
708707
{$picture->geokret|gklink nofilter}
709708
{/if}
710709
</p>
710+
{else}
711+
<p class="text-center picture-caption" title="{$caption}">{$caption}</p>
711712
{/if}
712713
</figcaption>
713714

website/public/app-ui/css/gallery.scss

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,24 @@ div.gallery {
118118

119119
/* caption */
120120
figcaption {
121-
border-top: 1px solid silver; background-color: #eee;
122-
padding: 6px 8px; text-align: center; min-height: 48px;
123-
display: flex; align-items: center; justify-content: center;
121+
border-top: 1px solid silver;
122+
background-color: #eee;
123+
padding: 6px 8px;
124+
min-height: 48px;
125+
display: flex;
126+
align-items: center;
127+
justify-content: center;
124128
}
129+
125130
figcaption > p {
126-
margin: 0; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; width: 100%;
131+
margin: 0;
132+
text-overflow: ellipsis;
133+
white-space: nowrap;
134+
overflow: hidden;
135+
width: 100%;
136+
text-align: left; /* or center - your choice */
137+
max-width: 100%;
138+
box-sizing: border-box;
127139
}
128140

129141
figure:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }

0 commit comments

Comments
 (0)