({
@@ -35,7 +37,7 @@ export default {
socket_toast: null,
}),
methods: {
- ...mapMutations(['removeToast', 'createToast']),
+ ...mapMutations(['removeToast', 'createToast', 'closeAddBoxModal', 'openAddBoxModal']),
...mapActions(['loadEventItems', 'loadTickets']),
openAddItemModal() {
this.addItemModalOpen = true;
diff --git a/web/src/components/AddBoxModal.vue b/web/src/components/AddBoxModal.vue
new file mode 100644
index 0000000..228f117
--- /dev/null
+++ b/web/src/components/AddBoxModal.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/src/components/AddTicketModal.vue b/web/src/components/AddTicketModal.vue
index b7a29fe..99913d7 100644
--- a/web/src/components/AddTicketModal.vue
+++ b/web/src/components/AddTicketModal.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/web/src/components/Table.vue b/web/src/components/Table.vue
index 8b1c7d7..b9e3619 100644
--- a/web/src/components/Table.vue
+++ b/web/src/components/Table.vue
@@ -24,14 +24,16 @@
>
- |
+
+
+ |
{{ item[column] }} |
-
+
|
diff --git a/web/src/router.js b/web/src/router.js
index 9dbf8a1..7021465 100644
--- a/web/src/router.js
+++ b/web/src/router.js
@@ -15,6 +15,7 @@ import store from "@/store";
import Empty from "@/views/Empty.vue";
import Events from "@/views/admin/Events.vue";
import AccessControl from "@/views/admin/AccessControl.vue";
+import {default as BoxesAdmin} from "@/views/admin/Boxes.vue"
Vue.use(VueRouter);
diff --git a/web/src/store/index.js b/web/src/store/index.js
index 99e9e28..a64b214 100644
--- a/web/src/store/index.js
+++ b/web/src/store/index.js
@@ -79,6 +79,7 @@ const store = new Vuex.Store({
state_options: [],
token_expiry: null,
local_loaded: false,
+ showAddBoxModal: false,
},
getters: {
getEventSlug: state => state.route && state.route.params.event ? state.route.params.event : state.lastEvent,
@@ -153,6 +154,12 @@ const store = new Vuex.Store({
const ticket = state.tickets.filter(({id}) => id === updatedTicket.id)[0];
Object.assign(ticket, updatedTicket);
},
+ openAddBoxModal(state) {
+ state.showAddBoxModal = true;
+ },
+ closeAddBoxModal(state) {
+ state.showAddBoxModal = false;
+ },
createToast(state, {title, message, color}) {
var toast = {title, message, color, key: state.keyIncrement}
state.toasts.push(toast);
@@ -301,6 +308,13 @@ const store = new Vuex.Store({
const {data} = await axios.get('/2/boxes/');
commit('replaceBoxes', data);
},
+ async createBox({commit, dispatch}, box) {
+ const {data} = await axios.post('/2/boxes/', box);
+ commit('replaceBoxes', data);
+ dispatch('loadBoxes').then(() => {
+ commit('closeAddBoxModal');
+ });
+ },
async updateItem({commit, getters}, item) {
const {data} = await axios.put(`/2/${getters.getEventSlug}/item/${item.uid}/`, item);
commit('updateItem', data);
diff --git a/web/src/views/admin/Admin.vue b/web/src/views/admin/Admin.vue
index dd66a5d..0ccbf06 100644
--- a/web/src/views/admin/Admin.vue
+++ b/web/src/views/admin/Admin.vue
@@ -11,6 +11,9 @@
Events
+
+ Boxes
+
Access Control
diff --git a/web/src/views/admin/Boxes.vue b/web/src/views/admin/Boxes.vue
index 61e8727..94eb68e 100644
--- a/web/src/views/admin/Boxes.vue
+++ b/web/src/views/admin/Boxes.vue
@@ -3,28 +3,38 @@
:columns="['cid', 'name','itemCount']"
:items="loadedBoxes"
:keyName="'cid'"
- v-slot="{ item }"
>
-
-
+
+
+
+
+ content
+
+
+
+
+
+