From da39ca658912ee584a3055037956b84ba2d8f9a2 Mon Sep 17 00:00:00 2001 From: Franzz Date: Wed, 14 Jan 2026 23:00:33 +0100 Subject: [PATCH] Fix popup medias --- build/webpack.common.js | 4 +++- languages/en.lang | 1 + languages/es.lang | 1 + languages/fr.lang | 1 + lib/Spot.php | 4 +++- src/components/projectMediaLink.vue | 17 +++++++++-------- src/components/projectPopup.vue | 12 +++++------- src/components/projectPost.vue | 12 ++++++++---- src/components/projectRelTime.vue | 28 +++++++++++++++++++++------- src/components/spotIcon.vue | 6 ++++-- src/scripts/app.js | 2 -- src/scripts/spot.js | 5 ++--- src/styles/_common.scss | 2 +- src/styles/_page.project.feed.scss | 2 +- src/styles/_page.project.map.scss | 22 +++++++++++++++------- 15 files changed, 75 insertions(+), 44 deletions(-) diff --git a/build/webpack.common.js b/build/webpack.common.js index f1bf426..100b1a7 100644 --- a/build/webpack.common.js +++ b/build/webpack.common.js @@ -87,7 +87,9 @@ module.exports = { from: path.resolve(LIB, 'index.php'), to: 'index.php' }, - { from: 'src/images/footprint_mapbox.png', to: 'images' } + { from: 'src/images/footprint_mapbox.png', to: 'images' }, + { from: 'src/images/logo_black.png', to: 'images' }, + { from: 'src/images/spot-logo-only.svg', to: 'images' } ], }), new SymlinkWebpackPlugin([ diff --git a/languages/en.lang b/languages/en.lang index 8fa725c..1848a17 100644 --- a/languages/en.lang +++ b/languages/en.lang @@ -95,6 +95,7 @@ language = Language clearance = Clearance toolbox = Toolbox +unit_d = D unit_day = day unit_days = days unit_hour = h diff --git a/languages/es.lang b/languages/es.lang index bf0bd77..0d71fff 100644 --- a/languages/es.lang +++ b/languages/es.lang @@ -95,6 +95,7 @@ language = Idioma clearance = Nivel de autorización toolbox = Herramientas +unit_d = D unit_day = Día unit_days = Días unit_hour = h diff --git a/languages/fr.lang b/languages/fr.lang index 493cb46..9e8e492 100644 --- a/languages/fr.lang +++ b/languages/fr.lang @@ -95,6 +95,7 @@ language = Langue clearance = Niveau d'autorisation toolbox = Boite à outils +unit_d = J unit_day = jour unit_days = jours unit_hour = h diff --git a/lib/Spot.php b/lib/Spot.php index 6311d5b..86e85d1 100755 --- a/lib/Spot.php +++ b/lib/Spot.php @@ -401,8 +401,10 @@ class Spot extends Main $iTimeStampPostedOn = strtotime($asMedia['posted_on']); $asMedia['taken_on_formatted'] = $this->getTimeFormat($iTimeStampTakenOn); $asMedia['taken_on_formatted_local'] = $this->getTimeFormat($iTimeStampTakenOn, $asMedia['timezone']); + $asMedia['taken_on_formatted_day_offset'] = self::getTimeZoneDayOffset($iTimeStampTakenOn, $asMedia['timezone']); $asMedia['posted_on_formatted'] = $this->getTimeFormat($iTimeStampPostedOn); $asMedia['posted_on_formatted_local'] = $this->getTimeFormat($iTimeStampPostedOn, $asMedia['timezone']); + $asMedia['posted_on_formatted_day_offset'] = self::getTimeZoneDayOffset($iTimeStampPostedOn, $asMedia['timezone']); $asMedia['displayed_id'] = $asMedia[Db::getId(Media::MEDIA_TABLE)]; $this->addTimeStamp($asMedia, strtotime($asMedia[$sTimeRefField]), $asMedia['timezone']); @@ -842,7 +844,7 @@ class Spot extends Main $iLocalDate = (int) (new \DateTime('@'.$iTime))->setTimezone(new \DateTimeZone($sLocalTimeZone))->format('Ymd'); $iSiteDate = (int) (new \DateTime('@'.$iTime))->setTimezone(new \DateTimeZone($sSiteTimeZone ))->format('Ymd'); - return ($iLocalDate == $iSiteDate)?'0':(($iLocalDate > $iSiteDate)?'+1':'-1'); + return ($iLocalDate == $iSiteDate)?'0':(($iLocalDate < $iSiteDate)?'+1':'-1'); } public static function getTimeZoneFromDate($sDate) { diff --git a/src/components/projectMediaLink.vue b/src/components/projectMediaLink.vue index 9efcb69..3a52456 100644 --- a/src/components/projectMediaLink.vue +++ b/src/components/projectMediaLink.vue @@ -1,9 +1,11 @@ \ No newline at end of file diff --git a/src/components/spotIcon.vue b/src/components/spotIcon.vue index e2641cd..81713f3 100644 --- a/src/components/spotIcon.vue +++ b/src/components/spotIcon.vue @@ -2,9 +2,11 @@ export default { props: { icon: String, + title: String, text: String, margin: Boolean, - classes: String + classes: String, + textClasses: String }, computed: { classNames() { @@ -15,5 +17,5 @@ export default { \ No newline at end of file diff --git a/src/scripts/app.js b/src/scripts/app.js index d411088..e1c1ae9 100644 --- a/src/scripts/app.js +++ b/src/scripts/app.js @@ -11,8 +11,6 @@ window.copyTextToClipboard = common.copyTextToClipboard; window.getOuterWidth = common.getOuterWidth; import Css from './../styles/spot.scss'; -import LogoText from '../images/logo_black.png'; -import Logo from '../images/spot-logo-only.svg'; //Masks import Spot from './spot.js'; diff --git a/src/scripts/spot.js b/src/scripts/spot.js index 4694187..edc2d5d 100755 --- a/src/scripts/spot.js +++ b/src/scripts/spot.js @@ -115,9 +115,8 @@ export default class Spot { } } - lang(sKey, asParams) { - asParams = asParams || []; - if(typeof asParams != 'object') asParams = [asParams]; + lang(sKey, asParams = []) { + if(typeof asParams !== 'object') asParams = [asParams]; var sLang = ''; if(sKey in this.consts.lang) { diff --git a/src/styles/_common.scss b/src/styles/_common.scss index 6139ce2..9e188bd 100644 --- a/src/styles/_common.scss +++ b/src/styles/_common.scss @@ -73,7 +73,7 @@ } [title]:not(a):not(.clickable) { - cursor: inherit; + cursor: default; } .clickable { diff --git a/src/styles/_page.project.feed.scss b/src/styles/_page.project.feed.scss index 123af5e..ee341ac 100644 --- a/src/styles/_page.project.feed.scss +++ b/src/styles/_page.project.feed.scss @@ -174,7 +174,7 @@ padding: var.$elem-spacing; } - span { + .temperature { vertical-align: middle; padding: var.$elem-spacing; background: color.$message-bg; diff --git a/src/styles/_page.project.map.scss b/src/styles/_page.project.map.scss index 7b39e30..d8c3821 100644 --- a/src/styles/_page.project.map.scss +++ b/src/styles/_page.project.map.scss @@ -2,6 +2,8 @@ @use "var"; @use "color"; +$thumbnail-max-size: 60px; + #map { position: absolute; left: 0; @@ -9,8 +11,13 @@ bottom: 0; width: 100%; - /* Leaflet Popup */ + /* Popup */ + .maplibregl-popup { + max-width: 300px; + } + .maplibregl-popup-content { + padding: var.$block-spacing; h1 { font-size: 1.4em; @@ -20,7 +27,7 @@ .separator { border-top: 1px solid #CCC; - margin: var.$elem-spacing 0 var.$block-spacing 0; + margin: var.$elem-spacing 0; } /* Marker Popup */ @@ -44,11 +51,12 @@ .medias { line-height: 0; + display: grid; + gap: var.$elem-spacing; + grid-template-columns: repeat(auto-fill, minmax($thumbnail-max-size, 1fr)); + place-items: center; a { - display: inline-block; - - margin: var.$block-spacing var.$block-spacing 0 0; &:last-child { margin-right: 0; } @@ -73,8 +81,8 @@ img { width: auto; height: auto; - max-width: 200px; - max-height: 100px; + max-width: $thumbnail-max-size; + max-height: calc($thumbnail-max-size * 2/3); border-radius: var.$block-radius; image-orientation: from-image; transition: All 0.2s;