Mercurial > gemma
annotate client/src/components/importoverview/Filters.vue @ 2968:8b32574bed09 unified_import
wip
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 01 Apr 2019 15:12:49 +0200 |
parents | 3c04c8e46bd4 |
children | c40540889b53 |
rev | line source |
---|---|
2579 | 1 <template> |
2 <div> | |
3 <button @click="setFilter('pending')" :class="pendingStyle"> | |
4 <translate>pending</translate> | |
5 </button> | |
6 <button @click="setFilter('failed')" :class="failedStyle"> | |
7 <translate>failed</translate> | |
8 </button> | |
9 <button @click="setFilter('accepted')" :class="acceptedStyle"> | |
10 <translate>accepted</translate> | |
11 </button> | |
12 <button @click="setFilter('declined')" :class="declinedStyle"> | |
13 <translate>declined</translate> | |
14 </button> | |
15 <button @click="setFilter('warning')" :class="warningStyle"> | |
16 <translate>warning</translate> | |
17 </button> | |
18 </div> | |
19 </template> | |
20 | |
21 <script> | |
2654
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
22 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
23 * without warranty, see README.md and license for details. |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
24 * |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
25 * SPDX-License-Identifier: AGPL-3.0-or-later |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
26 * License-Filename: LICENSES/AGPL-3.0.txt |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
27 * |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
28 * Copyright (C) 2018 by via donau |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
29 * – Österreichische Wasserstraßen-Gesellschaft mbH |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
30 * Software engineering by Intevation GmbH |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
31 * |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
32 * Author(s): |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
33 * Thomas Junk <thomas.junk@intevation.de> |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
34 */ |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
35 import { mapState } from "vuex"; |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
36 |
2579 | 37 export default { |
38 name: "importfilters", | |
39 methods: { | |
40 setFilter(name) { | |
41 if (this.loading) return; | |
2654
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
42 this.$store.commit("imports/toggleFilter", name); |
2579 | 43 } |
44 }, | |
45 computed: { | |
2654
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
46 ...mapState("imports", [ |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
47 "pending", |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
48 "failed", |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
49 "accepted", |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
50 "warning", |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
51 "declined" |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
52 ]), |
2579 | 53 pendingStyle() { |
54 return { | |
55 btn: true, | |
56 "btn-sm": true, | |
57 "btn-light": !this.pending, | |
58 "btn-secondary": this.pending | |
59 }; | |
60 }, | |
61 failedStyle() { | |
62 return { | |
63 "ml-2": true, | |
64 btn: true, | |
65 "btn-sm": true, | |
66 "btn-light": !this.failed, | |
67 "btn-secondary": this.failed | |
68 }; | |
69 }, | |
70 declinedStyle() { | |
71 return { | |
72 "ml-2": true, | |
73 btn: true, | |
74 "btn-sm": true, | |
75 "btn-light": !this.declined, | |
76 "btn-secondary": this.declined | |
77 }; | |
78 }, | |
79 acceptedStyle() { | |
80 return { | |
81 "ml-2": true, | |
82 btn: true, | |
83 "btn-sm": true, | |
84 "btn-light": !this.accepted, | |
85 "btn-secondary": this.accepted | |
86 }; | |
87 }, | |
88 warningStyle() { | |
89 return { | |
90 "ml-2": true, | |
91 btn: true, | |
92 "btn-sm": true, | |
93 "btn-light": !this.warning, | |
94 "btn-secondary": this.warning | |
95 }; | |
96 } | |
97 } | |
98 }; | |
99 </script> | |
100 | |
101 <style lang="scss" scoped></style> |