comparison client/src/application/Sidebar.vue @ 1245:36e8470daba2

fix: Consistent main menu structure We now have a consisten main menu structure. There are always all entries available. In case the user is in the "sysadmin context" and selects a point regarding the map, he is routed back to "/" and the according component is shown. Otherwise the reselection of an entry acts as before (toggling the visibility of said component).
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 21 Nov 2018 11:15:23 +0100
parents 1a5564655f2a
children 3c84035b1f1b
comparison
equal deleted inserted replaced
1244:162a790120c2 1245:36e8470daba2
10 <div class="menupoints" v-if="this.showSidebar"> 10 <div class="menupoints" v-if="this.showSidebar">
11 <router-link to="/" class="text-body d-flex flex-row nav-link"> 11 <router-link to="/" class="text-body d-flex flex-row nav-link">
12 <i class="fa fa-map-o align-self-center navicon"></i>Map 12 <i class="fa fa-map-o align-self-center navicon"></i>Map
13 </router-link> 13 </router-link>
14 <div class="d-flex flex-row nav-link"> 14 <div class="d-flex flex-row nav-link">
15 <i v-if="routeName == 'mainview'" class="fa fa-ship align-self-center navicon"></i> 15 <i class="fa fa-ship align-self-center navicon"></i>
16 <a 16 <a
17 class="text-body d-flex flex-row" 17 class="text-body d-flex flex-row"
18 v-if="routeName == 'mainview'"
19 href="#" 18 href="#"
20 @click="toggleContextBox('bottlenecks')" 19 @click="toggleContextBox('bottlenecks')"
21 >Bottlenecks</a> 20 >Bottlenecks</a>
22 </div> 21 </div>
23 <div v-if="isSysAdmin"> 22 <div v-if="isSysAdmin">
24 <hr> 23 <hr>
25 <div 24 <div class="nav-link d-flex menupadding text-muted">Administration</div>
26 v-if="routeName == 'mainview'"
27 class="nav-link d-flex menupadding text-muted"
28 >Administration</div>
29 </div> 25 </div>
30 <div v-if="isWaterwayAdmin"> 26 <div v-if="isWaterwayAdmin">
31 <div v-if="routeName == 'mainview'" class="d-flex flex-row nav-link"> 27 <div class="d-flex flex-row nav-link">
32 <i class="fa fa-upload align-self-center navicon"></i> 28 <i class="fa fa-upload align-self-center navicon"></i>
33 <a 29 <a
34 href="#" 30 href="#"
35 class="text-body" 31 class="text-body"
36 @click="toggleContextBox('imports')" 32 @click="toggleContextBox('imports')"
37 >Import soundingresults</a> 33 >Import soundingresults</a>
38 </div> 34 </div>
39 <div v-if="routeName == 'mainview'" class="d-flex flex-row nav-link"> 35 <div class="d-flex flex-row nav-link">
40 <i class="fa fa-list-ol align-self-center navicon"></i> 36 <i class="fa fa-list-ol align-self-center navicon"></i>
41 <a 37 <a
42 href="#" 38 href="#"
43 class="text-body" 39 class="text-body"
44 @click="toggleContextBox('staging')" 40 @click="toggleContextBox('staging')"
126 this.$store.commit("application/showUsermenu", false); 122 this.$store.commit("application/showUsermenu", false);
127 this.$store.commit("application/showSplitscreen", false); 123 this.$store.commit("application/showSplitscreen", false);
128 this.$router.push("/login"); 124 this.$router.push("/login");
129 }, 125 },
130 toggleContextBox(context) { 126 toggleContextBox(context) {
131 this.$store.commit( 127 const SHOW = context;
132 "application/showInContextBox", 128 const HIDE = null;
133 this.showInContextBox === context ? null : context 129 const isElementAlreadyShown = this.showInContextBox === context;
134 ); 130 let toggleState =
131 isElementAlreadyShown && this.routeName === "mainview" ? HIDE : SHOW;
132 this.$router.push("/");
133 this.$store.commit("application/showInContextBox", toggleState);
135 if (this.showInContextBox === context) { 134 if (this.showInContextBox === context) {
136 this.$store.commit("application/showSearchbar", true); 135 this.$store.commit("application/showSearchbar", true);
137 } else { 136 } else {
138 this.$store.commit( 137 this.$store.commit(
139 "application/showSearchbar", 138 "application/showSearchbar",