diff --git a/src/config.json b/src/config.json index 8734870b9d0243f2dd9b930e36a88c9ddb1c14d4..1db1a7d999a178d363fc90aaba6bb2b51a7fb349 100644 --- a/src/config.json +++ b/src/config.json @@ -1,5 +1,21 @@ { "apiUrl": "https://amiv-api.ethz.ch/", + "Events": { + "keyDescriptors": { + "title_de": "Titel in Deutsch", + "title_en": "Title in English", + "location": "Location (Ort) of the event", + "allow_email_signup": "Event open for non-AMIV members", + "show_website": "Event is shown on the website", + "priority": "TODO: What type of priority is meant here? Edit priority? Organization prio?" + }, + "tableKeys": [ + "title_de", + "location", + "show_website", + "priority" + ] + }, "Users": { "keyDescriptors": { "legi": "Legi Number", diff --git a/src/eventTool.js b/src/eventTool.js index a511fca89bd7cbc03ef5a3bc8c61f6d88e8e3e0d..69898690baa09e6bd75870fc8c91acbe56ff420d 100644 --- a/src/eventTool.js +++ b/src/eventTool.js @@ -1,13 +1,13 @@ import { ItemView } from './views/itemView'; import { EditView, inputGroup, selectGroup, submitButton } from './views/editView'; import TableView from './views/tableView'; -import { Users as config } from './config.json'; +import { Events as config } from './config.json'; const m = require('mithril'); class EventView extends ItemView { constructor() { - super('event'); + super('events'); this.memberships = []; } @@ -57,9 +57,6 @@ class EventView extends ItemView { embedded: { event: 1 }, }, }), - m(TableView, { - resource: '', - }), ]); } } @@ -130,7 +127,7 @@ export class NewEvent extends EventEdit { }; this.valid = false; - // if the creation is finished, UI should switch to new User + // if the creation is finished, UI should switch to new Event this.callback = (response) => { m.route.set(`/events/${response.data._id}`); }; } @@ -170,7 +167,7 @@ export class EventModal { export class EventTable { view() { return m(TableView, { - resource: 'users', + resource: 'events', keys: config.tableKeys, titles: config.tableKeys.map(key => config.keyDescriptors[key] || key), });