Fix isMobile trigger and add more details on media

This commit is contained in:
2026-05-13 10:41:01 +02:00
parent daca0a8294
commit b88fb4ca9d
6 changed files with 29 additions and 15 deletions

View File

@@ -283,7 +283,8 @@ class Spot extends Main
$asMessage['subtype'] = 'message'; $asMessage['subtype'] = 'message';
} }
//Get Geo-positioned Medias //Get Geo-positioned Medias
//FIXME Make more efficient than requesting images twice from DB
$asMedias = $this->getMedias('taken_on', $asMediaIds); $asMedias = $this->getMedias('taken_on', $asMediaIds);
$asGeoMedias = $this->getMedias('posted_on', $asMediaIds, true); $asGeoMedias = $this->getMedias('posted_on', $asMediaIds, true);
foreach($asGeoMedias as &$asGeoMedia) { foreach($asGeoMedias as &$asGeoMedia) {
@@ -292,8 +293,6 @@ class Spot extends Main
$asGeoMedia['id'] = $iId; $asGeoMedia['id'] = $iId;
$asGeoMedia['type'] = 'media'; $asGeoMedia['type'] = 'media';
$asGeoMedia['lat_dms'] = self::decToDms($asGeoMedia['latitude'], 'lat');
$asGeoMedia['lon_dms'] = self::decToDms($asGeoMedia['longitude'], 'lon');
$asGeoMedia['medias'] = array_values(array_filter($asMedias, function($asMedia) use ($iId) { $asGeoMedia['medias'] = array_values(array_filter($asMedias, function($asMedia) use ($iId) {
return $asMedia['id_media'] == $iId; return $asMedia['id_media'] == $iId;
})); }));
@@ -428,6 +427,12 @@ class Spot extends Main
$this->addTimeStamp($asMedia, strtotime($asMedia[$sTimeRefField]), $asMedia['timezone']); $this->addTimeStamp($asMedia, strtotime($asMedia[$sTimeRefField]), $asMedia['timezone']);
$this->addTimeStamp($asMedia, strtotime($asMedia['taken_on']), $asMedia['timezone'], 'taken_on'); $this->addTimeStamp($asMedia, strtotime($asMedia['taken_on']), $asMedia['timezone'], 'taken_on');
$this->addTimeStamp($asMedia, strtotime($asMedia['posted_on']), $asMedia['timezone'], 'posted_on'); $this->addTimeStamp($asMedia, strtotime($asMedia['posted_on']), $asMedia['timezone'], 'posted_on');
if($asMedia['latitude'] != '' && $asMedia['longitude'] != '') {
$asMedia['lat_dms'] = self::decToDms($asMedia['latitude'], 'lat');
$asMedia['lon_dms'] = self::decToDms($asMedia['longitude'], 'lon');
}
unset($asMedia['taken_on']); unset($asMedia['taken_on']);
unset($asMedia['posted_on']); unset($asMedia['posted_on']);
} }

View File

@@ -336,6 +336,7 @@ export default {
this.popup.content this.popup.content
.provide('lang', this.lang) .provide('lang', this.lang)
.provide('consts', this.consts) .provide('consts', this.consts)
.provide('isMobile', this.isMobile)
.mount($Popup); .mount($Popup);
}, },
closePopup() { closePopup() {

View File

@@ -1,11 +1,13 @@
<script> <script>
import spotIcon from '@components/spotIcon'; import spotIcon from '@components/spotIcon';
import projectRelTime from '@components/projectRelTime'; import projectRelTime from '@components/projectRelTime';
import projectMapLink from '@components/projectMapLink';
export default { export default {
components: { components: {
spotIcon, spotIcon,
projectRelTime projectRelTime,
projectMapLink
}, },
props: { props: {
options: Object, options: Object,
@@ -17,7 +19,7 @@ export default {
title:'' title:''
} }
}, },
inject: ['lang'], inject: ['lang', 'isMobile'],
mounted() { mounted() {
this.title = this.title =
(this.$refs.comment?this.$refs.comment.outerHTML:'') + (this.$refs.comment?this.$refs.comment.outerHTML:'') +
@@ -54,12 +56,18 @@ export default {
/> />
<span class="drill-icon"><spotIcon :icon="'drill-'+options.subtype" /></span> <span class="drill-icon"><spotIcon :icon="'drill-'+options.subtype" /></span>
<div v-if="options.comment && type == 'post'" class="comment"> <div v-if="options.comment && type == 'post'" class="comment">
<p>{{ options.comment }}</p> <p>
<spotIcon icon="post" :text="options.comment" size="lg" />
</p>
<p v-if="!isMobile() && options.latitude && options.longitude">
<spotIcon icon="coords" margin="right" size="lg" />
<projectMapLink :options="options" />
</p>
</div> </div>
</a> </a>
<div style="display:none"> <div style="display:none">
<span v-if="options.comment" ref="comment" class="lb-caption-line comment desktop"> <span v-if="options.comment" ref="comment" class="lb-caption-line comment desktop">
<spotIcon :icon="'post'" width="fixed" size="lg" :text-classes="'comment-text'" :text="options.comment" /> <spotIcon icon="post" width="fixed" size="lg" text-classes="comment-text" :text="options.comment" />
</span> </span>
<span ref="postedon" class="lb-caption-line"> <span ref="postedon" class="lb-caption-line">
<projectRelTime :icon="'upload'" :localTime="options.posted_on_formatted_time_local" :siteTime="options.posted_on_formatted_time" :offset="options.posted_on_day_offset" /> <projectRelTime :icon="'upload'" :localTime="options.posted_on_formatted_time_local" :siteTime="options.posted_on_formatted_time" :offset="options.posted_on_day_offset" />

View File

@@ -15,7 +15,7 @@ export default {
options: Object, options: Object,
project: Object project: Object
}, },
inject: ['lang', 'consts'], inject: ['lang', 'consts', 'isMobile'],
computed: { computed: {
timeinfo() { timeinfo() {
return (this.options.type == 'media')? return (this.options.type == 'media')?
@@ -61,16 +61,16 @@ export default {
</div> </div>
</div> </div>
<div v-else> <div v-else>
<div class="section coordinates"> <div class="section time">
<projectRelTime :icon="timeinfo.icon" :localTime="localTime" :siteTime="timeinfo.site_time" :offset="timeinfo.offset" />
</div>
<div v-if="!isMobile()" class="section coordinates">
<spotIcon :icon="'coords'" width="fixed" size="lg" margin="right" /> <spotIcon :icon="'coords'" width="fixed" size="lg" margin="right" />
<projectMapLink :options="options" /> <projectMapLink :options="options" />
</div> </div>
<div v-if="options.altitude" class="section altitude"> <div v-if="options.altitude" class="section altitude">
<spotIcon :icon="'altitude'" width="fixed" size="lg" :text="options.altitude+'m'" /> <spotIcon :icon="'altitude'" width="fixed" size="lg" :text="options.altitude+'m'" />
</div> </div>
<div class="section time">
<projectRelTime :icon="timeinfo.icon" :localTime="localTime" :siteTime="timeinfo.site_time" :offset="timeinfo.offset" />
</div>
<div class="section weather" v-if="options.weather_icon && options.weather_icon!='unknown'" :title="options.weather_cond==''?'':lang.get('weather.'+options.weather_icon)"> <div class="section weather" v-if="options.weather_icon && options.weather_icon!='unknown'" :title="options.weather_cond==''?'':lang.get('weather.'+options.weather_icon)">
<spotIcon :icon="options.weather_icon" width="fixed" size="lg" :text="options.weather_temp+'°C'" /> <spotIcon :icon="options.weather_icon" width="fixed" size="lg" :text="options.weather_temp+'°C'" />
</div> </div>

View File

@@ -193,11 +193,11 @@
<img class="staticmap clickable" :title="lang.get('media.click_zoom')" :src="options.static_img_url" /> <img class="staticmap clickable" :title="lang.get('media.click_zoom')" :src="options.static_img_url" />
<spotIconStack :mainClasses="'message drill-icon'" :iconMain="drillMainIcon" iconSub="footprint" :icon-sub-transform="'rotate-270'" /> <spotIconStack :mainClasses="'message drill-icon'" :iconMain="drillMainIcon" iconSub="footprint" :icon-sub-transform="'rotate-270'" />
<div class="comment"> <div class="comment">
<p> <p v-if="!isMobile()">
<spotIcon :icon="'coords'" margin="right" size="lg" /> <spotIcon :icon="'coords'" margin="right" size="lg" />
<projectMapLink :options="options" /> <projectMapLink :options="options" />
</p> </p>
<p v-if="timeDiff"> <p>
<projectRelTime :icon="'time'" :localTime="absTimeLocal" :siteTime="options.formatted_time" :offset="options.day_offset" /> <projectRelTime :icon="'time'" :localTime="absTimeLocal" :siteTime="options.formatted_time" :offset="options.day_offset" />
</p> </p>
</div> </div>

View File

@@ -248,7 +248,7 @@
} }
.body { .body {
a { a.media-link {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
margin: 0; margin: 0;