Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
feat: minor ui changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKanera committed Mar 3, 2021
1 parent 31b7c76 commit b08dbc1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/my-project/my-project.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.flex.justify-center.mb-4(v-if='thisSchoolYearRef')
.rounded-lg.shadow.bg-ps-secondary.flex.px-2
.text-ps-white.mr-2 Termín odevzdání:
.text-ps-green.text-lg {{ deadlineFormatted }}
.text-ps-green.text-lg {{ deadlineFormatted[deadlineFormatted.length - 1] === ":" ? deadlineFormatted.substr(0, deadlineFormatted.length - 1) : deadlineFormatted }}
.flex.flex-col.justify-between.items-stretch(class='lg:flex-row-reverse lg:items-start')
.my-project-user
.user-info
Expand Down
17 changes: 15 additions & 2 deletions pages/students.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template lang="pug">
.flex.flex-col.justify-center.m-4(class='md:m-20')
.flex.flex-col.justify-center.m-4(class='md:m-20 md:mt-8')
.flex.justify-center.mb-4
.rounded-lg.shadow.bg-ps-secondary.flex.px-2
.text-ps-white.mr-2 Termín odevzdání:
.text-ps-green.text-lg {{ deadlineFormatted[deadlineFormatted.length - 1] === ":" ? deadlineFormatted.substr(0, deadlineFormatted.length - 1) : deadlineFormatted }}
.self-start(v-if='proposals.length > 0')
span.text-2xl.text-ps-white.font-medium Projekty ke schválení
.flex.flex-col.mt-4.mb-8.flex-wrap.justify-between(v-if='proposals.length > 0', class='md:flex-row md:justify-start')
Expand Down Expand Up @@ -95,7 +99,7 @@
</template>

<script lang="ts">
import { defineComponent, ref, watchEffect, onMounted, onBeforeUnmount } from '@nuxtjs/composition-api';
import { defineComponent, ref, watchEffect, onMounted, onBeforeUnmount, computed } from '@nuxtjs/composition-api';
import { useMainStore } from '@/store';
import firebase from 'firebase/app';
Expand Down Expand Up @@ -180,10 +184,16 @@ export default defineComponent({
const pastDeadline = ref(true);
const currentYear = ref(new firebase.firestore.Timestamp(0, 0));
const reviewsDeadline = ref(new firebase.firestore.Timestamp(0, 0));
const deadlineFormatted = computed(() => `${reviewsDeadline.value.toDate().toLocaleDateString('cs-CZ')} ${reviewsDeadline.value.toDate().toLocaleTimeString('cs-CZ').substr(0, 5)}`);
onMounted(async () => {
// get system values - schoolYear and reviewsDeadline
try {
const systemData = (await firebase.firestore().collection('system').doc('schoolYear').get()).data();
reviewsDeadline.value = systemData?.reviewDeadline;
pastDeadline.value = firebase.firestore.Timestamp.now() > systemData?.reviewDeadline;
currentYear.value = systemData?.currentYear;
} catch (_) {
Expand Down Expand Up @@ -419,6 +429,8 @@ export default defineComponent({
const projectDocs = snapshots.docs;
const studentIds = snapshots.docs.map((projectDoc) => projectDoc.data().studentId);
if (!studentIds.length) return;
const studentsColection = await inArray(firebase.firestore().collection('users'), studentIds);
lastOther = projectDocs[projectDocs.length - 1];
Expand Down Expand Up @@ -513,6 +525,7 @@ export default defineComponent({
pastDeadline,
extern: mainStore.state.user.extern,
otherProjects,
deadlineFormatted,
};
},
});
Expand Down

0 comments on commit b08dbc1

Please sign in to comment.