diff --git a/.gitea/workflows/code-analysis.yml b/.gitea/workflows/code-analysis.yml index 3819b8c..cced0da 100644 --- a/.gitea/workflows/code-analysis.yml +++ b/.gitea/workflows/code-analysis.yml @@ -6,6 +6,7 @@ on: jobs: analyze: + if: github.event_name == 'push' && github.ref == 'refs/heads/dev' runs-on: ubuntu-latest steps: - name: Checkout @@ -118,9 +119,8 @@ jobs: ./osv-scanner --lockfile ./package-lock.json deploy-production: - needs: analyze runs-on: ubuntu-latest - if: success() && github.event_name == 'push' && github.ref == 'refs/heads/main' + if: github.event_name == 'push' && github.ref == 'refs/heads/main' steps: - name: Prepare SSH run: | diff --git a/android-app/PLAYSTORE_ASSETS.md b/android-app/PLAYSTORE_ASSETS.md index 6a51c39..fe12ed5 100644 --- a/android-app/PLAYSTORE_ASSETS.md +++ b/android-app/PLAYSTORE_ASSETS.md @@ -36,13 +36,12 @@ Ausgabe in: ## 3) Screenshots (anonymisiert) -### Grobe Anforderungen (Telefon) -- Mindestens 2 Screenshots -- PNG oder JPEG -- Seitenlaenge je Seite zwischen 320 px und 3840 px +### Zielgroessen fuer Store-Upload +- Telefon (Portrait): 1080 x 1920 +- Medium 7" Tablet (Portrait): 1200 x 1920 +- 10" Tablet (Portrait): 1600 x 2560 -Empfehlung fuer Android-Phone: -- 1080 x 1920 (Portrait) +Alle Dateien als PNG oder JPEG. ### Anonymisierung @@ -61,10 +60,33 @@ Beispiel: '68,118,520,72;70,706,560,98' ``` +### Zielprofile erzeugen (Telefon, 7", 10") + +Aus allen Dateien in `android-app/playstore-assets/anon` werden die drei Profile erzeugt: + +```bash +./scripts/playstore-screenshot-sizes.sh +``` + +Optional mit eigenen Ordnern: + +```bash +./scripts/playstore-screenshot-sizes.sh \ + --input-dir android-app/playstore-assets/anon \ + --output-dir android-app/playstore-assets/final +``` + +Output: +- android-app/playstore-assets/final/phone +- android-app/playstore-assets/final/tablet-7 +- android-app/playstore-assets/final/tablet-10 + ## 4) Upload in Play Console - Datenschutzerklaerung: URL eintragen - Konto-Loeschung: URL eintragen - App-Icon: playstore-icon-512.png - Feature Graphic: playstore-feature-graphic-1024x500.png -- Screenshots: anonymisierte PNG/JPEG hochladen +- Screenshots Telefon: Dateien aus `.../final/phone` +- Screenshots 7" Tablet: Dateien aus `.../final/tablet-7` +- Screenshots 10" Tablet: Dateien aus `.../final/tablet-10` diff --git a/android-app/playstore-assets/anon/Screenshot_20260530_000103.png b/android-app/playstore-assets/anon/Screenshot_20260530_000103.png new file mode 100644 index 0000000..75669a5 Binary files /dev/null and b/android-app/playstore-assets/anon/Screenshot_20260530_000103.png differ diff --git a/android-app/playstore-assets/anon/Screenshot_20260530_000133.png b/android-app/playstore-assets/anon/Screenshot_20260530_000133.png new file mode 100644 index 0000000..51abf51 Binary files /dev/null and b/android-app/playstore-assets/anon/Screenshot_20260530_000133.png differ diff --git a/android-app/playstore-assets/anon/Screenshot_20260530_000230.png b/android-app/playstore-assets/anon/Screenshot_20260530_000230.png new file mode 100644 index 0000000..8befe26 Binary files /dev/null and b/android-app/playstore-assets/anon/Screenshot_20260530_000230.png differ diff --git a/android-app/playstore-assets/anon/Screenshot_20260530_000301.png b/android-app/playstore-assets/anon/Screenshot_20260530_000301.png new file mode 100644 index 0000000..5695a7c Binary files /dev/null and b/android-app/playstore-assets/anon/Screenshot_20260530_000301.png differ diff --git a/android-app/playstore-assets/anon/Screenshot_20260530_000429.png b/android-app/playstore-assets/anon/Screenshot_20260530_000429.png new file mode 100644 index 0000000..62e4186 Binary files /dev/null and b/android-app/playstore-assets/anon/Screenshot_20260530_000429.png differ diff --git a/android-app/playstore-assets/final/phone/ChatGPT Image 30. Mai 2026, 00_27_40-1080x1920.png b/android-app/playstore-assets/final/phone/ChatGPT Image 30. Mai 2026, 00_27_40-1080x1920.png new file mode 100644 index 0000000..7b18136 Binary files /dev/null and b/android-app/playstore-assets/final/phone/ChatGPT Image 30. Mai 2026, 00_27_40-1080x1920.png differ diff --git a/android-app/playstore-assets/final/phone/Screenshot_20260530_002151-1080x1920.png b/android-app/playstore-assets/final/phone/Screenshot_20260530_002151-1080x1920.png new file mode 100644 index 0000000..b08dedb Binary files /dev/null and b/android-app/playstore-assets/final/phone/Screenshot_20260530_002151-1080x1920.png differ diff --git a/android-app/playstore-assets/final/phone/Screenshot_20260530_002305-1080x1920.png b/android-app/playstore-assets/final/phone/Screenshot_20260530_002305-1080x1920.png new file mode 100644 index 0000000..89c18f0 Binary files /dev/null and b/android-app/playstore-assets/final/phone/Screenshot_20260530_002305-1080x1920.png differ diff --git a/android-app/playstore-assets/final/tablet-10/ChatGPT Image 30. Mai 2026, 00_13_26-1600x2560.png b/android-app/playstore-assets/final/tablet-10/ChatGPT Image 30. Mai 2026, 00_13_26-1600x2560.png new file mode 100644 index 0000000..94b799f Binary files /dev/null and b/android-app/playstore-assets/final/tablet-10/ChatGPT Image 30. Mai 2026, 00_13_26-1600x2560.png differ diff --git a/android-app/playstore-assets/final/tablet-10/ChatGPT Image 30. Mai 2026, 00_15_36-1600x2560.png b/android-app/playstore-assets/final/tablet-10/ChatGPT Image 30. Mai 2026, 00_15_36-1600x2560.png new file mode 100644 index 0000000..34ff045 Binary files /dev/null and b/android-app/playstore-assets/final/tablet-10/ChatGPT Image 30. Mai 2026, 00_15_36-1600x2560.png differ diff --git a/android-app/playstore-assets/final/tablet-10/Screenshot_20260530_000103-1600x2560.png b/android-app/playstore-assets/final/tablet-10/Screenshot_20260530_000103-1600x2560.png new file mode 100644 index 0000000..b7fc4b9 Binary files /dev/null and b/android-app/playstore-assets/final/tablet-10/Screenshot_20260530_000103-1600x2560.png differ diff --git a/android-app/playstore-assets/final/tablet-10/Screenshot_20260530_000301-1600x2560.png b/android-app/playstore-assets/final/tablet-10/Screenshot_20260530_000301-1600x2560.png new file mode 100644 index 0000000..64eeb25 Binary files /dev/null and b/android-app/playstore-assets/final/tablet-10/Screenshot_20260530_000301-1600x2560.png differ diff --git a/android-app/playstore-assets/raw/ChatGPT Image 30. Mai 2026, 00_13_26.png b/android-app/playstore-assets/raw/ChatGPT Image 30. Mai 2026, 00_13_26.png new file mode 100644 index 0000000..c1ec8ed Binary files /dev/null and b/android-app/playstore-assets/raw/ChatGPT Image 30. Mai 2026, 00_13_26.png differ diff --git a/android-app/playstore-assets/raw/ChatGPT Image 30. Mai 2026, 00_15_36.png b/android-app/playstore-assets/raw/ChatGPT Image 30. Mai 2026, 00_15_36.png new file mode 100644 index 0000000..84938ed Binary files /dev/null and b/android-app/playstore-assets/raw/ChatGPT Image 30. Mai 2026, 00_15_36.png differ diff --git a/android-app/playstore-assets/raw/Screenshot_20260530_000103.png b/android-app/playstore-assets/raw/Screenshot_20260530_000103.png new file mode 100644 index 0000000..5238e43 Binary files /dev/null and b/android-app/playstore-assets/raw/Screenshot_20260530_000103.png differ diff --git a/android-app/playstore-assets/raw/Screenshot_20260530_000301.png b/android-app/playstore-assets/raw/Screenshot_20260530_000301.png new file mode 100644 index 0000000..4c5544d Binary files /dev/null and b/android-app/playstore-assets/raw/Screenshot_20260530_000301.png differ diff --git a/android-app/playstore-assets/raw/smartphone/ChatGPT Image 30. Mai 2026, 00_27_40.png b/android-app/playstore-assets/raw/smartphone/ChatGPT Image 30. Mai 2026, 00_27_40.png new file mode 100644 index 0000000..36373ce Binary files /dev/null and b/android-app/playstore-assets/raw/smartphone/ChatGPT Image 30. Mai 2026, 00_27_40.png differ diff --git a/android-app/playstore-assets/raw/smartphone/Screenshot_20260530_002151.png b/android-app/playstore-assets/raw/smartphone/Screenshot_20260530_002151.png new file mode 100644 index 0000000..8cd91b6 Binary files /dev/null and b/android-app/playstore-assets/raw/smartphone/Screenshot_20260530_002151.png differ diff --git a/android-app/playstore-assets/raw/smartphone/Screenshot_20260530_002305.png b/android-app/playstore-assets/raw/smartphone/Screenshot_20260530_002305.png new file mode 100644 index 0000000..82a7454 Binary files /dev/null and b/android-app/playstore-assets/raw/smartphone/Screenshot_20260530_002305.png differ diff --git a/components/Navigation.vue b/components/Navigation.vue index 38e2fb2..b45fd0a 100644 --- a/components/Navigation.vue +++ b/components/Navigation.vue @@ -814,7 +814,7 @@ Einstellungen { - try { - return useAuthStore() - } catch (e) { - // Fallback if Pinia is not yet initialized - return null - } -} - -// Reactive auth state from store (lazy) -const isLoggedIn = computed(() => { - const store = getAuthStore() - return store?.isLoggedIn ?? false -}) -const isAdmin = computed(() => { - const store = getAuthStore() - return store?.isAdmin ?? false -}) -const canAccessNewsletter = computed(() => { - const store = getAuthStore() - return store?.hasAnyRole('admin', 'vorstand', 'newsletter') ?? false -}) -const canAccessContactRequests = computed(() => { - const store = getAuthStore() - return store?.hasAnyRole('admin', 'vorstand', 'trainer') ?? false -}) +const isLoggedIn = computed(() => authStore.isLoggedIn) +const isAdmin = computed(() => authStore.isAdmin) +const canAccessNewsletter = computed(() => authStore.hasAnyRole('admin', 'vorstand', 'newsletter')) +const canAccessContactRequests = computed(() => authStore.hasAnyRole('admin', 'vorstand', 'trainer')) +const canManageUsers = computed(() => authStore.hasAnyRole('admin', 'vorstand')) // Automatisches Setzen des Submenus basierend auf der Route const currentSubmenu = computed(() => { @@ -982,10 +961,7 @@ const handleDocumentClick = (e) => { onMounted(() => { loadMannschaften() checkGalleryImages() - const store = getAuthStore() - if (store) { - store.checkAuth() - } + authStore.checkAuth() // Close CMS dropdown when clicking outside document.addEventListener('click', handleDocumentClick) diff --git a/package.json b/package.json index 76376fd..4f66e03 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "publish-spielplan": "node scripts/publish-imported-spielplan.js", "playstore:assets": "./scripts/playstore-assets.sh", "playstore:anonymize": "./scripts/anonymize-playstore-screenshot.sh", + "playstore:screenshots": "./scripts/playstore-screenshot-sizes.sh", "test:watch": "vitest watch", "lint": "eslint . --fix" }, diff --git a/scripts/anonymize-playstore-screenshot.sh b/scripts/anonymize-playstore-screenshot.sh index 1212258..3633fa1 100755 --- a/scripts/anonymize-playstore-screenshot.sh +++ b/scripts/anonymize-playstore-screenshot.sh @@ -24,7 +24,7 @@ IFS=';' read -r -a BOXES <<< "$RECTS" for box in "${BOXES[@]}"; do IFS=',' read -r x y w h <<< "$box" magick "$TMP" \ - \( -size "${w}x${h}" xc:black -alpha set -channel a -evaluate set 70% +channel \) \ + \( -size "${w}x${h}" xc:black -alpha off \) \ -geometry "+${x}+${y}" -composite "$TMP" done diff --git a/scripts/playstore-screenshot-sizes.mjs b/scripts/playstore-screenshot-sizes.mjs new file mode 100644 index 0000000..827a248 --- /dev/null +++ b/scripts/playstore-screenshot-sizes.mjs @@ -0,0 +1,82 @@ +#!/usr/bin/env node +import { readdir, mkdir } from 'node:fs/promises' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import sharp from 'sharp' + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) +const rootDir = path.resolve(__dirname, '..') + +const args = process.argv.slice(2) + +function readArg(flag, fallback = '') { + const idx = args.indexOf(flag) + if (idx === -1) return fallback + return args[idx + 1] || fallback +} + +const inputDirArg = readArg('--input-dir', 'android-app/playstore-assets/anon') +const outputDirArg = readArg('--output-dir', 'android-app/playstore-assets/final') +const inputDir = path.resolve(rootDir, inputDirArg) +const outputDir = path.resolve(rootDir, outputDirArg) + +const profiles = [ + { key: 'phone', width: 1080, height: 1920 }, + { key: 'tablet-7', width: 1200, height: 1920 }, + { key: 'tablet-10', width: 1600, height: 2560 }, +] + +function isImageFile(name) { + const lower = name.toLowerCase() + return lower.endsWith('.png') || lower.endsWith('.jpg') || lower.endsWith('.jpeg') +} + +async function processFile(fileName) { + const inputPath = path.join(inputDir, fileName) + const parsed = path.parse(fileName) + + for (const profile of profiles) { + const profileDir = path.join(outputDir, profile.key) + await mkdir(profileDir, { recursive: true }) + + const outputPath = path.join( + profileDir, + `${parsed.name}-${profile.width}x${profile.height}.png`, + ) + + // Use contain to preserve all UI content and add solid bars only if needed. + await sharp(inputPath) + .resize(profile.width, profile.height, { + fit: 'contain', + background: { r: 0, g: 0, b: 0, alpha: 1 }, + }) + .png() + .toFile(outputPath) + + console.log(`Created: ${path.relative(rootDir, outputPath)}`) + } +} + +async function run() { + const files = await readdir(inputDir) + const images = files.filter(isImageFile) + + if (images.length === 0) { + console.error(`No PNG/JPG files found in: ${path.relative(rootDir, inputDir)}`) + process.exitCode = 1 + return + } + + await mkdir(outputDir, { recursive: true }) + for (const image of images) { + await processFile(image) + } + + console.log(`Done. Output dir: ${path.relative(rootDir, outputDir)}`) +} + +run().catch((error) => { + console.error('Failed to generate screenshot profiles:', error) + process.exitCode = 1 +}) diff --git a/scripts/playstore-screenshot-sizes.sh b/scripts/playstore-screenshot-sizes.sh new file mode 100755 index 0000000..fcd8ed5 --- /dev/null +++ b/scripts/playstore-screenshot-sizes.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" + +node "$ROOT_DIR/scripts/playstore-screenshot-sizes.mjs" "$@"