|
38 | 38 |
|
39 | 39 | ul.row.nav.nav-tabs.mt-3.px-3 |
40 | 40 | li.nav-item(v-for="view in views") |
41 | | - router-link.nav-link(:to="{ name: 'activity-view', params: {...$route.params, view_id: view.id}}") |
| 41 | + router-link.nav-link(:to="{ name: 'activity-view', params: {...$route.params, view_id: view.id}}" :class="{'router-link-exact-active': currentView.id == view.id}") |
42 | 42 | h6 {{view.name}} |
43 | | - li.nav-item |
44 | | - router-link.nav-link(:to="{ name: 'activity-editor', params: $route.params }") |
45 | | - h6 Editor |
| 43 | + |
46 | 44 | li.nav-item(style="margin-left: auto") |
47 | 45 | a.nav-link(@click="addView") |
48 | 46 | h6 |
49 | 47 | icon(name="plus") |
50 | | - span New view |
| 48 | + span.d-none.d-md-inline |
| 49 | + | New view |
51 | 50 |
|
52 | 51 | div |
53 | 52 | router-view |
54 | 53 |
|
55 | 54 | div |
| 55 | + hr |
56 | 56 | h5 Options |
57 | 57 |
|
58 | 58 | div.row |
59 | 59 | div.col-md-6 |
60 | | - b-form-group(label="Show category" label-cols="5" label-cols-lg="4") |
| 60 | + b-form-group(label="Show/filter category" label-cols="5" label-cols-lg="4") |
61 | 61 | b-form-select(v-model="filterCategory", :options="categories") |
62 | 62 |
|
63 | 63 | aw-devonly |
@@ -110,6 +110,9 @@ import 'vue-awesome/icons/arrow-left'; |
110 | 110 | import 'vue-awesome/icons/arrow-right'; |
111 | 111 | import 'vue-awesome/icons/sync'; |
112 | 112 | import 'vue-awesome/icons/plus'; |
| 113 | +import 'vue-awesome/icons/edit'; |
| 114 | +import 'vue-awesome/icons/times'; |
| 115 | +import 'vue-awesome/icons/save'; |
113 | 116 |
|
114 | 117 | export default { |
115 | 118 | name: 'Activity', |
@@ -138,6 +141,9 @@ export default { |
138 | 141 | views: function () { |
139 | 142 | return this.$store.state.settings.views; |
140 | 143 | }, |
| 144 | + currentView: function () { |
| 145 | + return this.views.find(v => v.id == this.$route.params.view_id) || this.views[0]; |
| 146 | + }, |
141 | 147 | _date: function () { |
142 | 148 | return this.date || get_today(); |
143 | 149 | }, |
@@ -210,6 +216,7 @@ export default { |
210 | 216 | methods: { |
211 | 217 | addView: function () { |
212 | 218 | // TODO: Open modal to ask for options like id, and name |
| 219 | + // FIXME: view_id is not guaranteed to be unique |
213 | 220 | this.$store.commit('settings/addView', { |
214 | 221 | view_id: this.$store.state.settings.views.length + 1, |
215 | 222 | }); |
|
0 commit comments