Suche mit richtigen API Endpunkt, Suche in der Navbar, kleinigkeiten
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
137
src/App.vue
137
src/App.vue
@ -1,67 +1,110 @@
|
||||
<template>
|
||||
<header v-if="this.$route.path.includes('/s/')">
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">KI</a>
|
||||
<button @click="showMobileNavbar = !showMobileNavbar" class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse"
|
||||
:class="{
|
||||
'show': showMobileNavbar,
|
||||
}"
|
||||
id="navbarSupportedContent">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<router-link class="nav-link" :to="{path: `/s/search`}" active-class="active">Suche</router-link>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<router-link class="nav-link" :to="{path: `/s/profile/${memberId}`}" active-class="active">Mein Profil</router-link>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<router-link class="nav-link" :to="{path: `/s/profile-edit`}" active-class="active">Bearbeiten</router-link>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="btn btn-outline-danger" @click="logout()">Logout</button>
|
||||
<a class="nav-link active" aria-current="page" href="#"></a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="d-flex">
|
||||
<input class="form-control me-2" type="search" placeholder="Direkt Suchen" aria-label="Search">
|
||||
<button class="btn btn-outline-success" type="submit">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
|
||||
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
|
||||
</svg>
|
||||
<header v-if="this.$route.path.includes('/s/')">
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">KI</a>
|
||||
<button
|
||||
@click="showMobileNavbar = !showMobileNavbar"
|
||||
class="navbar-toggler"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#navbarSupportedContent"
|
||||
aria-controls="navbarSupportedContent"
|
||||
aria-expanded="false"
|
||||
aria-label="Toggle navigation"
|
||||
>
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<router-view/>
|
||||
<div
|
||||
class="collapse navbar-collapse"
|
||||
:class="{
|
||||
show: showMobileNavbar,
|
||||
}"
|
||||
id="navbarSupportedContent"
|
||||
>
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<router-link
|
||||
class="nav-link"
|
||||
:to="{ path: `/s/search` }"
|
||||
active-class="active"
|
||||
>Suche</router-link
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<router-link
|
||||
class="nav-link"
|
||||
:to="{ path: `/s/profile/${memberId}` }"
|
||||
active-class="active"
|
||||
>Mein Profil</router-link
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<router-link
|
||||
class="nav-link"
|
||||
:to="{ path: `/s/profile-edit` }"
|
||||
active-class="active"
|
||||
>Bearbeiten</router-link
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="btn btn-outline-danger" @click="logout()">
|
||||
Logout
|
||||
</button>
|
||||
<a class="nav-link active" aria-current="page" href="#"></a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="d-flex" @submit.prevent="searchRedirect()">
|
||||
<input
|
||||
class="form-control me-2"
|
||||
v-model="searchText"
|
||||
type="search"
|
||||
placeholder="Direkt Suchen"
|
||||
aria-label="Search"
|
||||
/>
|
||||
<button
|
||||
class="btn btn-outline-primary"
|
||||
type="submit"
|
||||
>
|
||||
<img
|
||||
src="/img/bootstrap-icons-1.5.0/search.svg"
|
||||
alt="Suche Icon"
|
||||
/>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<router-view />
|
||||
<footer>
|
||||
<a href="https://wtf-eg.de/impressum/" class="m-4">Impressum</a>
|
||||
<a href="https://wtf-eg.de/datenschutz/" class="m-4">Datenschutz</a>
|
||||
<a href="https://git.wtf-eg.de/kompetenzinventar" class="m-4">git(ea)</a>
|
||||
<a href="https://git.wtf-eg.de/kompetenzinventar/ki-frontend/issues/new" class="m-4">Problem Melden</a>
|
||||
</footer>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'App',
|
||||
name: "App",
|
||||
data() {
|
||||
return {
|
||||
showMobileNavbar: false,
|
||||
memberId: null
|
||||
memberId: null,
|
||||
searchText: "",
|
||||
};
|
||||
},
|
||||
created(){
|
||||
this.memberId = localStorage.getItem('user_id')
|
||||
created() {
|
||||
this.memberId = localStorage.getItem("user_id");
|
||||
},
|
||||
methods: {
|
||||
logout(){
|
||||
logout() {
|
||||
localStorage.clear();
|
||||
this.$router.push({ path: "/" });
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
searchRedirect() {
|
||||
this.$router.push({ path: `/s/search?text`, query: { query: this.searchText } } );
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
Reference in New Issue
Block a user