Compare commits
10 Commits
857b5c3d89
...
0.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 5876e0c9df | |||
| ace5c958f1 | |||
| aa287cf452 | |||
| aca2dff129 | |||
| d41824b735 | |||
| 7904151a52 | |||
| a39cf75c7f | |||
| 79d8545ed6 | |||
| 18d1ddacf7 | |||
| 36baf174a5 |
5
CHANGELOG.md
Normal file
5
CHANGELOG.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
### Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
||||||
|
|
||||||
|
#### 0.0.1
|
||||||
16
package.json
16
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@odit/lfk-selfservice",
|
"name": "@odit/lfk-selfservice",
|
||||||
"version": "0.0.1",
|
"version": "0.1.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
@@ -20,13 +20,13 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "^1.1.5",
|
"@vitejs/plugin-vue": "^1.1.5",
|
||||||
"@vue/compiler-sfc": "^3.0.6",
|
"@vue/compiler-sfc": "^3.0.7",
|
||||||
"autoprefixer": "^10.2.4",
|
"autoprefixer": "^10.2.5",
|
||||||
"postcss": "^8.2.6",
|
"postcss": "^8.2.8",
|
||||||
"release-it": "^14.4.1",
|
"release-it": "^14.5.0",
|
||||||
"tailwindcss": "^2.0.3",
|
"tailwindcss": "^2.0.4",
|
||||||
"vite": "^2.0.3",
|
"vite": "^2.1.2",
|
||||||
"vite-plugin-windicss": "^0.5.4"
|
"vite-plugin-windicss": "^0.9.11"
|
||||||
},
|
},
|
||||||
"release-it": {
|
"release-it": {
|
||||||
"git": {
|
"git": {
|
||||||
|
|||||||
@@ -97,11 +97,8 @@ import Toastify from "toastify-js";
|
|||||||
let mail = ref("");
|
let mail = ref("");
|
||||||
let loading = ref(false);
|
let loading = ref(false);
|
||||||
function login() {
|
function login() {
|
||||||
console.log("ihi");
|
|
||||||
console.log(mail.value);
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
axios.get("").then((res) => {
|
axios.get("").then((res) => {
|
||||||
console.log(res.data);
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
Toastify({
|
Toastify({
|
||||||
text: "This is a toast",
|
text: "This is a toast",
|
||||||
|
|||||||
@@ -97,11 +97,8 @@ import Toastify from "toastify-js";
|
|||||||
let mail = ref("");
|
let mail = ref("");
|
||||||
let loading = ref(false);
|
let loading = ref(false);
|
||||||
function login() {
|
function login() {
|
||||||
console.log("ihi");
|
|
||||||
console.log(mail.value);
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
axios.get("").then((res) => {
|
axios.get("").then((res) => {
|
||||||
console.log(res.data);
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
Toastify({
|
Toastify({
|
||||||
text: "This is a toast",
|
text: "This is a toast",
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
></p>
|
></p>
|
||||||
<p class="text-md whitespace-nowrap">{{ state.group }}</p>
|
<p class="text-md whitespace-nowrap">{{ state.group }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="inline-flex md:ml-auto md:mr-0 mx-auto items-center space-x-4">
|
<div class="inline-flex md:ml-auto md:mr-0 mx-auto items-center">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="focus:border-black focus:ring-2 focus:ring-black text-white text-sm py-2.5 px-5 rounded-md bg-blue-500 hover:bg-blue-600 hover:shadow-lg"
|
class="focus:border-black focus:ring-2 focus:ring-black text-white text-sm py-2.5 px-5 rounded-md bg-blue-500 hover:bg-blue-600 hover:shadow-lg"
|
||||||
@@ -35,10 +35,6 @@
|
|||||||
</svg>
|
</svg>
|
||||||
{{ $t('download_certificate') }}
|
{{ $t('download_certificate') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="inline-flex focus:border-black focus:ring-2 focus:ring-black text-white text-sm py-2.5 px-5 rounded-md bg-green-600 hover:bg-green-800 hover:shadow-lg opacity-50"
|
|
||||||
>{{ $t('save_changes') }}</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -79,35 +75,35 @@
|
|||||||
<div class="form-element">
|
<div class="form-element">
|
||||||
<div class="text-lg">{{ $t('vorname') }}</div>
|
<div class="text-lg">{{ $t('vorname') }}</div>
|
||||||
<p
|
<p
|
||||||
class="w-full dark:bg-gray-800 rounded text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out"
|
class="h-10 w-full dark:bg-gray-800 rounded text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out"
|
||||||
v-text="state.firstname"
|
v-text="state.firstname"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-element">
|
<div class="form-element">
|
||||||
<div class="text-lg">{{ $t('mittelname') }}</div>
|
<div class="text-lg">{{ $t('mittelname') }}</div>
|
||||||
<p
|
<p
|
||||||
class="w-full dark:bg-gray-800 rounded text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out"
|
class="h-10 w-full dark:bg-gray-800 rounded text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out"
|
||||||
v-text="state.middlename"
|
v-text="state.middlename"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-element">
|
<div class="form-element">
|
||||||
<div class="text-lg">{{ $t('nachname') }}</div>
|
<div class="text-lg">{{ $t('nachname') }}</div>
|
||||||
<p
|
<p
|
||||||
class="w-full dark:bg-gray-800 rounded text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out"
|
class="h-10 w-full dark:bg-gray-800 rounded text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out"
|
||||||
v-text="state.lastname"
|
v-text="state.lastname"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-element">
|
<div class="form-element">
|
||||||
<div class="text-lg">{{ $t('e_mail_adress') }}</div>
|
<div class="text-lg">{{ $t('e_mail_adress') }}</div>
|
||||||
<p
|
<p
|
||||||
class="w-full dark:bg-gray-800 rounded text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out"
|
class="h-10 w-full dark:bg-gray-800 rounded text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out"
|
||||||
v-text="state.email"
|
v-text="state.email"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-element">
|
<div class="form-element">
|
||||||
<div class="text-lg">{{ $t('phone_number') }}</div>
|
<div class="text-lg">{{ $t('phone_number') }}</div>
|
||||||
<p
|
<p
|
||||||
class="w-full dark:bg-gray-800 rounded text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out"
|
class="h-10 w-full dark:bg-gray-800 rounded text-base outline-none dark:text-gray-100 text-gray-600 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out"
|
||||||
v-text="state.phone"
|
v-text="state.phone"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -187,8 +183,11 @@ const state = reactive({
|
|||||||
activetab: "profile",
|
activetab: "profile",
|
||||||
})
|
})
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const token = location.hash.substr(1).split('&')[0].split('=')[1];
|
const props = defineProps({
|
||||||
axios.get(`${config.baseurl}api/runners/me/${token}`)
|
token: String
|
||||||
|
})
|
||||||
|
const accesstoken = atob(props.token);
|
||||||
|
axios.get(`${config.baseurl}api/runners/me/${accesstoken}`)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
state.phone = data.phone;
|
state.phone = data.phone;
|
||||||
state.email = data.email;
|
state.email = data.email;
|
||||||
@@ -199,7 +198,7 @@ axios.get(`${config.baseurl}api/runners/me/${token}`)
|
|||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
toast.error("An error occured while loading your profile data");
|
toast.error("An error occured while loading your profile data");
|
||||||
})
|
})
|
||||||
axios.get(`${config.baseurl}api/runners/me/${token}/scans`)
|
axios.get(`${config.baseurl}api/runners/me/${accesstoken}/scans`)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
data.map(function(s) {
|
data.map(function(s) {
|
||||||
s.lapTime = Math.floor(s.lapTime / 60) + 'min ' + (Math.floor(s.lapTime % 60) + "").padStart(2, "0") + "s"
|
s.lapTime = Math.floor(s.lapTime / 60) + 'min ' + (Math.floor(s.lapTime % 60) + "").padStart(2, "0") + "s"
|
||||||
|
|||||||
@@ -6,6 +6,11 @@
|
|||||||
class="sm:text-3xl text-2xl font-medium title-font mb-4 text-center"
|
class="sm:text-3xl text-2xl font-medium title-font mb-4 text-center"
|
||||||
>Lauf für Kaya! - {{ $t('registrieren') }}</h1>
|
>Lauf für Kaya! - {{ $t('registrieren') }}</h1>
|
||||||
<p class="mx-auto leading-relaxed text-base text-center">{{ $t('register.register_now') }}</p>
|
<p class="mx-auto leading-relaxed text-base text-center">{{ $t('register.register_now') }}</p>
|
||||||
|
<p
|
||||||
|
v-if="state.org_name !== ''"
|
||||||
|
class="mx-auto leading-relaxed text-base text-center"
|
||||||
|
>Organization: {{ state.org_name }}</p>
|
||||||
|
<p v-else class="mx-auto leading-relaxed text-base text-center">Bürgerlauf</p>
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<label for="first_name" class="block font-medium">
|
<label for="first_name" class="block font-medium">
|
||||||
{{ $t('vorname') }}
|
{{ $t('vorname') }}
|
||||||
@@ -189,6 +194,23 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex items-start mt-6">
|
||||||
|
<div class="flex items-center h-5">
|
||||||
|
<input
|
||||||
|
v-model="data_confirmed"
|
||||||
|
id="data_confirmed"
|
||||||
|
name="data_confirmed"
|
||||||
|
type="checkbox"
|
||||||
|
class="h-4 w-4 text-indigo-600 border-gray-300 rounded"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="ml-3 text-sm">
|
||||||
|
<label for="data_confirmed" class="font-medium text-gray-400 select-none">
|
||||||
|
{{ $t('confirm_personal_data') }}
|
||||||
|
<span class="font-bold">*</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<button
|
<button
|
||||||
@click="login"
|
@click="login"
|
||||||
@@ -219,19 +241,35 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref, reactive, watch } from "vue";
|
import { computed, ref, reactive, defineProps } from "vue";
|
||||||
import axios from "redaxios";
|
import axios from "redaxios";
|
||||||
import isEmail from 'validator/es/lib/isEmail';
|
import isEmail from 'validator/es/lib/isEmail';
|
||||||
import isMobilePhone from 'validator/es/lib/isMobilePhone';
|
import isMobilePhone from 'validator/es/lib/isMobilePhone';
|
||||||
import isPostalCode from 'validator/es/lib/isPostalCode';
|
import isPostalCode from 'validator/es/lib/isPostalCode';
|
||||||
import { useToast } from "vue-toastification";
|
import { useToast } from "vue-toastification";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
token: String
|
||||||
|
})
|
||||||
|
if (props.token) {
|
||||||
|
props.token = atob(props.token);
|
||||||
|
axios.get(`${config.baseurl}api/organizations/selfservice/${props.token}`)
|
||||||
|
.then(({ data }) => {
|
||||||
|
state.org_name = data.name;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
let userdetails = ref({ firstname: "", lastname: "", middlename: "", mail: "", phone: "", address: { street: "", address2: "", city: "", zipcode: "" } });
|
let userdetails = ref({ firstname: "", lastname: "", middlename: "", mail: "", phone: "", address: { street: "", address2: "", city: "", zipcode: "" } });
|
||||||
let provide_address = ref(false);
|
let provide_address = ref(false);
|
||||||
let agb_accepted = ref(false);
|
let agb_accepted = ref(false);
|
||||||
|
let data_confirmed = ref(false);
|
||||||
//
|
//
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
submit_enabled: computed(() => agb_accepted.value === true && (isMobilePhone(userdetails.value.phone) || !userdetails.value.phone.trim()) && isEmail(userdetails.value.mail)
|
org_name: "",
|
||||||
|
submit_enabled: computed(() => agb_accepted.value === true && data_confirmed.value === true && (isMobilePhone(userdetails.value.phone) || !userdetails.value.phone.trim()) && isEmail(userdetails.value.mail)
|
||||||
&& userdetails.value.firstname
|
&& userdetails.value.firstname
|
||||||
&& userdetails.value.lastname && (provide_address.value === false || provide_address.value === true && (userdetails.value.address.street.trim() && userdetails.value.address.city.trim() && isPostalCode(userdetails.value.address.zipcode, "DE"))))
|
&& userdetails.value.lastname && (provide_address.value === false || provide_address.value === true && (userdetails.value.address.street.trim() && userdetails.value.address.city.trim() && isPostalCode(userdetails.value.address.zipcode, "DE"))))
|
||||||
})
|
})
|
||||||
@@ -260,13 +298,14 @@ function login() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
toast("registration in progress...");
|
toast("registration in progress...");
|
||||||
axios.post(`${config.baseurl}api/runners/register`, postdata)
|
let url = `${config.baseurl}api/runners/register`;
|
||||||
.then((response) => {
|
if (props.token) {
|
||||||
response = response.data;
|
url = `${config.baseurl}api/runners/register/${props.token}`
|
||||||
const token = response.token;
|
}
|
||||||
const userid = JSON.parse(atob(token.split(".")[1])).id;
|
axios.post(url, postdata)
|
||||||
console.log({ token });
|
.then(({ data }) => {
|
||||||
console.log({ userid });
|
const token = btoa(data.token);
|
||||||
|
location.replace("../profile/" + token)
|
||||||
//
|
//
|
||||||
toast.success("You have been registered!");
|
toast.success("You have been registered!");
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"already_have_an_account": "Sie haben bereits einen Account?",
|
"already_have_an_account": "Sie haben bereits einen Account?",
|
||||||
"apartment_suite_etc": "Addresszeile 2",
|
"apartment_suite_etc": "Addresszeile 2",
|
||||||
"configuration_error": "Konfigurationsfehler",
|
"configuration_error": "Konfigurationsfehler",
|
||||||
|
"confirm_personal_data": "Hiermit bestätige ich die Vollständigkeit und Richtigkeit der oben genannten Angaben",
|
||||||
"distance": "Distanz",
|
"distance": "Distanz",
|
||||||
"download_certificate": "Urkunde herunterladen",
|
"download_certificate": "Urkunde herunterladen",
|
||||||
"e_mail_adress": "E-Mail Adresse",
|
"e_mail_adress": "E-Mail Adresse",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"already_have_an_account": "Already have an account?",
|
"already_have_an_account": "Already have an account?",
|
||||||
"apartment_suite_etc": "Apartment, suite, etc.",
|
"apartment_suite_etc": "Apartment, suite, etc.",
|
||||||
"configuration_error": "Configuration error",
|
"configuration_error": "Configuration error",
|
||||||
|
"confirm_personal_data": "I hereby confirm that the above information is complete and correct",
|
||||||
"distance": "Distance",
|
"distance": "Distance",
|
||||||
"download_certificate": "Download certificate",
|
"download_certificate": "Download certificate",
|
||||||
"e_mail_adress": "mail address",
|
"e_mail_adress": "mail address",
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const EnvError = import('./components/EnvError.vue');
|
|||||||
const Home = import('./components/Home.vue');
|
const Home = import('./components/Home.vue');
|
||||||
const Imprint = import('./components/Imprint.vue');
|
const Imprint = import('./components/Imprint.vue');
|
||||||
const Privacy = import('./components/Privacy.vue');
|
const Privacy = import('./components/Privacy.vue');
|
||||||
const Register = import('./components/Register.vue');
|
const Register = () => import('./components/Register.vue');
|
||||||
const Profile = () => import('./components/Profile.vue');
|
const Profile = () => import('./components/Profile.vue');
|
||||||
//
|
//
|
||||||
let routes = [ { path: '/:pathMatch(.*)*', component: EnvError } ];
|
let routes = [ { path: '/:pathMatch(.*)*', component: EnvError } ];
|
||||||
@@ -36,7 +36,8 @@ if (typeof config !== 'undefined') {
|
|||||||
{ path: '/imprint', component: Imprint },
|
{ path: '/imprint', component: Imprint },
|
||||||
{ path: '/privacy', component: Privacy },
|
{ path: '/privacy', component: Privacy },
|
||||||
{ path: '/register', component: Register },
|
{ path: '/register', component: Register },
|
||||||
{ path: '/profile', component: Profile }
|
{ path: '/register/:token', component: Register, props: true },
|
||||||
|
{ path: '/profile/:token', component: Profile, props: true }
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user