This commit is contained in:
Philipp Dormann 2024-12-02 12:56:43 +01:00
parent 0acda07eb5
commit 048edfba89
Signed by: philipp
GPG Key ID: 3BB9ADD52DCA4314
8 changed files with 88 additions and 55 deletions

View File

@ -3,5 +3,8 @@
"src/locales" "src/locales"
], ],
"i18n-ally.keystyle": "nested", "i18n-ally.keystyle": "nested",
"i18n-ally.extract.keygenStyle": "snake_case" "i18n-ally.extract.keygenStyle": "snake_case",
"i18n-ally.enabledFrameworks": [
"vue"
]
} }

View File

@ -1,5 +1,6 @@
{ {
"access_is_only_provided_via_your_email_link": "Der Zugang erfolgt über den Link, den Sie bei der Registrierung erhalten haben.", "access_is_only_provided_via_your_email_link": "Der Zugang erfolgt über den Link, den Sie bei der Registrierung erhalten haben.",
"already_registered": "bereits registriert...",
"amount_per_kilometer_in_eur": "Betrag pro Kilometer (in €)", "amount_per_kilometer_in_eur": "Betrag pro Kilometer (in €)",
"apartment_suite_etc": "Addresszeile 2", "apartment_suite_etc": "Addresszeile 2",
"buergerlauf": "Bürgerlauf", "buergerlauf": "Bürgerlauf",
@ -14,12 +15,16 @@
"download_registrationcode": "Registrierungscode herunterladen", "download_registrationcode": "Registrierungscode herunterladen",
"e_mail_adress": "E-Mail Adresse", "e_mail_adress": "E-Mail Adresse",
"error-loading-privacy-policy": "Fehler beim Laden der Datenschutzerklärung", "error-loading-privacy-policy": "Fehler beim Laden der Datenschutzerklärung",
"error_requesting_the_login_link": "Fehler beim Anfordern des Login-Links...",
"i_accept": "Ich habe die ", "i_accept": "Ich habe die ",
"i_accept_end": "gelesen und akzeptiert.", "i_accept_end": "gelesen und akzeptiert.",
"if_you_are_the_system_administrator_please_refer_to_the_official_product_documentation_readme_for_configuration_guidance": "Wenn Sie der Systemadministrator sind, finden Sie Konfigurationsanweisungen in der offiziellen Produktdokumentation / README.", "if_you_are_the_system_administrator_please_refer_to_the_official_product_documentation_readme_for_configuration_guidance": "Wenn Sie der Systemadministrator sind, finden Sie Konfigurationsanweisungen in der offiziellen Produktdokumentation / README.",
"imprint": "Impressum", "imprint": "Impressum",
"invalid_input_phone_number_should_be_international_format": "ungültige Eingabe... Die Telefonnummer sollte ein internationales Format haben",
"lap_time": "Rundenzeit", "lap_time": "Rundenzeit",
"lap_times": "Rundenzeiten", "lap_times": "Rundenzeiten",
"login_link_gesendet_an_user_email_value": "Login-Link gesendet an",
"login_link_is_requested": "Login-Link wird angefordert...",
"lost_your_registration_mail": "Brauchen Sie einen neuen Login-Link?", "lost_your_registration_mail": "Brauchen Sie einen neuen Login-Link?",
"main_page_text": "Hier können Sie sich für den Lauf Für Kaya! registrieren oder ihr Läuferprofil verwalten.", "main_page_text": "Hier können Sie sich für den Lauf Für Kaya! registrieren oder ihr Läuferprofil verwalten.",
"mittelname": "Mittelname", "mittelname": "Mittelname",
@ -29,7 +34,7 @@
"not_registered_yet": "Noch nicht registriert?", "not_registered_yet": "Noch nicht registriert?",
"organization": "Organisation", "organization": "Organisation",
"ort": "Ort", "ort": "Ort",
"phone_number": "Telefonnummer", "phone_number": "Telefonnummer (international formatiert)",
"please_provide_a_valid_zipcode": "Bitte geben Sie eine gültige Postleitzahl an...", "please_provide_a_valid_zipcode": "Bitte geben Sie eine gültige Postleitzahl an...",
"please_provide_valid_mail": "Bitte geben Sie eine gültige E-Mail Adresse an", "please_provide_valid_mail": "Bitte geben Sie eine gültige E-Mail Adresse an",
"plz": "PLZ", "plz": "PLZ",
@ -44,6 +49,7 @@
"registration_running": "Registrierung läuft...", "registration_running": "Registrierung läuft...",
"registrationcode": "Registrierungscode", "registrationcode": "Registrierungscode",
"registrieren": "Registrieren", "registrieren": "Registrieren",
"registriert": "Registriert",
"resend_the_registration_mail": "Login-Link anfordern", "resend_the_registration_mail": "Login-Link anfordern",
"sponsoring": "Sponsoring", "sponsoring": "Sponsoring",
"strasse": "Straße", "strasse": "Straße",

View File

@ -1,5 +1,7 @@
{ {
"access_is_only_provided_via_your_email_link": "Access is only provided via the link you received upon registration.", "access_is_only_provided_via_your_email_link": "Access is only provided via the link you received upon registration.",
"alle_daten_geloescht": "Alle Daten gelöscht!",
"already_registered": "already registered...",
"amount_per_kilometer_in_eur": "Amount per kilometer (in €)", "amount_per_kilometer_in_eur": "Amount per kilometer (in €)",
"apartment_suite_etc": "Apartment, suite, etc.", "apartment_suite_etc": "Apartment, suite, etc.",
"buergerlauf": "Public Run", "buergerlauf": "Public Run",
@ -14,12 +16,17 @@
"download_registrationcode": "Download registrationcode", "download_registrationcode": "Download registrationcode",
"e_mail_adress": "mail address", "e_mail_adress": "mail address",
"error-loading-privacy-policy": "Error loading Privacy Policy", "error-loading-privacy-policy": "Error loading Privacy Policy",
"error_loading_imprint": "Error loading Imprint",
"error_requesting_the_login_link": "Error requesting the login link...",
"i_accept": "I have read and accepted the ", "i_accept": "I have read and accepted the ",
"i_accept_end": "", "i_accept_end": "",
"if_you_are_the_system_administrator_please_refer_to_the_official_product_documentation_readme_for_configuration_guidance": "If you are the system administrator, please refer to the official product documentation/ README for configuration guidance.", "if_you_are_the_system_administrator_please_refer_to_the_official_product_documentation_readme_for_configuration_guidance": "If you are the system administrator, please refer to the official product documentation/ README for configuration guidance.",
"imprint": "Imprint", "imprint": "Imprint",
"invalid_input_phone_number_should_be_international_format": "invalid input... phone number should be international format",
"lap_time": "Lap time", "lap_time": "Lap time",
"lap_times": "Lap times", "lap_times": "Lap times",
"login_link_gesendet_an_user_email_value": "Login-Link sent to",
"login_link_is_requested": "Login link is requested...",
"lost_your_registration_mail": "Lost your registration mail?", "lost_your_registration_mail": "Lost your registration mail?",
"main_page_text": "Here you can register for the Lauf Für Kaya! or manage your runner profile.", "main_page_text": "Here you can register for the Lauf Für Kaya! or manage your runner profile.",
"mittelname": "Middlename", "mittelname": "Middlename",
@ -29,11 +36,14 @@
"not_registered_yet": "Not registered yet?", "not_registered_yet": "Not registered yet?",
"organization": "Organization", "organization": "Organization",
"ort": "City", "ort": "City",
"phone_number": "Phone Number", "phone_number": "Phone Number (international format)",
"please_provide_a_valid_zipcode": "Please provide a valid zipcode...", "please_provide_a_valid_zipcode": "Please provide a valid zipcode...",
"please_provide_valid_mail": "Please provide a valid mail address.", "please_provide_valid_mail": "Please provide a valid mail address.",
"plz": "zipcode", "plz": "zipcode",
"privacy_policy": "Privacy Policy", "privacy_policy": "Privacy Policy",
"profil_konnte_nicht_geladen_werden": "Profil konnte nicht geladen werden...",
"profil_konnte_nicht_geloescht_werden": "Profil konnte nicht gelöscht werden...",
"profil_wird_geloescht": "Profil wird gelöscht...",
"profile": "Profile", "profile": "Profile",
"provide_address": "Provide a postal address?", "provide_address": "Provide a postal address?",
"register": { "register": {
@ -44,12 +54,17 @@
"registration_running": "registration is running...", "registration_running": "registration is running...",
"registrationcode": "Registration Code", "registrationcode": "Registration Code",
"registrieren": "Register Now", "registrieren": "Register Now",
"registriert": "Registered",
"registrierungscode_generiert": "Registrierungscode generiert!",
"registrierungscode_wird_generiert": "Registrierungscode wird generiert...",
"resend_the_registration_mail": "Send me a login link", "resend_the_registration_mail": "Send me a login link",
"sponsoring": "Sponsoring", "sponsoring": "Sponsoring",
"strasse": "Street/ Block", "strasse": "Street/ Block",
"the_system_is_not_properly_configured_please_contact_the_system_administrator_for_help": "The system is not properly configured. Please contact the system administrator for help.", "the_system_is_not_properly_configured_please_contact_the_system_administrator_for_help": "The system is not properly configured. Please contact the system administrator for help.",
"this_is_not_a_valid_international_phone_number": "This is not a valid international phone number", "this_is_not_a_valid_international_phone_number": "This is not a valid international phone number",
"total": "Total", "total": "Total",
"urkunde_konnte_nicht_generiert_werden": "Urkunde konnte nicht generiert werden...",
"urkunde_wird_generiert": "Urkunde wird generiert...",
"view_my_data": "View my data", "view_my_data": "View my data",
"vorname": "Firstname" "vorname": "Firstname"
} }

View File

@ -24,5 +24,4 @@
<script setup> <script setup>
import background_base64 from "../assets/background.jpg?inline"; import background_base64 from "../assets/background.jpg?inline";
import Footer from "@/components/Footer.vue"; import Footer from "@/components/Footer.vue";
console.log(config);
</script> </script>

View File

@ -31,7 +31,7 @@ export default {
try { try {
md = await fetch(`/imprint_en.md`); md = await fetch(`/imprint_en.md`);
} catch (error) { } catch (error) {
md = "Error loading Imprint"; md = t('error_loading_imprint');
} }
} }
this.content = marked(await md.text()); this.content = marked(await md.text());

View File

@ -77,8 +77,8 @@
w-full w-full
md:w-auto md:w-auto
" @click="() => { " @click="() => {
state.delete_active = true; state.delete_active = true;
} }
"> ">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
@ -104,8 +104,8 @@
bg-blue-500 bg-blue-500
hover:bg-blue-600 hover:shadow-lg hover:bg-blue-600 hover:shadow-lg
" @click="() => { " @click="() => {
state.delete_active = false; state.delete_active = false;
} }
"> ">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
@ -146,8 +146,8 @@
<div class="flex lg:flex-wrap flex-row lg:space-x-2"> <div class="flex lg:flex-wrap flex-row lg:space-x-2">
<div class="flex-none"> <div class="flex-none">
<button @click="() => { <button @click="() => {
state.activetab = 'profile'; state.activetab = 'profile';
} }
" :class="{ " :class="{
'tab-active border-b-2 font-medium border-blue-500': 'tab-active border-b-2 font-medium border-blue-500':
state.activetab === 'profile', state.activetab === 'profile',
@ -157,8 +157,8 @@
</div> </div>
<div class="flex-none"> <div class="flex-none">
<button @click="() => { <button @click="() => {
state.activetab = 'laptimes'; state.activetab = 'laptimes';
} }
" :class="{ " :class="{
'tab-active border-b-2 font-medium border-blue-500': 'tab-active border-b-2 font-medium border-blue-500':
state.activetab === 'laptimes', state.activetab === 'laptimes',
@ -168,8 +168,8 @@
</div> </div>
<div class="flex-none"> <div class="flex-none">
<button @click="() => { <button @click="() => {
state.activetab = 'sponsorings'; state.activetab = 'sponsorings';
} }
" :class="{ " :class="{
'tab-active border-b-2 font-medium border-blue-500': 'tab-active border-b-2 font-medium border-blue-500':
state.activetab === 'sponsorings', state.activetab === 'sponsorings',
@ -398,14 +398,14 @@
</td> </td>
<td class="px-4 py-3"> <td class="px-4 py-3">
<span v-text="(s.amountPerDistance / 100) <span v-text="(s.amountPerDistance / 100)
.toFixed(2) .toFixed(2)
.toLocaleString('de-DE', { valute: 'EUR' }) .toLocaleString('de-DE', { valute: 'EUR' })
"></span> "></span>
</td> </td>
<td class="px-4 py-3"> <td class="px-4 py-3">
<span v-text="(s.amount / 100) <span v-text="(s.amount / 100)
.toFixed(2) .toFixed(2)
.toLocaleString('de-DE', { valute: 'EUR' }) .toLocaleString('de-DE', { valute: 'EUR' })
"></span> "></span>
</td> </td>
</tr> </tr>
@ -415,30 +415,30 @@
<td class="px-4 py-3">{{ $t("total") }}</td> <td class="px-4 py-3">{{ $t("total") }}</td>
<td class="px-4 py-3"> <td class="px-4 py-3">
<span v-text="( <span v-text="(
state.sponsorings.reduce(function ( state.sponsorings.reduce(function (
sum, sum,
current current
) { ) {
return sum + current.amountPerDistance; return sum + current.amountPerDistance;
}, },
0) / 100 0) / 100
) )
.toFixed(2) .toFixed(2)
.toLocaleString('de-DE', { valute: 'EUR' }) .toLocaleString('de-DE', { valute: 'EUR' })
"></span> "></span>
</td> </td>
<td class="px-4 py-3"> <td class="px-4 py-3">
<span v-text="( <span v-text="(
state.sponsorings.reduce(function ( state.sponsorings.reduce(function (
sum, sum,
current current
) { ) {
return sum + current.amount; return sum + current.amount;
}, },
0) / 100 0) / 100
) )
.toFixed(2) .toFixed(2)
.toLocaleString('de-DE', { valute: 'EUR' }) .toLocaleString('de-DE', { valute: 'EUR' })
"></span> "></span>
</td> </td>
</tr> </tr>
@ -475,6 +475,8 @@ import { TYPE, useToast } from "vue-toastification";
import axios from "redaxios"; import axios from "redaxios";
import bwipjs from "bwip-js"; import bwipjs from "bwip-js";
import Footer from "@/components/Footer.vue"; import Footer from "@/components/Footer.vue";
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
function textToBase64Barcode(text) { function textToBase64Barcode(text) {
const canvas = document.createElement("canvas"); const canvas = document.createElement("canvas");
@ -531,7 +533,7 @@ axios
}) })
.catch((error) => { .catch((error) => {
toast.clear(); toast.clear();
toast.error("Profil konnte nicht geladen werden..."); toast.error(t('profil_konnte_nicht_geladen_werden'));
}); });
axios axios
.get(`${config.baseurl}api/runners/me/${accesstoken}/scans`) .get(`${config.baseurl}api/runners/me/${accesstoken}/scans`)
@ -553,26 +555,26 @@ axios
state.scans = data; state.scans = data;
}) })
.catch((error) => { .catch((error) => {
toast.error("Profil konnte nicht geladen werden..."); toast.error(t('profil_konnte_nicht_geladen_werden'));
}); });
function delete_me() { function delete_me() {
toast.clear(); toast.clear();
toast("Profil wird gelöscht..."); toast(t('profil_wird_geloescht'));
let url = `${config.baseurl}api/runners/me/${accesstoken}?force=true`; let url = `${config.baseurl}api/runners/me/${accesstoken}?force=true`;
axios axios
.delete(url) .delete(url)
.then(() => { .then(() => {
toast.clear(); toast.clear();
toast("Alle Daten gelöscht!"); toast(t('alle_daten_geloescht'));
location.replace(`${config.baseurl_selfservice}`); location.replace(`${config.baseurl_selfservice}`);
}) })
.catch((error) => { .catch((error) => {
toast.clear(); toast.clear();
toast.error("Profil konnte nicht gelöscht werden..."); toast.error(t('profil_konnte_nicht_geloescht_werden'));
}); });
} }
function get_certificate() { function get_certificate() {
toast("Urkunde wird generiert..."); toast(t('urkunde_wird_generiert'));
const browserlocale = ( const browserlocale = (
(navigator.languages && navigator.languages[0]) || (navigator.languages && navigator.languages[0]) ||
"" ""
@ -590,7 +592,7 @@ function get_certificate() {
.then((response) => { .then((response) => {
console.log(response); console.log(response);
if (response.status != "200") { if (response.status != "200") {
toast.error("Urkunde konnte nicht generiert werden..."); toast.error(t('urkunde_konnte_nicht_generiert_werden'));
} else { } else {
var fileURL = window.URL.createObjectURL( var fileURL = window.URL.createObjectURL(
new Blob([response.data], { type: "application/pdf" }) new Blob([response.data], { type: "application/pdf" })
@ -610,17 +612,17 @@ function get_certificate() {
.catch((err) => { .catch((err) => {
console.error(err); console.error(err);
toast.clear(); toast.clear();
toast.error("Urkunde konnte nicht generiert werden..."); toast.error(t('urkunde_konnte_nicht_generiert_werden'));
}); });
} }
function get_registration() { function get_registration() {
toast.clear(); toast.clear();
toast("Registrierungscode wird generiert..."); toast(t('registrierungscode_wird_generiert'));
var a = document.createElement("a"); var a = document.createElement("a");
a.href = state.barcode; a.href = state.barcode;
a.download = "LfK25_Registrierungscode.png"; a.download = "LfK25_Registrierungscode.png";
a.click(); a.click();
toast.clear(); toast.clear();
toast("Registrierungscode generiert!", { type: TYPE.SUCCESS }); toast(t('registrierungscode_generiert'), { type: TYPE.SUCCESS });
} }
</script> </script>

View File

@ -27,7 +27,7 @@
class="dark:bg-gray-800 mt-1 block w-full shadow-sm sm:text-sm border-2 bg-gray-50 text-gray-500 rounded-md p-2" /> class="dark:bg-gray-800 mt-1 block w-full shadow-sm sm:text-sm border-2 bg-gray-50 text-gray-500 rounded-md p-2" />
<p v-if="!isEmail(user_email) && user_email !== ''" class="text-sm">{{ <p v-if="!isEmail(user_email) && user_email !== ''" class="text-sm">{{
$t('please_provide_valid_mail') $t('please_provide_valid_mail')
}}</p> }}</p>
</div> </div>
<div class="mt-2"> <div class="mt-2">
<button :disabled="(!state.submit_enabled)" <button :disabled="(!state.submit_enabled)"
@ -63,6 +63,8 @@ import axios from "redaxios";
import isEmail from 'validator/es/lib/isEmail'; import isEmail from 'validator/es/lib/isEmail';
import { TYPE, useToast } from "vue-toastification"; import { TYPE, useToast } from "vue-toastification";
import Footer from "@/components/Footer.vue"; import Footer from "@/components/Footer.vue";
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
let user_email = ref(""); let user_email = ref("");
// //
@ -74,16 +76,16 @@ const state = reactive({
const toast = useToast(); const toast = useToast();
function resendMail() { function resendMail() {
if (isEmail(user_email.value)) { if (isEmail(user_email.value)) {
toast("Login-Link wird angefordert..."); toast(t('login_link_is_requested'));
const browserlocale = ((navigator.languages && navigator.languages[0]) || '').substr(0, 2); const browserlocale = ((navigator.languages && navigator.languages[0]) || '').substr(0, 2);
axios.post(`${config.baseurl}api/runners/login?mail=${user_email.value}&locale=${browserlocale}`) axios.post(`${config.baseurl}api/runners/login?mail=${user_email.value}&locale=${browserlocale}`)
.then(({ data }) => { .then(({ data }) => {
console.log(data); console.log(data);
toast("Login-Link gesendet an " + user_email.value + "!"); toast(t('login_link_gesendet_an_user_email_value') + user_email.value);
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
toast("Fehler beim Anfordern des Login-Links...", { type: TYPE.ERROR }); toast(t('error_requesting_the_login_link'), { type: TYPE.ERROR });
}); });
} }
} }

View File

@ -3,7 +3,7 @@
<div class="max-w-md w-full py-12 px-6"> <div class="max-w-md w-full py-12 px-6">
<img class="mx-auto h-24 w-auto" src="/favicon-lfk.png" alt /> <img class="mx-auto h-24 w-auto" src="/favicon-lfk.png" alt />
<h1 class="sm:text-3xl text-2xl font-medium title-font mb-4 text-center"> <h1 class="sm:text-3xl text-2xl font-medium title-font mb-4 text-center">
Lauf für Kaya! - Registriert Lauf für Kaya! - {{ $t('registriert') }}
</h1> </h1>
<p class="mx-auto leading-relaxed text-base text-center"> <p class="mx-auto leading-relaxed text-base text-center">
Bitte klicken Sie zum Fortfahren auf den Link, den wir an Bitte klicken Sie zum Fortfahren auf den Link, den wir an
@ -439,7 +439,13 @@ function login() {
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
if (error.data.message === "E-Mail already registered") { if (error.data.message === "E-Mail already registered") {
toast("bereits registriert...", { type: TYPE.ERROR }); toast(t('already_registered'), { type: TYPE.ERROR });
} else if (error.data.message === "Invalid body, check 'errors' property for more info.") {
error.data.errors.forEach(e => {
if (e.property === "phone") {
toast(t('invalid_input_phone_number_should_be_international_format'), { type: TYPE.ERROR });
}
});
} }
}); });
} }