Compare commits

..

4 Commits

Author SHA1 Message Date
fd07373d43 implement profile view
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-10-03 17:56:52 +02:00
e6e44d5de8 redirect users with token #38 2021-09-24 17:51:37 +02:00
c3cc51dbf9 implement seach view autofocus #41 2021-09-24 17:45:11 +02:00
9906e32f45 add login page name field autofocus #42 2021-09-24 17:39:24 +02:00
6 changed files with 21 additions and 73 deletions

View File

@ -20,6 +20,3 @@ steps:
from_secret: "docker_username" from_secret: "docker_username"
password: password:
from_secret: "docker_password" from_secret: "docker_password"
when:
branch:
- main

View File

@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
{{ title }} {{ title }}
</h3> </h3>
<div class="card w-100"> <div class="card w-100">
<div class="card-body"> <div class="card-body lh-1">
<slot></slot> <slot></slot>
</div> </div>
</div> </div>

View File

@ -54,20 +54,17 @@ export default {
} }
}, },
actions: { actions: {
onError({commit, dispatch}) { onError({commit}) {
commit('setError') commit('setError')
dispatch('clear') commit('clearProfileId')
commit('clearProfile')
commit('setNotLoading')
commit('hideSpinner')
}, },
onNotFound({commit, dispatch}) { onNotFound({commit, dispatch}) {
dispatch('onError') dispatch('onError')
commit('setNotFound', true) commit('setNotFound', true)
}, },
clear({commit}) {
commit('clearProfileId')
commit('clearProfile')
commit('hideSpinner')
commit('setNotLoading')
},
async load({state, commit, dispatch, rootState}, profileId) { async load({state, commit, dispatch, rootState}, profileId) {
if (state.loading) { if (state.loading) {
return return
@ -114,7 +111,7 @@ export default {
const responseData = await response.json() const responseData = await response.json()
commit('setProfile', responseData.profile) commit('setProfile', responseData.profile)
commit('hideSpinner') commit('hideSpinner')
commit('setNotLoading') commit('setNotSearching')
} }
} }
} }

View File

@ -109,7 +109,6 @@ export default {
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$router.push({ query: { query: this.searchText }})
this.$store.dispatch('search/search') this.$store.dispatch('search/search')
}, },
focusSearchText() { focusSearchText() {

View File

@ -98,36 +98,17 @@ SPDX-License-Identifier: AGPL-3.0-or-later
@update-values="profile.searchtopics = $event" @update-values="profile.searchtopics = $event"
></auto-complete> ></auto-complete>
<Section title="Verfügbarkeit"> <div class="col-12 col-xs-12">
<div class="form-check mb-3"> <label for="availability" class="form-label fw-bold"
<input >Ich bin für Anfragen verfügbar:</label
v-model="profile.availability_status" >
class="form-check-input me-2"
type="checkbox"
id="availability_status">
<label class="form-check-label" for="availability_status">
Ich bin aktuell verfügbar
</label>
</div>
<div class="mb-3" v-if="profile.availability_status">
<label class="form-label">
Stunden pro Woche
</label>
<input
v-model="profile.availability_hours_per_week"
type="number"
class="form-control">
</div>
<label for="availability" class="form-label">
Anmerkungen
</label>
<textarea <textarea
class="form-control" class="form-control"
id="availability" id="availability"
rows="3" rows="3"
v-model="profile.availability_text" v-model="profile.availability"
></textarea> ></textarea>
</Section> </div>
<auto-complete <auto-complete
type="contacttype" type="contacttype"
@ -190,14 +171,12 @@ SPDX-License-Identifier: AGPL-3.0-or-later
import RequestMixin from "@/mixins/request.mixin" import RequestMixin from "@/mixins/request.mixin"
import AutoComplete from "@/components/AutoComplete"; import AutoComplete from "@/components/AutoComplete";
import Section from '@/components/profile/Section'
export default { export default {
name: "profileEdit", name: "profileEdit",
mixins: [RequestMixin], mixins: [RequestMixin],
components: { components: {
AutoComplete, AutoComplete,
Section,
}, },
data() { data() {
return { return {
@ -209,9 +188,7 @@ export default {
pronouns: "", pronouns: "",
volunteerwork: "", volunteerwork: "",
freetext: "", freetext: "",
availability_status: false, availability: "",
availability_hours_per_week: null,
availability_text: "",
address: { address: {
postcode: "", postcode: "",
city: "", city: "",

View File

@ -55,28 +55,10 @@ SPDX-License-Identifier: AGPL-3.0-or-later
</div> </div>
</Section> </Section>
<Section title="Verfügbarkeit"> <Section
<div class="d-flex align-items-center"> v-if="profile.availability"
<div v-if="profile.availability_status"> title="Verfügbarkeit">
<i class="bi bi-check-square me-1"></i> <div class="lh-base">{{ profile.availability }}</div>
ja
</div>
<div v-else>
<i class="bi bi-x-square me-1"></i>
nein
</div>
<span
class="ms-3"
v-if="profile.availability_status && profile.availability_hours_per_week">
({{ profile.availability_hours_per_week }} Stunden pro Woche)
</span>
</div>
<div v-if="profile.availability_text" class="mt-3">
<label class="form-label fw-bold">
Anmerkungen
</label>
<div>{{ profile.availability_text }}</div>
</div>
</Section> </Section>
<Section <Section
@ -130,8 +112,7 @@ export default {
}, },
methods: { methods: {
...mapActions({ ...mapActions({
loadProfile: 'profile/load', load: 'profile/load'
clearStore: 'profile/clear',
}) })
}, },
computed: { computed: {
@ -145,11 +126,8 @@ export default {
}, },
async created() { async created() {
const id = parseInt(this.$route.params.memberId, 10) const id = parseInt(this.$route.params.memberId, 10)
this.loadProfile(id) this.load(id)
}, }
unmounted() {
this.clearStore()
},
}; };
</script> </script>