Skip to content

Commit

Permalink
Merge pull request sjrumsby#157 from sjrumsby/sprint-3
Browse files Browse the repository at this point in the history
Sprint 3
  • Loading branch information
gil0109 authored Jan 9, 2019
2 parents 2a4f25f + 5f27e87 commit baa6eaf
Show file tree
Hide file tree
Showing 16 changed files with 351 additions and 286 deletions.
2 changes: 1 addition & 1 deletion api/app/models/bookings/exam.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Exam(Base):
number_of_students = db.Column(db.Integer, nullable=True)
exam_method = db.Column(db.String(15), nullable=False)
deleted_date = db.Column(db.String(50), nullable=True)
exam_returned_ind = db.Column(db.Integer, nullable=False)
exam_returned_ind = db.Column(db.Integer, nullable=False, default=0)
exam_returned_tracking_number = db.Column(db.String(50), nullable=True)

booking = db.relationship("Booking")
Expand Down
173 changes: 97 additions & 76 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-html": "^3.0.0",
"eslint-plugin-vue": "^5.1.0",
"eventsource-polyfill": "^0.9.6",
"express": "^4.16.4",
"extract-text-webpack-plugin": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ limitations under the License.*/
...mapMutations(['updateViewportSizes']),
getSize() {
this.x = window.innerWidth
this.y = window.innerHeight - 78 - 40
this.y = window.innerHeight - 110
this.updateStore()
},
updateStore() {
Expand Down
62 changes: 43 additions & 19 deletions frontend/src/agenda/agenda.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
<full-calendar ref="agendacal"
key="agendacal"
class="q-calendar-margins"
@view-render="viewRender"
@event-render="eventRender"
@view-render="viewRender"
:events="events"
:config="configuration"></full-calendar>
</keep-alive>
</div>

</template>

<script>
Expand All @@ -31,7 +30,7 @@
this.$root.$on('listDay', () => { this.listDay() })
},
destroyed() {
this.setCalendarTitle(null)
this.setCalendarSetup(null)
},
data() {
return {
Expand All @@ -43,6 +42,8 @@
navLinks: true,
defaultView: 'listWeek',
resources: [],
listDayFormat: 'dddd, MMM Do',
listDayAltFormat: '[Invigilator]',
views: {
listDay: {
allDaySlot: false,
Expand All @@ -64,7 +65,7 @@
},
computed: {
...mapGetters(['calendar_events', 'room_resources']),
...mapState(['exams', 'viewPortSizes', 'calendarTitle']),
...mapState(['exams', 'viewPortSizes', 'calendarSetup']),
events() {
if (this.calendar_events.length > 0) {
return this.calendar_events
Expand All @@ -75,9 +76,8 @@
methods: {
...mapActions(['initializeAgenda', 'getBookings']),
...mapMutations([
'setCalendarTitle',
'setCalendarSetup',
'toggleBookRoomModal',
'setCalendarView'
]),
initialize() {
this.initializeAgenda().then( rooms => {
Expand All @@ -92,25 +92,42 @@
this.getBookings()
})
},
eventRender(event, element, view) {
/* eventRender(event, element, view) {
if (view.name === 'listWeek' || view.name === 'listDay') {
let resTitle = this.room_resources.find(res => res.id == event.resourceId).title
let examObj = this.exams.find(exam => exam.booking_id == event.resourceId)
let invigilator = 'none'
if (examObj && examObj.invigilator&& examObj.invigilator.invigilator_name) {
invigilator = examObj.invigilator.invigilator_name
}
element.find('.fc-list-item-marker').replaceWith(`<td>${resTitle} - ${event.title}</td>`)
let resTitle = event.room.room_name
element.find('.fc-list-item-marker').replaceWith(`
<td>
<b-badge class="mr-2" style="background-color: ${event.room.color}">
<span style="color: ${event.room.color}">O</span>
</b-badge> ${resTitle} - ${event.title}</td>`)
element.find('.fc-list-item-title').replaceWith(
`<td style="text-align: right">Invigilator: ${invigilator}</td>`
`<td style="text-align: right">Invigilator: kk</td>`
)
}
},
viewRender(view, el) {
this.setCalendarTitle({ title: view.title, view: view.name })
element.find('tr.fc-list-heading').replaceWith(null)
},*/
/*viewRender(view, el) {
this.setCalendarSetup({ title: view.title, view: view.name })
if (view.name === 'basicDay') {
this.$refs.agendacal.fireMethod('changeView', 'listDay')
}*/
viewRender(view, el) {
this.setCalendarSetup({ title: view.title, view: view.name })
},
eventRender(event, el, view) {
let title = event.title
let room = event.room.room_name
let invig = '(none)'
if (event.invigilator && event.invigilator.invigilator_name) {
invig = event.invigilator.invigilator_name
}
el.find('td.fc-list-item-title.fc-widget-content').html(
`<div style="display: flex; justify-content: space-between; width: 100%;">
<div>${room} - <span style="font-weight: 600; font-size: .9rem">${title}</span></div>
<div>${invig}</div>
</div>
`
)
},
next() {
this.$refs.agendacal.fireMethod('next')
Expand All @@ -129,4 +146,11 @@
},
}
}
</script>
</script>

<style scoped>
.exam-title {
font-weight: 500 !important;
font-size: 1rem !important;
}
</style>
Loading

0 comments on commit baa6eaf

Please sign in to comment.