stash
This commit is contained in:
parent
765a265e46
commit
6c65da0882
6 changed files with 95 additions and 11 deletions
|
@ -6,14 +6,7 @@
|
||||||
<a class="sidebar-toggle d-flex" @click="toggleSidebar">
|
<a class="sidebar-toggle d-flex" @click="toggleSidebar">
|
||||||
<i class="hamburger align-self-center"></i>
|
<i class="hamburger align-self-center"></i>
|
||||||
</a>
|
</a>
|
||||||
<form class="d-none d-sm-inline-block">
|
<SearchBox/>
|
||||||
<div class="input-group input-group-navbar">
|
|
||||||
<input type="text" class="form-control" placeholder="Search…" aria-label="Search">
|
|
||||||
<button class="btn" type="button">
|
|
||||||
<b-icon-search class="bi-valign-middle"></b-icon-search>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<div class="navbar-collapse collapse">
|
<div class="navbar-collapse collapse">
|
||||||
<ul class="navbar-nav navbar-align">
|
<ul class="navbar-nav navbar-align">
|
||||||
<Notifications :notifications="notifications"/>
|
<Notifications :notifications="notifications"/>
|
||||||
|
@ -38,16 +31,17 @@ import Messages from "@/components/Messages.vue";
|
||||||
import Footer from "@/components/Footer.vue";
|
import Footer from "@/components/Footer.vue";
|
||||||
import Sidebar from "@/components/Sidebar.vue";
|
import Sidebar from "@/components/Sidebar.vue";
|
||||||
import UserDropdown from "@/components/UserDropdown.vue";
|
import UserDropdown from "@/components/UserDropdown.vue";
|
||||||
|
import SearchBox from "@/components/SearchBox.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'BaseLayout',
|
name: 'BaseLayout',
|
||||||
components: {
|
components: {
|
||||||
|
SearchBox,
|
||||||
UserDropdown,
|
UserDropdown,
|
||||||
Sidebar,
|
Sidebar,
|
||||||
Footer,
|
Footer,
|
||||||
Messages,
|
Messages,
|
||||||
Notifications,
|
Notifications
|
||||||
...BIcons
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
hideSearch: {
|
hideSearch: {
|
||||||
|
|
|
@ -82,7 +82,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {mapGetters, mapMutations} from 'vuex';
|
|
||||||
import * as BIcons from "bootstrap-icons-vue";
|
import * as BIcons from "bootstrap-icons-vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
44
frontend/src/components/SearchBox.vue
Normal file
44
frontend/src/components/SearchBox.vue
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
<template>
|
||||||
|
<form class="d-none d-sm-inline-block">
|
||||||
|
<div class="input-group input-group-navbar">
|
||||||
|
<input type="text" class="form-control" placeholder="Search…" aria-label="Search" v-model="query" id="searchText">
|
||||||
|
<button class="btn" type="button" @click.prevent="search">
|
||||||
|
<b-icon-search class="bi-valign-middle"></b-icon-search>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import * as BIcons from "bootstrap-icons-vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "SearchBox",
|
||||||
|
components: {
|
||||||
|
...BIcons
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
query: ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
search() {
|
||||||
|
if(this.query.length > 0)
|
||||||
|
this.$router.push("/search/" + encodeURIComponent(this.query));
|
||||||
|
else
|
||||||
|
document.getElementById("searchText").focus();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
console.log(this.$route)
|
||||||
|
console.log(this.$route.params.query)
|
||||||
|
this.query = decodeURIComponent(this.$route.params.query || encodeURIComponent(""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -6,6 +6,8 @@
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a class="nav-link dropdown-toggle d-none d-sm-inline-block" href="#" @click="toggleDropdown">
|
<a class="nav-link dropdown-toggle d-none d-sm-inline-block" href="#" @click="toggleDropdown">
|
||||||
|
<img src="/assets/img/avatars/avatar.png" class="avatar img-fluid rounded mr-1"
|
||||||
|
alt="Charles Hall"/>
|
||||||
<span class="text-dark">
|
<span class="text-dark">
|
||||||
{{ username }}
|
{{ username }}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -3,8 +3,11 @@ import Dashboard from '@/views/Dashboard.vue';
|
||||||
import Login from '@/views/Login.vue';
|
import Login from '@/views/Login.vue';
|
||||||
import Register from '@/views/Register.vue';
|
import Register from '@/views/Register.vue';
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
|
import Profile from '@/views/Profile.vue';
|
||||||
|
import Settings from '@/views/Settings.vue';
|
||||||
import Friends from '@/views/Friends.vue';
|
import Friends from '@/views/Friends.vue';
|
||||||
import Inventory from '@/views/Inventory.vue';
|
import Inventory from '@/views/Inventory.vue';
|
||||||
|
import Search from '@/views/Search.vue';
|
||||||
import InventoryDetail from '@/views/InventoryDetail.vue';
|
import InventoryDetail from '@/views/InventoryDetail.vue';
|
||||||
import InventoryNew from '@/views/InventoryNew.vue';
|
import InventoryNew from '@/views/InventoryNew.vue';
|
||||||
import InventoryEdit from '@/views/InventoryEdit.vue';
|
import InventoryEdit from '@/views/InventoryEdit.vue';
|
||||||
|
@ -17,6 +20,7 @@ const routes = [
|
||||||
{path: '/inventory/:id/edit', component: InventoryEdit, meta: {requiresAuth: true}, props: true},
|
{path: '/inventory/:id/edit', component: InventoryEdit, meta: {requiresAuth: true}, props: true},
|
||||||
{path: '/inventory/new', component: InventoryNew, meta: {requiresAuth: true}},
|
{path: '/inventory/new', component: InventoryNew, meta: {requiresAuth: true}},
|
||||||
{path: '/friends', component: Friends, meta: {requiresAuth: true}},
|
{path: '/friends', component: Friends, meta: {requiresAuth: true}},
|
||||||
|
{path: '/search/:query', component: Search, meta: {requiresAuth: true}},
|
||||||
{path: '/login', component: Login, meta: {requiresAuth: false}},
|
{path: '/login', component: Login, meta: {requiresAuth: false}},
|
||||||
{path: '/register', component: Register, meta: {requiresAuth: false}},
|
{path: '/register', component: Register, meta: {requiresAuth: false}},
|
||||||
{path: '/:pathMatch(.*)*', redirect: '/'}
|
{path: '/:pathMatch(.*)*', redirect: '/'}
|
||||||
|
|
41
frontend/src/views/Search.vue
Normal file
41
frontend/src/views/Search.vue
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<template>
|
||||||
|
<BaseLayout>
|
||||||
|
<main class="content">
|
||||||
|
<div class="container-fluid p-0">
|
||||||
|
<h1 class="h3 mb-3">Blank Page</h1>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h5 class="card-title mb-0">Empty card</h5>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="logo">
|
||||||
|
<img src="/src/assets/icons/toolshed-48x48.png" alt="Toolshed logo">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</BaseLayout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {mapGetters, mapMutations} from 'vuex';
|
||||||
|
import * as BIcons from "bootstrap-icons-vue";
|
||||||
|
import BaseLayout from "@/components/BaseLayout.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Search',
|
||||||
|
components: {
|
||||||
|
...BIcons,
|
||||||
|
BaseLayout
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
Loading…
Reference in a new issue