Skip to content

Commit

Permalink
Enabled override to be set as an exam
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGoumX committed Feb 22, 2020
1 parent 0fa7a01 commit fac949b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
28 changes: 24 additions & 4 deletions src/components/UnscheduledLessons/UnscheduledLessons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@
</div>
</div>
<div class="row pt-3">
<div class="col col-lg-6">
<div class="col col-lg-5">
<b-form-input type="datetime-local" v-model="start" v-bind:placeholder="this.$t('message.ecStart')"></b-form-input>
</div>
<div class="col col-lg-6">
<div class="col col-lg-5">
<b-form-input type="datetime-local" v-model="end" v-bind:placeholder="this.$t('message.ecEnd')"></b-form-input>
</div>
<div class="col col-lg-2">
<multiselect v-model="isOverrideExam" v-bind:placeholder="this.$t('message.ecIsExam')"
:close-on-select="false" :options="isExamsOptions" :multiple="false"
v-bind:select-label="this.$t('message.ecSelect')" v-bind:deselect-label="this.$t('message.ecDeselect')">
<span slot="noResult">Oops! No elements found. Consider changing the search query.</span>
</multiselect>
</div>
</div>
<div class="row pt-3">
<div class="col">
Expand Down Expand Up @@ -65,6 +72,7 @@
created() {
this.loadRooms();
this.loadExamsOptions();
this.fetchUnscheduled();
},
Expand All @@ -75,6 +83,7 @@
start: '',
end: '',
date: '',
isOverrideExam: null,
roomOptions: [],
room: '',
unscheduledLessons: [],
Expand All @@ -85,6 +94,7 @@
{ key: 'start', label: this.$t('message.ecStart'), formatter: "transformTimestamp" },
{ key: 'end', label: this.$t('message.ecEnd'), formatter: "transformTimestamp" },
{ key: 'room', label: this.$t('message.ecSelectRooms')},
{ key: 'isExam', label: this.$t('message.ecIsExam')},
],
exam: {
title: '',
Expand All @@ -96,7 +106,8 @@
semester: 0,
department: '',
extraDepartments: []
}
},
isExamsOptions: []
}
},
Expand All @@ -108,6 +119,7 @@
start : this.start,
end : this.end,
rooms : this.room,
isExam : this.isOverrideExam === this.$t('message.optionYes')
};
this.unscheduledLessons.push(newExam);
axios({
Expand All @@ -122,7 +134,8 @@
start: new Date(this.start)/1000,
end: new Date(this.end)/1000,
title: this.title,
host: this.host
host: this.host,
isExam : this.isOverrideExam === this.$t('message.optionYes')
}
}).then(() => {
this.clearForm();
Expand All @@ -136,6 +149,7 @@
this.start = '';
this.end = '';
this.room = '';
this.isExamsOptions = null;
},
checkEntry: function (e) {
Expand Down Expand Up @@ -182,6 +196,11 @@
});
},
loadExamsOptions: function() {
this.isExamsOptions.push(this.$t('message.optionYes'));
this.isExamsOptions.push(this.$t('message.optionNo'));
},
fetchUnscheduled: function () {
axios({
method: 'get',
Expand Down Expand Up @@ -220,6 +239,7 @@
end: this.selectedRow[0].end,
title: this.selectedRow[0].title,
host: this.selectedRow[0].host,
isExam: this.selectedRow[0].isExam,
}
}).then(() => {
this.fetchUnscheduled();
Expand Down
10 changes: 8 additions & 2 deletions src/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ export default {
ecAddLesson: "Add Lesson",
Welcome: "Welcome to Moniteur Administration!",
WelcomeSidebar: "Open the sidebar to select a function!",
adminHome: "Home"
adminHome: "Home",
optionYes: "Yes",
optionNo: "No",
ecIsExam: "Exam"
}
},
el: {
Expand Down Expand Up @@ -208,7 +211,10 @@ export default {
ecAddLesson: "Προσθήκη Μαθήματος",
Welcome: "Καλώς ήλθατε στην διαχείριση του Moniteur!",
WelcomeSidebar: "Ανοίχτε το sidebar για να επιλέξετε λειτουργία!",
adminHome: "Home"
adminHome: "Home",
optionYes: "Ναι",
optionNo: "Όχι",
ecIsExam: "Εξέταση"
}
}
};

0 comments on commit fac949b

Please sign in to comment.