+
@@ -16,20 +17,22 @@ import {mapState, mapMutations, mapActions, mapGetters} from 'vuex';
import AddTicketModal from "@/components/AddTicketModal.vue";
import AddBoxModal from "@/components/AddBoxModal.vue";
import AddEventModal from "@/components/AddEventModal.vue";
+import Lightbox from "@/components/Lightbox.vue";
export default {
name: 'app',
- components: {AddBoxModal, AddEventModal, Navbar, AddItemModal, AddTicketModal},
+ components: {Lightbox, AddBoxModal, AddEventModal, Navbar, AddItemModal, AddTicketModal},
computed: {
- ...mapState(['loadedItems', 'layout', 'toasts', 'showAddBoxModal', 'showAddEventModal']),
+ ...mapState(['loadedItems', 'layout', 'toasts', 'showAddBoxModal', 'showAddEventModal', 'lightboxHash']),
...mapGetters(['isLoggedIn']),
},
data: () => ({
addItemModalOpen: false,
- addTicketModalOpen: false
+ addTicketModalOpen: false,
}),
methods: {
- ...mapMutations(['removeToast', 'createToast', 'closeAddBoxModal', 'openAddBoxModal', 'closeAddEventModal']),
+ ...mapMutations(['removeToast', 'createToast', 'closeAddBoxModal', 'openAddBoxModal', 'closeAddEventModal',
+ 'openLightboxModalWith']),
...mapActions(['loadEvents', 'scheduleAfterInit']),
openAddItemModal() {
this.addItemModalOpen = true;
@@ -42,7 +45,7 @@ export default {
},
closeAddTicketModal() {
this.addTicketModalOpen = false;
- }
+ },
},
created: function () {
document.title = document.location.hostname;
diff --git a/web/src/components/inputs/InputCombo.vue b/web/src/components/inputs/InputCombo.vue
index 9a2c5fc..ed08c8d 100644
--- a/web/src/components/inputs/InputCombo.vue
+++ b/web/src/components/inputs/InputCombo.vue
@@ -43,11 +43,11 @@ export default {
props: ['label', 'model', 'nameKey', 'uniqueKey', 'options', 'onOptionAdd'],
data: ({options, model, nameKey, uniqueKey}) => ({
internalName: model[nameKey],
- selectedOption: options.filter(e => e[uniqueKey] == model[uniqueKey])[0],
+ selectedOption: options.filter(e => e[uniqueKey] === model[uniqueKey])[0],
addingOption: false
}),
computed: {
- isValid: ({options, nameKey, internalName}) => options.some(e => e[nameKey] == internalName),
+ isValid: ({options, nameKey, internalName}) => options.some(e => e[nameKey] === internalName),
sortedOptions: ({
options,
nameKey
@@ -56,7 +56,7 @@ export default {
watch: {
internalName(newValue) {
if (this.isValid) {
- if (!this.selectedOption || newValue != this.selectedOption[this.nameKey]) {
+ if (!this.selectedOption || newValue !== this.selectedOption[this.nameKey]) {
this.selectedOption = this.options.filter(e => e[this.nameKey] === newValue)[0];
}
this.model[this.nameKey] = this.selectedOption[this.nameKey];
diff --git a/web/src/store.js b/web/src/store.js
index 0e58874..74b9ea8 100644
--- a/web/src/store.js
+++ b/web/src/store.js
@@ -37,6 +37,7 @@ const store = createStore({
expiry: null,
},
+ lightboxHash: null,
thumbnailCache: {},
fetchedData: {
events: 0,
@@ -191,6 +192,9 @@ const store = createStore({
state.groups = groups;
state.fetchedData = {...state.fetchedData, groups: Date.now()};
},
+ openLightboxModalWith(state, hash) {
+ state.lightboxHash = hash;
+ },
openAddBoxModal(state) {
state.showAddBoxModal = true;
},
@@ -355,7 +359,7 @@ const store = createStore({
commit('replaceEvents', [...state.events.filter(e => e.id !== event_id)])
}
},
- async updateEvent({commit, dispatch, state}, {id, partial_event}){
+ async updateEvent({commit, dispatch, state}, {id, partial_event}) {
const {data, success} = await http.patch(`/2/events/${id}/`, partial_event, state.user.token);
if (success) {
commit('replaceEvents', [...state.events.filter(e => e.id !== id), data])
@@ -369,7 +373,6 @@ const store = createStore({
},
async changeEvent({dispatch, getters, commit}, eventName) {
await router.push({path: `/${eventName.slug}/${getters.getActiveView}/`});
- //dispatch('loadEventItems');
},
async changeView({getters}, link) {
await router.push({path: `/${getters.getEventSlug}/${link.path}/`});
diff --git a/web/src/views/Item.vue b/web/src/views/Item.vue
index 6671d2d..2afe462 100644
--- a/web/src/views/Item.vue
+++ b/web/src/views/Item.vue
@@ -8,15 +8,25 @@
-
id: {{ item.id }} box: {{
- item.box
- }}
+ id: {{ item.id }} box: {{ item.box }}
{{ item.description }}
-
+
@@ -26,7 +36,7 @@