Compare commits
121 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 375712c0a8 | |||
| 0b7ab5923c | |||
| d077818508 | |||
| c991b75384 | |||
| 9f59f517b5 | |||
| 6654f78486 | |||
| 206fef682f | |||
| 3e454423a1 | |||
| 8326a9e923 | |||
| 5013830815 | |||
| e4ba53f460 | |||
| fabdc10467 | |||
| 91488c6a9f | |||
| f346364633 | |||
| 34e482e8a9 | |||
| 9aaf662a60 | |||
| 0b65ebbb00 | |||
| 74d1c88f82 | |||
| 70c8375810 | |||
| b554128337 | |||
| 4a8ce2ca18 | |||
| a2df22c1da | |||
| 047ceda252 | |||
| c94435360f | |||
| ed0b7a9740 | |||
| b168c4bb82 | |||
| 5078011f40 | |||
| 1428953cb7 | |||
| 7f962704d2 | |||
| 2970263db5 | |||
| 91d9fb90ac | |||
| adb28089b9 | |||
| 6f4a012ac4 | |||
| b807a41496 | |||
| 02f1fb797f | |||
| caee9117b3 | |||
| 48cec4c0f0 | |||
| d4df0c3562 | |||
| 8caab70b25 | |||
| 846f26db75 | |||
| ea2bdb226d | |||
| 0f93a3581f | |||
| 6607afc898 | |||
| 543b0ddefe | |||
| 6d191f04fb | |||
| 353a623e5f | |||
| e28f68aae3 | |||
| 5441592d68 | |||
| a8e96b142d | |||
| 4527b58084 | |||
| 80d14c1400 | |||
| 86ed26afeb | |||
| 35c4147cc1 | |||
| 711e69ddfb | |||
| 90d9cac19a | |||
| 61593d7d23 | |||
| 7c41e7adcc | |||
| 0215be8681 | |||
| 1139384ab3 | |||
| 45174422e9 | |||
| 2077d784fd | |||
| fa341101a8 | |||
| 1959ac589d | |||
| 5744493ac3 | |||
| 64eb4530af | |||
| d38fdfaced | |||
| f76484f824 | |||
| ef6adb0a27 | |||
| ca80df9541 | |||
| 828907120b | |||
| 460074b18a | |||
| 104bd4498e | |||
| 97082b1e55 | |||
| c9561fba71 | |||
| 8aa913fe09 | |||
| a598521491 | |||
| 6461456c16 | |||
| b4f697bdea | |||
| 721295b9d1 | |||
| 70c6e74623 | |||
| 1348ca27ab | |||
| 116592e436 | |||
| 19284a4ddf | |||
| 35e603b850 | |||
| 882c7bb35e | |||
| 9c8ce3a7f2 | |||
| 8a6af65786 | |||
| 4633bd902c | |||
| 10fcb8a2f6 | |||
| 3ad47eddfd | |||
| 636f1474bd | |||
| ebc9fac4dc | |||
| a0e5db6ed9 | |||
| f8acd8e222 | |||
| 7b21f82024 | |||
| 240cd7ce69 | |||
| 8a4f9c6f79 | |||
| 16f5865c4c | |||
| 25c3d8e6c1 | |||
| e1584c80a5 | |||
| 89dc493edf | |||
| aa59075939 | |||
| c55beaf30d | |||
| 67f1343744 | |||
| 6b0e0fc8e8 | |||
| af41ad5f53 | |||
| 622cd524e5 | |||
| 7266cf0d80 | |||
| 47fc11ed96 | |||
| fd927991c7 | |||
| 4b5e6d9856 | |||
| 3aa5ef9c95 | |||
| ded76b774c | |||
| 1bcf2f7410 | |||
| d8cce9ae11 | |||
| b4f29559cf | |||
| a7ea833860 | |||
| 9c54033343 | |||
| 7b9dab9d78 | |||
| 7f094cbafb | |||
| c4b8542b5b |
Generated
+5
@@ -6935,6 +6935,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"moment": {
|
||||||
|
"version": "2.24.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
|
||||||
|
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
|
||||||
|
},
|
||||||
"move-concurrently": {
|
"move-concurrently": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz",
|
"resolved": "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz",
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"core-js": "^2.6.5",
|
"core-js": "^2.6.5",
|
||||||
"echarts": "^4.2.1",
|
"echarts": "^4.2.1",
|
||||||
"element-ui": "^2.11.1",
|
"element-ui": "^2.11.1",
|
||||||
|
"moment": "^2.24.0",
|
||||||
"p-wait-for": "^3.1.0",
|
"p-wait-for": "^3.1.0",
|
||||||
"v-charts": "^1.19.0",
|
"v-charts": "^1.19.0",
|
||||||
"vue": "^2.6.10",
|
"vue": "^2.6.10",
|
||||||
|
|||||||
@@ -25,4 +25,14 @@
|
|||||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q615K1KFLC"></script>
|
||||||
|
<script>
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
|
||||||
|
gtag('config', 'G-Q615K1KFLC');
|
||||||
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -7,8 +7,20 @@
|
|||||||
color: #2c3e50;
|
color: #2c3e50;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#app-content
|
||||||
|
{
|
||||||
|
// Limit max width
|
||||||
|
max-width: 1300px;
|
||||||
|
text-align: center;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.theme-default
|
.theme-default
|
||||||
{
|
{
|
||||||
--unread: #ff6c00;
|
--unread: #ff6c00;
|
||||||
--main: #0c6dad;
|
--main: #0c6dad;
|
||||||
|
|
||||||
|
--assignment-type-2: #3f991e;
|
||||||
|
--assignment-type-3: #ff9900;
|
||||||
|
--assignment-type-4: #b02b02;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ import {GPAUtils} from '@/utils/gpa-utils';
|
|||||||
export interface Assignment
|
export interface Assignment
|
||||||
{
|
{
|
||||||
id: number,
|
id: number,
|
||||||
|
scoreId: number,
|
||||||
type: string,
|
type: string,
|
||||||
|
typeId: number,
|
||||||
description: string,
|
description: string,
|
||||||
date: string,
|
date: string,
|
||||||
complete: string,
|
complete: string,
|
||||||
@@ -78,7 +80,7 @@ export default class App extends Vue
|
|||||||
public token: string = '';
|
public token: string = '';
|
||||||
|
|
||||||
// Http Client
|
// Http Client
|
||||||
public http: HttpUtils = new HttpUtils('');
|
public static http: HttpUtils = new HttpUtils();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is called when the instance is created.
|
* This is called when the instance is created.
|
||||||
@@ -103,7 +105,7 @@ export default class App extends Vue
|
|||||||
this.token = token;
|
this.token = token;
|
||||||
|
|
||||||
// Assign token to http client
|
// Assign token to http client
|
||||||
this.http.token = token;
|
App.http.token = token;
|
||||||
|
|
||||||
// Load data
|
// Load data
|
||||||
this.loadCoursesAfterLogin();
|
this.loadCoursesAfterLogin();
|
||||||
@@ -114,7 +116,7 @@ export default class App extends Vue
|
|||||||
*/
|
*/
|
||||||
public loadCoursesAfterLogin()
|
public loadCoursesAfterLogin()
|
||||||
{
|
{
|
||||||
this.http.post('/courses', {}).then(response =>
|
App.http.post('/courses', {}).then(response =>
|
||||||
{
|
{
|
||||||
// Check success
|
// Check success
|
||||||
if (response.success)
|
if (response.success)
|
||||||
@@ -143,7 +145,7 @@ export default class App extends Vue
|
|||||||
this.courses.forEach(course =>
|
this.courses.forEach(course =>
|
||||||
{
|
{
|
||||||
// Send request to get assignments
|
// Send request to get assignments
|
||||||
this.http.post('/assignments', {id: course.assignmentsId}).then(response =>
|
App.http.post('/assignments', {'assignmentsId': course.assignmentsId}).then(response =>
|
||||||
{
|
{
|
||||||
// Check success
|
// Check success
|
||||||
if (response.success)
|
if (response.success)
|
||||||
@@ -188,7 +190,7 @@ export default class App extends Vue
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the courses' grading algorithms. (Total-average or percent-type)
|
* Check the courses' grading algorithms. (Total-mean or percent-type)
|
||||||
*/
|
*/
|
||||||
private checkGradingAlgorithms()
|
private checkGradingAlgorithms()
|
||||||
{
|
{
|
||||||
@@ -196,14 +198,14 @@ export default class App extends Vue
|
|||||||
for (const course of this.filteredCourses)
|
for (const course of this.filteredCourses)
|
||||||
{
|
{
|
||||||
// Check if total-average grade is the same with percent-type grade
|
// Check if total-average grade is the same with percent-type grade
|
||||||
if (course.numericGrade == GPAUtils.getTotalMeanAverage(course))
|
if (course.numericGrade == +GPAUtils.getTotalMeanAverage(course).toFixed(2))
|
||||||
{
|
{
|
||||||
course.grading = {method: 'TOTAL_AVERAGE', weightingMap: {}};
|
course.grading = {method: 'TOTAL_MEAN', weightingMap: {}};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Request grading scheme for this course
|
// Request grading scheme for this course
|
||||||
this.http.post('/grading', {'assignment_id': course.assignmentsId}).then(response =>
|
App.http.post('/grading', {'assignmentsId': course.assignmentsId}).then(response =>
|
||||||
{
|
{
|
||||||
// Check success
|
// Check success
|
||||||
if (response.success)
|
if (response.success)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="app" class="theme-default">
|
<div id="app" class="theme-default">
|
||||||
<login v-if="showLogin" v-on:login:token="onLogin" :http="http"></login>
|
<login v-if="showLogin" v-on:login:token="onLogin"></login>
|
||||||
<navigation :courses="filteredCourses"
|
<navigation :courses="filteredCourses"
|
||||||
v-on:sign-out="signOut()"
|
v-on:sign-out="signOut()"
|
||||||
v-on:navigation:select="onNavigate">
|
v-on:navigation:select="onNavigate">
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import {Component, Prop, Vue} from 'vue-property-decorator';
|
import {Component, Prop, Vue} from 'vue-property-decorator';
|
||||||
import Constants from '@/constants';
|
import Constants from '@/constants';
|
||||||
import {HttpUtils} from '@/utils/http-utils';
|
import {HttpUtils} from '@/utils/http-utils';
|
||||||
|
import App from '@/components/app/app';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component handles user login, and obtains data from the server.
|
* This component handles user login, and obtains data from the server.
|
||||||
@@ -17,14 +18,18 @@ export default class Login extends Vue
|
|||||||
public loading: boolean = false;
|
public loading: boolean = false;
|
||||||
public error: String = '';
|
public error: String = '';
|
||||||
|
|
||||||
@Prop()
|
|
||||||
public http?: HttpUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is called when the instance is created.
|
* This is called when the instance is created.
|
||||||
*/
|
*/
|
||||||
public created()
|
public created()
|
||||||
{
|
{
|
||||||
|
// Check cookies version
|
||||||
|
if (!this.$cookies.isKey('va.version') || this.$cookies.get('va.version') != Constants.VERSION)
|
||||||
|
{
|
||||||
|
// Clear all cookies
|
||||||
|
this.$cookies.keys().forEach(key => this.$cookies.remove(key));
|
||||||
|
}
|
||||||
|
|
||||||
// Check login cookies
|
// Check login cookies
|
||||||
if (this.$cookies.isKey('va.token'))
|
if (this.$cookies.isKey('va.token'))
|
||||||
{
|
{
|
||||||
@@ -42,7 +47,7 @@ export default class Login extends Vue
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
// Fetch request
|
// Fetch request
|
||||||
(<HttpUtils> this.http).post('/login', {username: this.username, password: this.password})
|
App.http.post('/login', {username: this.username, password: this.password})
|
||||||
.then(response =>
|
.then(response =>
|
||||||
{
|
{
|
||||||
// Check success
|
// Check success
|
||||||
@@ -50,6 +55,7 @@ export default class Login extends Vue
|
|||||||
{
|
{
|
||||||
// Save token to cookies
|
// Save token to cookies
|
||||||
this.$cookies.set('va.token', response.data, '7d');
|
this.$cookies.set('va.token', response.data, '7d');
|
||||||
|
this.$cookies.set('va.version', Constants.VERSION);
|
||||||
|
|
||||||
// Call custom event with token
|
// Call custom event with token
|
||||||
this.$emit('login:token', response.data);
|
this.$emit('login:token', response.data);
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ export default class Constants
|
|||||||
*/
|
*/
|
||||||
public static API_URL: string = 'https://va.hydev.org/api';
|
public static API_URL: string = 'https://va.hydev.org/api';
|
||||||
|
|
||||||
public static VERSION: string = '0.3.1.382';
|
public static VERSION: string = '0.3.3.502';
|
||||||
|
|
||||||
public static GITHUB: string = 'https://github.com/HyDevelop/VeracrossAnalyzer.Client';
|
public static GITHUB: string = 'https://github.com/HyDevelop/VeracrossAnalyzer.Client';
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,36 @@
|
|||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
|
|
||||||
// Height limit
|
// Height limit
|
||||||
max-height: 90px;
|
max-height: 250px;
|
||||||
|
|
||||||
// Limit name length
|
// Limit name length
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
|
// Expansion color
|
||||||
|
background: #f4f6f9;
|
||||||
|
|
||||||
|
// Main card content
|
||||||
|
.course-card-content.main
|
||||||
|
{
|
||||||
|
padding: 0 20px 0 20px;
|
||||||
|
height: 90px;
|
||||||
|
|
||||||
|
// Main color
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expansion content
|
||||||
|
.course-card-content.expand.notification
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove card padding for styling issues
|
||||||
|
div.el-card.course-card > div.el-card__body
|
||||||
|
{
|
||||||
|
padding-right: 0 !important;
|
||||||
|
padding-left: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.course-col-name
|
.course-col-name
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import {Component, Prop, Vue} from 'vue-property-decorator';
|
import {Component, Prop, Vue} from 'vue-property-decorator';
|
||||||
import {Course} from '@/components/app/app';
|
import App, {Assignment, Course} from '@/components/app/app';
|
||||||
import {GPAUtils} from '@/utils/gpa-utils';
|
import {GPAUtils} from '@/utils/gpa-utils';
|
||||||
import Constants from '@/constants';
|
import Constants from '@/constants';
|
||||||
|
import UnreadEntry from '@/pages/overall/overall-course/unread-entry/unread-entry';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
components: {UnreadEntry}
|
||||||
})
|
})
|
||||||
export default class OverallCourse extends Vue
|
export default class OverallCourse extends Vue
|
||||||
{
|
{
|
||||||
@@ -11,6 +13,7 @@ export default class OverallCourse extends Vue
|
|||||||
@Prop({required: true}) course: Course;
|
@Prop({required: true}) course: Course;
|
||||||
|
|
||||||
private unread: number = -1;
|
private unread: number = -1;
|
||||||
|
private unreadAssignments: Assignment[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Count the number of unread assignments with cache
|
* Count the number of unread assignments with cache
|
||||||
@@ -19,8 +22,31 @@ export default class OverallCourse extends Vue
|
|||||||
{
|
{
|
||||||
if (this.unread == -1)
|
if (this.unread == -1)
|
||||||
{
|
{
|
||||||
return this.unread = this.course.assignments.filter(a => a.unread).length;
|
this.unreadAssignments = this.course.assignments.filter(a => a.unread);
|
||||||
|
return this.unread = this.unreadAssignments.length;
|
||||||
}
|
}
|
||||||
else return this.unread;
|
else return this.unread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mark an assignment as read
|
||||||
|
*/
|
||||||
|
markAsRead(assignment: Assignment)
|
||||||
|
{
|
||||||
|
App.http.post('/mark-as-read', {scoreId: assignment.scoreId})
|
||||||
|
.then(response =>
|
||||||
|
{
|
||||||
|
// Check success
|
||||||
|
if (response.success)
|
||||||
|
{
|
||||||
|
this.unreadAssignments = this.unreadAssignments.filter(a => a != assignment);
|
||||||
|
this.unread = this.unreadAssignments.length;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Show error message TODO: Show it properly
|
||||||
|
alert(response.data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,34 +1,44 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="overall-course">
|
<div id="overall-course">
|
||||||
<el-card class="course-card">
|
<el-card class="course-card">
|
||||||
<el-row>
|
<div class="course-card-content main vertical-center">
|
||||||
<el-col :span="6" class="course-col-name">
|
<el-row>
|
||||||
<div class="course-name">
|
<el-col :span="6" class="course-col-name">
|
||||||
{{course.name}}
|
<div class="course-name">
|
||||||
</div>
|
{{course.name}}
|
||||||
<div class="course-teacher">
|
</div>
|
||||||
{{course.teacherName}}
|
<div class="course-teacher">
|
||||||
</div>
|
{{course.teacherName}}
|
||||||
</el-col>
|
</div>
|
||||||
<el-col :span="12">
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
</el-col>
|
|
||||||
<el-col :span="6" class="course-col-grade">
|
</el-col>
|
||||||
<div class="course-grade">
|
<el-col :span="6" class="course-col-grade">
|
||||||
<span class="letter">{{course.letterGrade}} </span>
|
<div class="course-grade">
|
||||||
<span class="numeric">{{course.numericGrade.toFixed(2)}}</span>
|
<span class="letter">{{course.letterGrade}} </span>
|
||||||
<span class="percent">%</span>
|
<span class="numeric">{{course.numericGrade.toFixed(2)}}</span>
|
||||||
</div>
|
<span class="percent">%</span>
|
||||||
<div class="course-updates" :class="countUnread() === 0 ? 'none' : 'unread'">
|
</div>
|
||||||
<span class="unread-number">
|
<div class="course-updates" :class="countUnread() === 0 ? 'none' : 'unread'">
|
||||||
{{countUnread()}}
|
<span class="unread-number">
|
||||||
</span>
|
{{countUnread()}}
|
||||||
<span class="unread-text">
|
</span>
|
||||||
new update{{countUnread() >= 2 ? 's' : ''}}
|
<span class="unread-text">
|
||||||
</span>
|
new update{{countUnread() >= 2 ? 's' : ''}}
|
||||||
</div>
|
</span>
|
||||||
</el-col>
|
</div>
|
||||||
</el-row>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<div class="course-card-content expand notification"
|
||||||
|
v-if="countUnread() !== 0">
|
||||||
|
<unread-entry v-for="assignment in unreadAssignments"
|
||||||
|
:assignment="assignment"
|
||||||
|
:key="assignment.id"
|
||||||
|
v-on:mark-as-read="markAsRead">
|
||||||
|
</unread-entry>
|
||||||
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
|
||||||
|
// Row
|
||||||
|
.unread-entry
|
||||||
|
{
|
||||||
|
height: 40px;
|
||||||
|
padding: 0 10px 0 20px;
|
||||||
|
background: #f5f7fa;
|
||||||
|
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
// Date
|
||||||
|
.el-col.date
|
||||||
|
{
|
||||||
|
min-width: 130px;
|
||||||
|
|
||||||
|
span.month
|
||||||
|
{
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.now
|
||||||
|
{
|
||||||
|
font-size: 11px;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Description
|
||||||
|
.el-col.description
|
||||||
|
{
|
||||||
|
width: unset;
|
||||||
|
|
||||||
|
span.type
|
||||||
|
{
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 700;
|
||||||
|
|
||||||
|
background: #eee;
|
||||||
|
border-left: 2px solid #000;
|
||||||
|
|
||||||
|
height: 22px;
|
||||||
|
line-height: 22px;
|
||||||
|
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Grade
|
||||||
|
.el-col.grade
|
||||||
|
{
|
||||||
|
text-align: right;
|
||||||
|
float: right;
|
||||||
|
|
||||||
|
span.percent
|
||||||
|
{
|
||||||
|
font-style: italic;
|
||||||
|
background: #ffc;
|
||||||
|
color: #555;
|
||||||
|
|
||||||
|
margin-right: 8px;
|
||||||
|
|
||||||
|
.symbol
|
||||||
|
{
|
||||||
|
padding: 0 1px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Score you got
|
||||||
|
span.score
|
||||||
|
{
|
||||||
|
background: #f2f2f2;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Max score
|
||||||
|
span.max
|
||||||
|
{
|
||||||
|
background: #ddd;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mark as read
|
||||||
|
button.mark-as-read
|
||||||
|
{
|
||||||
|
margin-left: 8px;
|
||||||
|
color: #aaa;
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.entry-box
|
||||||
|
{
|
||||||
|
height: 22px;
|
||||||
|
padding: 0 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.unread-entry:first-child
|
||||||
|
{
|
||||||
|
padding-top: 3px;
|
||||||
|
|
||||||
|
// Top shadow
|
||||||
|
// https://stackoverflow.com/questions/17572619/inset-box-shadow-only-on-one-side
|
||||||
|
box-shadow: inset 0 7px 9px -7px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import {Component, Prop, Vue} from 'vue-property-decorator';
|
||||||
|
import {Assignment, Course} from '@/components/app/app';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
})
|
||||||
|
export default class UnreadEntry extends Vue
|
||||||
|
{
|
||||||
|
// @ts-ignore
|
||||||
|
@Prop({required: true}) assignment: Assignment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format a date to the displayed format
|
||||||
|
*
|
||||||
|
* @param date Date
|
||||||
|
*/
|
||||||
|
getMoment(date: string)
|
||||||
|
{
|
||||||
|
return moment(new Date(date));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mark this unread assignment as read
|
||||||
|
*/
|
||||||
|
markAsRead()
|
||||||
|
{
|
||||||
|
// Call custom event
|
||||||
|
this.$emit('mark-as-read', this.assignment)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<template>
|
||||||
|
<div class="unread-entry vertical-center">
|
||||||
|
<el-row class="unread-row">
|
||||||
|
<el-col :span="3" class="date">
|
||||||
|
<span class="month">{{getMoment(assignment.date).format("MMM Do")}}</span>
|
||||||
|
<span class="now">({{getMoment(assignment.date).fromNow()}})</span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="15" class="description">
|
||||||
|
<span class="type entry-box"
|
||||||
|
:style="`border-color: var(--assignment-type-${assignment.typeId})`">
|
||||||
|
{{assignment.type}}
|
||||||
|
</span>
|
||||||
|
<span class="text">{{assignment.description}}</span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6" class="grade">
|
||||||
|
<span class="percent entry-box">
|
||||||
|
{{(assignment.score / assignment.scoreMax * 100).toFixed(1)}}
|
||||||
|
<span class="symbol">%</span>
|
||||||
|
</span>
|
||||||
|
<span class="score entry-box">{{assignment.score}}</span>
|
||||||
|
<span class="max entry-box">{{assignment.scoreMax}}</span>
|
||||||
|
<el-button class="mark-as-read" size="mini" type="text"
|
||||||
|
icon="el-icon-close" @click="markAsRead">
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./unread-entry.ts" lang="ts"></script>
|
||||||
|
<style src="./unread-entry.scss" lang="scss"></style>
|
||||||
@@ -56,7 +56,8 @@ export default class OverallLine extends Vue
|
|||||||
},
|
},
|
||||||
yAxis:
|
yAxis:
|
||||||
{
|
{
|
||||||
min: (value: any) => value.min - 10
|
min: (value: any) => value.min,
|
||||||
|
max: (value: any) => value.max
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,13 +3,12 @@
|
|||||||
.el-card
|
.el-card
|
||||||
{
|
{
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
height: 494px;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Vertical center
|
.el-card.large
|
||||||
display: flex;
|
{
|
||||||
justify-content: center;
|
height: 494px;
|
||||||
flex-direction: column;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.gpa-card
|
.gpa-card
|
||||||
@@ -60,3 +59,12 @@
|
|||||||
padding-top: 0 !important;
|
padding-top: 0 !important;
|
||||||
padding-bottom: 0 !important;
|
padding-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Vertical centering
|
||||||
|
.vertical-center
|
||||||
|
{
|
||||||
|
// Vertical center
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div id="overall">
|
<div id="overall">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-card class="gpa-card">
|
<el-card class="large gpa-card vertical-center">
|
||||||
<div style="padding: 14px;">
|
<div style="padding: 14px;">
|
||||||
<span class="gpa header">GPA:</span>
|
<span class="gpa header">GPA:</span>
|
||||||
<span class="gpa text">{{getGPA().gpa}}</span>
|
<span class="gpa text">{{getGPA().gpa}}</span>
|
||||||
@@ -14,18 +14,21 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14">
|
<el-col :span="14">
|
||||||
<el-card class="overall-line-card">
|
<el-card class="large overall-line-card vertical-center">
|
||||||
<overall-line :courses="courses"></overall-line>
|
<overall-line :courses="courses"></overall-line>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-card class="overall-bar-card">
|
<el-card class="large overall-bar-card vertical-center">
|
||||||
<overall-bar :courses="courses"></overall-bar>
|
<overall-bar :courses="courses"></overall-bar>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<overall-course v-for="course in courses" :course="course"></overall-course>
|
<overall-course v-for="course in courses"
|
||||||
|
:course="course"
|
||||||
|
:key="course.id">
|
||||||
|
</overall-course>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ export class CourseUtils
|
|||||||
// Skip courses without levels
|
// Skip courses without levels
|
||||||
if (course.level == 'None') return;
|
if (course.level == 'None') return;
|
||||||
|
|
||||||
// Skip courses without assignments
|
// Skip courses without graded assignments
|
||||||
if (course.assignments.length == 0) return;
|
if (course.assignments.filter(a => a.complete == 'Complete').length == 0) return;
|
||||||
|
|
||||||
// Skip if there are no grading scale
|
// Skip if there are no grading scale
|
||||||
// if (course.grading.method == 'NOT_GRADED') return;
|
// if (course.grading.method == 'NOT_GRADED') return;
|
||||||
|
|||||||
@@ -4,11 +4,6 @@ export class HttpUtils
|
|||||||
{
|
{
|
||||||
public token: string = '';
|
public token: string = '';
|
||||||
|
|
||||||
constructor (token: string)
|
|
||||||
{
|
|
||||||
this.token = token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public post(node: string, body: any): Promise<any>
|
public post(node: string, body: any): Promise<any>
|
||||||
{
|
{
|
||||||
// Add token
|
// Add token
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ export default class JsonUtils
|
|||||||
result.push(
|
result.push(
|
||||||
{
|
{
|
||||||
id: assignment.assignment_id,
|
id: assignment.assignment_id,
|
||||||
|
scoreId: assignment.score_id,
|
||||||
type: assignment.assignment_type,
|
type: assignment.assignment_type,
|
||||||
|
typeId: assignment.assignment_type_id,
|
||||||
description: assignment.assignment_description,
|
description: assignment.assignment_description,
|
||||||
date: assignment._date,
|
date: assignment._date,
|
||||||
complete: assignment.completion_status,
|
complete: assignment.completion_status,
|
||||||
|
|||||||
Reference in New Issue
Block a user