Compare commits
2 Commits
f36d55ebc8
...
fix/npm-up
Author | SHA1 | Date | |
---|---|---|---|
dc883ac302
|
|||
16feb41f8a |
14478
package-lock.json
generated
14478
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -7,10 +7,10 @@
|
|||||||
"lint": "vue-cli-service lint"
|
"lint": "vue-cli-service lint"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-plugin-babel": "~4.5.0",
|
"@vue/cli-plugin-babel": "^4.5.0",
|
||||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
"@vue/cli-plugin-eslint": "^4.5.0",
|
||||||
"@vue/cli-plugin-router": "~4.5.0",
|
"@vue/cli-plugin-router": "^4.5.0",
|
||||||
"@vue/cli-service": "~4.5.0",
|
"@vue/cli-service": "^4.5.0",
|
||||||
"@vue/compiler-sfc": "^3.0.0",
|
"@vue/compiler-sfc": "^3.0.0",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"bootstrap": "^5.0.1",
|
"bootstrap": "^5.0.1",
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
<!--
|
|
||||||
SPDX-FileCopyrightText: WTF Kooperative eG <https://wtf-eg.de/>
|
|
||||||
|
|
||||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<ul class="pagination">
|
|
||||||
<li
|
|
||||||
class="page-item"
|
|
||||||
:class="{ active: page === current }"
|
|
||||||
v-for="page in pages"
|
|
||||||
:key="page"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="page-link pointer"
|
|
||||||
@click="onPageClicked(page)"
|
|
||||||
>
|
|
||||||
{{ page }}
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'Paginator',
|
|
||||||
props: {
|
|
||||||
page: Number,
|
|
||||||
current: Number,
|
|
||||||
pages: Number
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
onPageClicked(page) {
|
|
||||||
if (page == this.current) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$emit('page', page)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
.pointer {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -12,10 +12,8 @@ export default {
|
|||||||
profiles: [],
|
profiles: [],
|
||||||
error: false,
|
error: false,
|
||||||
errorMessage: '',
|
errorMessage: '',
|
||||||
pages: 1,
|
|
||||||
query: {
|
query: {
|
||||||
search: '',
|
search: ''
|
||||||
page: 1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -43,12 +41,6 @@ export default {
|
|||||||
},
|
},
|
||||||
setQuerySearch(state, search) {
|
setQuerySearch(state, search) {
|
||||||
state.query.search = search
|
state.query.search = search
|
||||||
},
|
|
||||||
setPages(state, pages) {
|
|
||||||
state.pages = pages
|
|
||||||
},
|
|
||||||
setQueryPage(state, page) {
|
|
||||||
state.query.page = page
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
@ -73,8 +65,6 @@ export default {
|
|||||||
url.searchParams.append('search', state.query.search)
|
url.searchParams.append('search', state.query.search)
|
||||||
}
|
}
|
||||||
|
|
||||||
url.searchParams.append('page', state.query.page)
|
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
Authorization: `Bearer ${rootState.token}`,
|
Authorization: `Bearer ${rootState.token}`,
|
||||||
}
|
}
|
||||||
@ -103,7 +93,6 @@ export default {
|
|||||||
|
|
||||||
const responseData = await response.json()
|
const responseData = await response.json()
|
||||||
commit('setProfiles', responseData.profiles)
|
commit('setProfiles', responseData.profiles)
|
||||||
commit('setPages', responseData.pages)
|
|
||||||
commit('setSearching', false)
|
commit('setSearching', false)
|
||||||
commit('hideSpinner')
|
commit('hideSpinner')
|
||||||
}
|
}
|
||||||
|
@ -53,26 +53,12 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
|||||||
<p v-if="searchText !== ''">Probiere eine andere Suche.</p>
|
<p v-if="searchText !== ''">Probiere eine andere Suche.</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="showResults">
|
<div v-else-if="showResults">
|
||||||
<div class="d-flex justify-content-around">
|
|
||||||
<Paginator
|
|
||||||
:pages="pages"
|
|
||||||
:current="currentPage"
|
|
||||||
@page="handlePageSelected"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<SearchResult
|
<SearchResult
|
||||||
v-for="profile in profiles"
|
v-for="profile in profiles"
|
||||||
:key="profile.user_id"
|
:key="profile.user_id"
|
||||||
class="mb-3"
|
class="mb-3"
|
||||||
:profile="profile"
|
:profile="profile"
|
||||||
/>
|
/>
|
||||||
<div class="d-flex justify-content-around">
|
|
||||||
<Paginator
|
|
||||||
:pages="pages"
|
|
||||||
:current="currentPage"
|
|
||||||
@page="handlePageSelected"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -81,29 +67,21 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
|||||||
<script>
|
<script>
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
import Paginator from '@/components/Paginator'
|
|
||||||
import SearchResult from '@/components/SearchResult'
|
import SearchResult from '@/components/SearchResult'
|
||||||
import Spinner from '@/components/Spinner'
|
import Spinner from '@/components/Spinner'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Search',
|
name: 'Search',
|
||||||
components: {
|
components: {
|
||||||
Paginator,
|
|
||||||
SearchResult,
|
SearchResult,
|
||||||
Spinner,
|
Spinner,
|
||||||
},
|
},
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
textChanged: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
searching: state => state.search.searching,
|
searching: state => state.search.searching,
|
||||||
profiles: state => state.search.profiles,
|
profiles: state => state.search.profiles,
|
||||||
error: state => state.search.error,
|
error: state => state.search.error,
|
||||||
showSpinner: state => state.search.showSpinner,
|
showSpinner: state => state.search.showSpinner,
|
||||||
pages: state => state.search.pages,
|
|
||||||
}),
|
}),
|
||||||
searchText: {
|
searchText: {
|
||||||
get() {
|
get() {
|
||||||
@ -111,15 +89,6 @@ export default {
|
|||||||
},
|
},
|
||||||
set(text) {
|
set(text) {
|
||||||
this.$store.commit('search/setQuerySearch', text)
|
this.$store.commit('search/setQuerySearch', text)
|
||||||
this.textChanged = true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
currentPage: {
|
|
||||||
get() {
|
|
||||||
return this.$store.state.search.query.page
|
|
||||||
},
|
|
||||||
set(page) {
|
|
||||||
this.$store.commit('search/setQueryPage', page)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showNoResults() {
|
showNoResults() {
|
||||||
@ -140,24 +109,13 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
if (this.textChanged === true) {
|
this.$router.push({ query: { query: this.searchText }})
|
||||||
this.$store.commit('search/setQueryPage', 1)
|
|
||||||
}
|
|
||||||
this.pushState()
|
|
||||||
this.$store.dispatch('search/search')
|
this.$store.dispatch('search/search')
|
||||||
},
|
},
|
||||||
focusSearchText() {
|
focusSearchText() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.searchTextInput.focus()
|
this.$refs.searchTextInput.focus()
|
||||||
})
|
})
|
||||||
},
|
|
||||||
handlePageSelected(page) {
|
|
||||||
this.currentPage = page
|
|
||||||
this.pushState()
|
|
||||||
this.$store.dispatch('search/search')
|
|
||||||
},
|
|
||||||
pushState() {
|
|
||||||
this.$router.push({ query: { query: this.searchText, page: this.currentPage }})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -75,7 +75,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
|||||||
<label class="form-label fw-bold">
|
<label class="form-label fw-bold">
|
||||||
Anmerkungen
|
Anmerkungen
|
||||||
</label>
|
</label>
|
||||||
<div>{{ profile.availability_text }}</div>
|
<div class="line-break-text">{{ profile.availability_text }}</div>
|
||||||
</div>
|
</div>
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
@ -98,11 +98,11 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
|||||||
title="Sonstiges">
|
title="Sonstiges">
|
||||||
<div v-if="profile.freetext" :class="{ 'lh-base': true, 'mb-4': profile.volunteerwork }">
|
<div v-if="profile.freetext" :class="{ 'lh-base': true, 'mb-4': profile.volunteerwork }">
|
||||||
<h5>Über mich</h5>
|
<h5>Über mich</h5>
|
||||||
{{ profile.freetext }}
|
<div class="line-break-text">{{ profile.freetext }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="profile.volunteerwork" class="lh-base">
|
<div v-if="profile.volunteerwork" class="lh-base">
|
||||||
<h5>Ehrenamtliche Arbeit</h5>
|
<h5>Ehrenamtliche Arbeit</h5>
|
||||||
{{ profile.volunteerwork }}
|
<div class="line-break-text">{{ profile.volunteerwork }}</div>
|
||||||
</div>
|
</div>
|
||||||
</Section>
|
</Section>
|
||||||
</template>
|
</template>
|
||||||
@ -154,4 +154,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.line-break-text{
|
||||||
|
white-space: pre-line;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Reference in New Issue
Block a user