Reorganized entries table components.

This commit is contained in:
Andrew Lalis 2025-01-28 20:35:41 -05:00
parent 49a167fb68
commit 39e0c9ee6e
5 changed files with 29 additions and 20 deletions

View File

@ -8,10 +8,10 @@ import {
} from '@/api/classroom_compliance' } from '@/api/classroom_compliance'
import { useAuthStore } from '@/stores/auth' import { useAuthStore } from '@/stores/auth'
import { computed, onMounted, ref, watch, type Ref } from 'vue' import { computed, onMounted, ref, watch, type Ref } from 'vue'
import EntryTableCell from '@/apps/classroom_compliance/EntryTableCell.vue' import EntryTableCell from '@/apps/classroom_compliance/entries_table/EntryTableCell.vue'
import { RouterLink } from 'vue-router' import StudentScoreCell from '@/apps/classroom_compliance/entries_table/StudentScoreCell.vue'
import StudentScoreCell from '@/apps/classroom_compliance/StudentScoreCell.vue' import DateHeaderCell from '@/apps/classroom_compliance/entries_table/DateHeaderCell.vue'
import DateHeaderCell from '@/apps/classroom_compliance/DateHeaderCell.vue' import StudentNameCell from '@/apps/classroom_compliance/entries_table/StudentNameCell.vue'
const authStore = useAuthStore() const authStore = useAuthStore()
const props = defineProps<{ const props = defineProps<{
@ -232,13 +232,7 @@ function addAllEntriesForDate(dateStr: string) {
</thead> </thead>
<tbody> <tbody>
<tr v-for="student in students" :key="student.id"> <tr v-for="student in students" :key="student.id">
<!-- Student's name: --> <StudentNameCell :student="student" :class-id="classId" />
<td :class="{ 'student-removed': student.removed }">
<RouterLink :to="'/classroom-compliance/classes/' + classId + '/students/' + student.id"
class="student-link">
<span v-text="student.name"></span>
</RouterLink>
</td>
<!-- Desk Number: --> <!-- Desk Number: -->
<td v-if="assignedDesks" v-text="student.deskNumber"></td> <td v-if="assignedDesks" v-text="student.deskNumber"></td>
<!-- A cell for each entry in the table's date range: --> <!-- A cell for each entry in the table's date range: -->
@ -269,13 +263,4 @@ function addAllEntriesForDate(dateStr: string) {
border: 1px solid black; border: 1px solid black;
border-collapse: collapse; border-collapse: collapse;
} }
.student-link {
text-decoration: none;
color: inherit;
}
.student-removed {
text-decoration: line-through;
}
</style> </style>

View File

@ -0,0 +1,24 @@
<script setup lang="ts">
import type { EntriesResponseStudent } from '@/api/classroom_compliance';
defineProps<{
student: EntriesResponseStudent,
classId: number
}>()
</script>
<template>
<td :class="{ 'student-removed': student.removed }">
<RouterLink :to="'/classroom-compliance/classes/' + classId + '/students/' + student.id" class="student-link">
<span v-text="student.name"></span>
</RouterLink>
</td>
</template>
<style scoped>
.student-link {
text-decoration: none;
color: inherit;
}
.student-removed {
text-decoration: line-through;
}
</style>