Skip to content
Snippets Groups Projects
Commit f0ff74a6 authored by kristian.aars's avatar kristian.aars
Browse files

Updates QueuePosition design

parent 77fcf265
No related branches found
No related tags found
1 merge request!4Stud ass functions
Pipeline #172103 failed
<template> <template>
<div class="queue" v-if="studentQueue==null || studentQueue.length>0" > <div class="queue" v-if="studentQueue!=null && studentQueue.length>0" >
<ul> <ul>
<li v-for="student in this.studentQueue" :key="student.student_user_id"> <li v-for="(student, index) in this.sortedByTime" :key="index">
<Student :student="student" :show-remove-button="showToolButtons" :show-pick-button="showToolButtons" :on-pick-button-pressed="onPickButtonPressed" :on-remove-button-pressed="onRemoveButtonPressed"/> <Student :number="index+1" :student="student" :show-remove-button="showToolButtons" :show-pick-button="showToolButtons" :on-pick-button-pressed="onPickButtonPressed" :on-remove-button-pressed="onRemoveButtonPressed"/>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -37,6 +37,15 @@ export default { ...@@ -37,6 +37,15 @@ export default {
default: ()=>{} default: ()=>{}
} }
}, },
computed: {
sortedByTime() {
console.log(this.studentQueue)
return this.studentQueue.sort ((a, b) => {
return new Date(a.entry_time) - Date(b.entry_time)
});
}
}
} }
</script> </script>
......
<template> <template>
<div class="student box" :class="{ studentActive: student.active_student_assistant_id != -1 }"> <div class="student box" :class="{ studentActive: student.active_student_assistant_id != -1 }">
<h4>{{ student.student.first_name + " " + student.student.surname }}</h4> <div class="student-info-content">
<p>{{ student.queue_type }}</p> <h2><b>{{ "#" + number + " - " +student.student.first_name + " " + student.student.surname }}</b></h2>
<p>Assignment 1</p> <h3><i>Assignment {{ student.assignment_number }} - {{ student.queue_type }}</i></h3>
<div> <p><i>Entered queue at {{new Date(student.entry_time).toLocaleTimeString()}}</i></p>
<p><i>Currently getting help from {{ student.active_student_assistant_id }}</i></p>
</div>
<div class="student-button-content">
<button v-if="showPickButton" @click="pickButtonPressed">Pick</button> <button v-if="showPickButton" @click="pickButtonPressed">Pick</button>
<button v-if="showRemoveButton" @click="removeButtonPressed">Remove</button> <button v-if="showRemoveButton" @click="removeButtonPressed">Remove</button>
</div> </div>
...@@ -13,6 +17,9 @@ ...@@ -13,6 +17,9 @@
<script> <script>
export default { export default {
props: { props: {
number: {
required: true,
},
student : { student : {
required: true, required: true,
type: Object type: Object
...@@ -49,19 +56,66 @@ export default { ...@@ -49,19 +56,66 @@ export default {
<style scoped> <style scoped>
.student-info-content p, h3, h4 {
margin: 0;
padding: 0;
}
.student-info-content h4 {
padding-bottom: 16px;
margin-top: 8px;
}
.student-info-content {
text-align: left;
}
.student-button-content {
display: grid;
grid-auto-flow: row;
}
.student { .student {
margin: 20px auto; margin: 20px auto;
background: white; background: white;
padding: 10px 20px 20px; padding: 10px 20px 20px;
border-left: 6px solid #9f9f9f; border-left: 6px solid #9f9f9f;
display: flex; display: grid;
flex-direction: row; grid-auto-flow: column;
justify-content: space-between;
align-items: center;
} }
.studentActive { .studentActive {
border-left: 8px solid #00e94e; border-left: 8px solid #00e94e;
} }
@media only screen and (min-width: 768px) and (max-width: 1268px) {
.student {
grid-auto-flow: row;
grid-column-gap: 10px;
}
.student-button-content {
grid-auto-flow: column;
grid-column-gap: 10px;
}
}
@media only screen and (max-width: 768px) {
.student {
grid-auto-flow: row;
grid-column-gap: 10px;
}
.student-button-content {
grid-auto-flow: column;
grid-column-gap: 10px;
}
}
</style> </style>
<template> <template>
<h1>Student Assistant Queue-Panel</h1> <h1>Student Assistant Queue-Panel</h1>
<h2>{{subject_name}}</h2> <h2>{{subject_name + " - " + subject_code}}</h2>
<div class="StudentAssistantQueueViewContainer"> <div class="StudentAssistantQueueViewContainer">
...@@ -31,6 +31,7 @@ export default { ...@@ -31,6 +31,7 @@ export default {
subject: null, subject: null,
queuePositions: null, queuePositions: null,
subject_name: null, subject_name: null,
subject_code: null,
currentQueuePosition: null, currentQueuePosition: null,
ownUserId: null ownUserId: null
} }
...@@ -42,6 +43,7 @@ export default { ...@@ -42,6 +43,7 @@ export default {
SubjectQueueService.getSubject(this.getSubjectCode, this.getSemester, this.$store.state.token). SubjectQueueService.getSubject(this.getSubjectCode, this.getSemester, this.$store.state.token).
then(ans => { then(ans => {
this.subject_name = ans.data.subjectInfo.name this.subject_name = ans.data.subjectInfo.name
this.subject_code = ans.data.subjectInfo.subject_code
this.subject = ans.data this.subject = ans.data
this.timer = setInterval(this.updateQueueData, 500); this.timer = setInterval(this.updateQueueData, 500);
...@@ -121,9 +123,9 @@ export default { ...@@ -121,9 +123,9 @@ export default {
@media only screen and (max-width: 768px) { @media only screen and (max-width: 768px) {
.StudentAssistantQueueViewContainer { .StudentAssistantQueueViewContainer {
grid-template-columns: none;
grid-auto-flow: row; grid-auto-flow: row;
grid-column-gap: 10px; grid-column-gap: 10px;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment