Compare commits

..

4 Commits

Author SHA1 Message Date
632efeeab5 1.21.3
All checks were successful
CI / Lint (push) Successful in 34s
CI / Test (push) Successful in 57s
2026-05-08 11:43:57 +02:00
deeea9961f Merge pull request 'Add photo actions, fix portrait photos using thumb URLs' (#54) from feature/photo_actions into master
All checks were successful
CI / Lint (push) Successful in 31s
CI / Test (push) Successful in 56s
Reviewed-on: #54
2026-05-05 09:49:25 +00:00
7a109c9ba5 Fix portrait photos using thumb for full size variant
All checks were successful
CI / Lint (pull_request) Successful in 32s
CI / Test (pull_request) Successful in 55s
Release Drafter / Update release notes draft (pull_request) Successful in 4s
2026-05-05 10:16:12 +02:00
10aae3c9b3 Add photo action for copying event ID 2026-05-05 09:56:12 +02:00
8 changed files with 77 additions and 29 deletions

View File

@@ -33,6 +33,14 @@ export default class PhotoCarousel extends Component {
return !this.canScrollRight; return !this.canScrollRight;
} }
get isGalleryMain() {
return this.args.variant === 'gallery-main';
}
get isGalleryThumbnails() {
return this.args.variant === 'gallery-thumbnails';
}
get variantClass() { get variantClass() {
return this.args.variant || 'inline'; return this.args.variant || 'inline';
} }
@@ -205,29 +213,47 @@ export default class PhotoCarousel extends Component {
/> />
{{/if}} {{/if}}
{{#if photo.isLandscape}} {{#if this.isGalleryMain}}
<picture> <img
{{#if photo.thumbUrl}} data-src={{photo.url}}
<source class="place-header-photo
media="(max-width: 768px)" {{if photo.isLandscape 'landscape' 'portrait'}}"
data-srcset={{photo.thumbUrl}} alt={{@name}}
/> {{fadeInImage photo.url}}
{{/if}} />
<img {{else if this.isGalleryThumbnails}}
data-src={{photo.url}}
class="place-header-photo landscape"
alt={{@name}}
{{fadeInImage photo.url}}
/>
</picture>
{{else}}
{{! Portrait uses thumb everywhere if available }}
<img <img
data-src={{if photo.thumbUrl photo.thumbUrl photo.url}} data-src={{if photo.thumbUrl photo.thumbUrl photo.url}}
class="place-header-photo portrait" class="place-header-photo
{{if photo.isLandscape 'landscape' 'portrait'}}"
alt={{@name}} alt={{@name}}
{{fadeInImage (if photo.thumbUrl photo.thumbUrl photo.url)}} {{fadeInImage (if photo.thumbUrl photo.thumbUrl photo.url)}}
/> />
{{else}}
{{#if photo.isLandscape}}
<picture>
{{#if photo.thumbUrl}}
<source
media="(max-width: 768px)"
data-srcset={{photo.thumbUrl}}
/>
{{/if}}
<img
data-src={{photo.url}}
class="place-header-photo landscape"
alt={{@name}}
{{fadeInImage photo.url}}
/>
</picture>
{{else}}
{{! Portrait uses thumb everywhere if available }}
<img
data-src={{if photo.thumbUrl photo.thumbUrl photo.url}}
class="place-header-photo portrait"
alt={{@name}}
{{fadeInImage (if photo.thumbUrl photo.thumbUrl photo.url)}}
/>
{{/if}}
{{/if}} {{/if}}
</div> </div>
{{/each}} {{/each}}

View File

@@ -1,12 +1,15 @@
import Component from '@glimmer/component'; import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking'; import { tracked } from '@glimmer/tracking';
import { inject as service } from '@ember/service';
import { action } from '@ember/object'; import { action } from '@ember/object';
import { on } from '@ember/modifier'; import { on } from '@ember/modifier';
import { fn } from '@ember/helper';
import Icon from '#components/icon'; import Icon from '#components/icon';
import PhotoCarousel from './photo-carousel'; import PhotoCarousel from './photo-carousel';
import DropdownMenu from '#components/dropdown-menu'; import DropdownMenu from '#components/dropdown-menu';
export default class PhotoGallery extends Component { export default class PhotoGallery extends Component {
@service toast;
@tracked currentPhoto = this.args.selectedPhoto || this.args.photos?.[0]; @tracked currentPhoto = this.args.selectedPhoto || this.args.photos?.[0];
@action @action
@@ -43,6 +46,20 @@ export default class PhotoGallery extends Component {
} }
} }
@action
async copyEventId(closeMenu) {
if (this.currentPhoto?.eventId) {
try {
await navigator.clipboard.writeText(this.currentPhoto.eventId);
this.toast.show('Event ID copied to clipboard');
} catch (err) {
console.error('Failed to copy event ID:', err);
this.toast.show('Failed to copy event ID');
}
}
closeMenu();
}
<template> <template>
<div <div
class="photo-gallery-overlay" class="photo-gallery-overlay"
@@ -53,12 +70,17 @@ export default class PhotoGallery extends Component {
{{! template-lint-disable no-invalid-interactive }} {{! template-lint-disable no-invalid-interactive }}
<div class="photo-gallery-content"> <div class="photo-gallery-content">
<div class="actions-btn-container"> <div class="actions-btn-container">
<DropdownMenu @iconSize={{24}} @triggerIcon="more-horizontal" @iconColor="white" as |closeMenu|> <DropdownMenu
@iconSize={{24}}
@triggerIcon="more-horizontal"
@iconColor="white"
as |closeMenu|
>
<button <button
class="dropdown-item" class="dropdown-item"
type="button" type="button"
{{on "click" closeMenu}} {{on "click" (fn this.copyEventId closeMenu)}}
>Copy Raw Event Data</button> >Copy Photo Event ID</button>
<button <button
class="dropdown-item" class="dropdown-item"
type="button" type="button"

View File

@@ -1,6 +1,6 @@
{ {
"name": "marco", "name": "marco",
"version": "1.21.2", "version": "1.21.3",
"private": true, "private": true,
"description": "Unhosted maps app", "description": "Unhosted maps app",
"repository": { "repository": {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -39,8 +39,8 @@
<meta name="msapplication-TileColor" content="#F6E9A6"> <meta name="msapplication-TileColor" content="#F6E9A6">
<meta name="msapplication-TileImage" content="/icons/icon-144.png"> <meta name="msapplication-TileImage" content="/icons/icon-144.png">
<script type="module" crossorigin src="/assets/main-CjxGWim8.js"></script> <script type="module" crossorigin src="/assets/main-C_1D7C3-.js"></script>
<link rel="stylesheet" crossorigin href="/assets/main-M5C-HUrg.css"> <link rel="stylesheet" crossorigin href="/assets/main-BmLeTC2Y.css">
</head> </head>
<body> <body>
</body> </body>