Compare commits
39 Commits
0.5.2.1335
...
0.5.3.1373
| Author | SHA1 | Date | |
|---|---|---|---|
| 46ef56efbd | |||
| 7b04d1e006 | |||
| 511d4544b6 | |||
| 140893a9b2 | |||
| 427773f4cb | |||
| dfeb5d0272 | |||
| 304ba63771 | |||
| 1698f1737d | |||
| 9d8a797c54 | |||
| 4d0c48619d | |||
| e95d212628 | |||
| 936e6ffa41 | |||
| f2a3260b8f | |||
| 5c8b2b37d4 | |||
| 44e4b615ba | |||
| 60a852815b | |||
| 7c7d7e609a | |||
| 0da5be9448 | |||
| 1ebb69c89c | |||
| 99af1c4607 | |||
| e1caacce34 | |||
| e2b6a92743 | |||
| 982c8cf872 | |||
| 1e928ac1a8 | |||
| a17ab1511d | |||
| 07c55df766 | |||
| 06ee7b4de9 | |||
| 0c520d5f50 | |||
| 522867a2dc | |||
| d56d985734 | |||
| 1d404b4f51 | |||
| c1d3cc88bc | |||
| 1242e2ed58 | |||
| f61dccb90a | |||
| 106da7e7f1 | |||
| 4774ad658b | |||
| 6035fe5318 | |||
| 452ac69fb6 | |||
| 3ec604f049 |
@@ -1,5 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#echo "Switch to production database settings"
|
||||
#exit
|
||||
|
||||
# abort on errors
|
||||
set -e
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 51 KiB |
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Redirecting...</title>
|
||||
<meta http-equiv = "refresh" content = "0; url = https://vera.hydev.org/#info" />
|
||||
</head>
|
||||
<body>
|
||||
Redirecting to (<a href="https://vera.hydev.org/#info">https://vera.hydev.org/#info</a>)...
|
||||
<script>
|
||||
window.location.href = 'https://vera.hydev.org/#info';
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 44 KiB |
@@ -57,16 +57,17 @@
|
||||
}
|
||||
|
||||
// Overall
|
||||
#overall, #overall-course, .overall-span, #app-content
|
||||
#app-inner, #overall, #overall-course, .overall-span, #app-content
|
||||
{
|
||||
background: var(--dark-layer-1) !important;
|
||||
}
|
||||
|
||||
// Course card
|
||||
.entry-box, .none .unread-number {background: #a1a1a1 !important}
|
||||
.entry-box, .none .unread-number {background: #797979 !important}
|
||||
.entry-box.max {background-color: #949494 !important}
|
||||
.entry-box.percent {background-color: #a7a490 !important}
|
||||
.course-name {color: #cffff6 !important}
|
||||
#block-grade #updates.none #unread-number {background: #757575 !important}
|
||||
|
||||
.course-card-content.expand, .assignment-entry, .unread-row,
|
||||
.unread-row .el-col, #assignment-type-head, .course-page-graph.el-col
|
||||
@@ -74,14 +75,8 @@
|
||||
background-color: var(--dark-layer-3) !important;
|
||||
}
|
||||
|
||||
.overall-span.el-col, .course-page-graph.el-col
|
||||
{
|
||||
div, span
|
||||
{
|
||||
background: #f9f9f9 !important;
|
||||
color: var(--dark-layer-1) !important;
|
||||
}
|
||||
}
|
||||
// Nav bar
|
||||
.el-menu--horizontal>.el-menu-item.is-active {color: var(--dark-foreground) !important;}
|
||||
}
|
||||
|
||||
// ##############
|
||||
|
||||
@@ -10,9 +10,10 @@ import CoursePage from '@/pages/course/course-page.vue';
|
||||
import Course from '@/logic/course';
|
||||
import LoginUser from '@/logic/login-user';
|
||||
import NavController from '@/logic/nav-controller';
|
||||
import Info from '@/statics/Info.vue';
|
||||
|
||||
@Component({
|
||||
components: {Login, Navigation, Overall, Loading, CoursePage},
|
||||
components: {Login, Navigation, Overall, Loading, CoursePage, Info},
|
||||
})
|
||||
export default class App extends Vue
|
||||
{
|
||||
@@ -44,6 +45,12 @@ export default class App extends Vue
|
||||
// Instance
|
||||
static instance: App;
|
||||
|
||||
// Static page
|
||||
staticPage: string = '';
|
||||
|
||||
// Dark mode
|
||||
darkMode: boolean = false;
|
||||
|
||||
/**
|
||||
* This is called when the instance is created.
|
||||
*/
|
||||
@@ -54,6 +61,15 @@ export default class App extends Vue
|
||||
|
||||
// Update instance
|
||||
App.instance = this;
|
||||
|
||||
// Check location
|
||||
if (window.location.hash == '#info')
|
||||
{
|
||||
this.staticPage = 'info';
|
||||
}
|
||||
|
||||
// Dark mode
|
||||
this.darkMode = this.$cookies.isKey('dark');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+19
-15
@@ -1,23 +1,27 @@
|
||||
<template>
|
||||
<div id="app" class="theme-default">
|
||||
<login v-if="showLogin" v-on:login:user="onLogin"/>
|
||||
<navigation v-if="user != null"
|
||||
:courses="gradedCourses"
|
||||
:user="user"
|
||||
:nav="nav"
|
||||
@sign-out="signOut" @select-time="selectTime">
|
||||
</navigation>
|
||||
<div id="app-inner" v-if="staticPage === ''" :class="{dark: darkMode}">
|
||||
<login v-if="showLogin" v-on:login:user="onLogin"/>
|
||||
<navigation v-if="user != null"
|
||||
:courses="gradedCourses"
|
||||
:user="user"
|
||||
:nav="nav"
|
||||
@sign-out="signOut" @select-time="selectTime">
|
||||
</navigation>
|
||||
|
||||
<div id="app-content" v-if="assignmentsReady && loading === ''">
|
||||
<overall v-if="nav.id === 'overall'"
|
||||
:courses="gradedCourses">
|
||||
</overall>
|
||||
<course-page v-if="nav.id === 'course'"
|
||||
:course="gradedCourses.find(c => +c.id === +nav.info.id)">
|
||||
</course-page>
|
||||
<div id="app-content" v-if="assignmentsReady && loading === ''">
|
||||
<overall v-if="nav.id === 'overall'"
|
||||
:courses="gradedCourses">
|
||||
</overall>
|
||||
<course-page v-if="nav.id === 'course'"
|
||||
:course="gradedCourses.find(c => +c.id === +nav.info.id)">
|
||||
</course-page>
|
||||
</div>
|
||||
|
||||
<loading v-if="loading !== ''" :text="loading" :error="loadingError"/>
|
||||
</div>
|
||||
|
||||
<loading v-if="loading !== ''" :text="loading" :error="loadingError"/>
|
||||
<Info v-if="staticPage === 'info'"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import Course from '@/logic/course';
|
||||
import Constants from '@/constants';
|
||||
import LoginUser from '@/logic/login-user';
|
||||
import NavController from '@/logic/nav-controller';
|
||||
import App from '@/components/app/app';
|
||||
|
||||
/**
|
||||
* This component is the top navigation bar
|
||||
@@ -134,8 +135,22 @@ export default class Navigation extends Vue
|
||||
this.$emit('sign-out');
|
||||
break
|
||||
}
|
||||
case 'switch-dark':
|
||||
{
|
||||
App.instance.darkMode = !App.instance.darkMode;
|
||||
|
||||
if (this.isDark()) this.$cookies.set('dark', true);
|
||||
else this.$cookies.remove('dark');
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
isDark()
|
||||
{
|
||||
return App.instance.darkMode;
|
||||
}
|
||||
|
||||
get version() {return Constants.VERSION}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,9 @@
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="Term 1">Term 1</el-dropdown-item>
|
||||
<el-dropdown-item command="Term 2">Term 2</el-dropdown-item>
|
||||
<el-dropdown-item command="Term 3" disabled>Term 3</el-dropdown-item>
|
||||
<el-dropdown-item command="Term 3">Term 3</el-dropdown-item>
|
||||
<el-dropdown-item command="Term 4" disabled>Term 4</el-dropdown-item>
|
||||
<!-- TODO: Auto enable / disable quarters -->
|
||||
<el-dropdown-item command="All Year" divided>All Year</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
@@ -39,6 +40,8 @@
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item style="text-align: center">{{user.nickname}}</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item icon="el-icon-sunrise" command="switch-dark" divided>{{!isDark() ? 'Dark Mode (Unfinished)' : 'Light Mode'}}</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item icon="el-icon-switch-button" command="sign-out" divided>Sign Out</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ export default class Constants
|
||||
// static API_URL: string = 'http://localhost:24021/api';
|
||||
|
||||
/** Current version */
|
||||
static VERSION: string = '0.5.2.1335';
|
||||
static VERSION: string = '0.5.3.1373';
|
||||
|
||||
/** The minimum version that still supports the same cookies */
|
||||
static MIN_SUPPORTED_VERSION: string = '0.4.6.1087';
|
||||
|
||||
+29
-1
@@ -62,7 +62,35 @@ export class Assignment
|
||||
*/
|
||||
get graded()
|
||||
{
|
||||
return this.complete == 'Complete';
|
||||
// TODO: Add more cases
|
||||
return this.include && (this.complete == 'Complete' || this.complete == 'Late' || this.complete == 'NREQ');
|
||||
}
|
||||
|
||||
/**
|
||||
* What is the problem with this assignment
|
||||
*
|
||||
* @return string Empty string if complete, otherwise return problem.
|
||||
*/
|
||||
get problem()
|
||||
{
|
||||
switch (this.complete)
|
||||
{
|
||||
case 'Complete': return '';
|
||||
case 'Late': return 'Late';
|
||||
case 'NREQ': return 'Dropped';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the text color of the problem
|
||||
*/
|
||||
get problemColor()
|
||||
{
|
||||
switch (this.complete)
|
||||
{
|
||||
case 'Late': return '#ff0036';
|
||||
case 'NREQ': return '#41b141';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+69
-18
@@ -1,4 +1,6 @@
|
||||
import {FormatUtils} from '@/logic/utils/format-utils';
|
||||
import pWaitFor from 'p-wait-for';
|
||||
import App from '@/components/app/app';
|
||||
|
||||
export interface Index
|
||||
{
|
||||
@@ -18,24 +20,6 @@ export default class NavController
|
||||
|
||||
constructor()
|
||||
{
|
||||
// Check history from last session
|
||||
if (window.history.state == undefined || window.history.state.hash == undefined)
|
||||
{
|
||||
// Set history state
|
||||
let url = '/' + window.location.hash;
|
||||
if (url == '/') url = '/#overall';
|
||||
window.history.replaceState(this.convertIndex('overall'), '', url);
|
||||
|
||||
// Update initial index after loading is done
|
||||
// TODO: Test this
|
||||
//pWaitFor(() => this.courses.length > 1 && App.instance.loading != '').then(() =>
|
||||
this.updateIndex(url.substring(2), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.index = window.history.state;
|
||||
}
|
||||
|
||||
// Create history state listener
|
||||
window.onpopstate = (e: any) =>
|
||||
{
|
||||
@@ -46,6 +30,73 @@ export default class NavController
|
||||
this.updateIndex(e.state, false);
|
||||
}
|
||||
};
|
||||
|
||||
// Initialize
|
||||
this.init()
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize from last location
|
||||
*/
|
||||
private init()
|
||||
{
|
||||
if (window.location.hash == '#info') return;
|
||||
|
||||
// Check history from last session
|
||||
if (window.history.state != undefined && window.history.state.hash != undefined)
|
||||
{
|
||||
// Last history exists
|
||||
this.index = window.history.state;
|
||||
return;
|
||||
}
|
||||
|
||||
// Last history doesn't exist but hash url might exist
|
||||
let hash = window.location.hash.replace('#', '');
|
||||
|
||||
// Check hash
|
||||
if (hash == '')
|
||||
{
|
||||
// No location info in url, set page to overall
|
||||
window.history.replaceState(this.convertIndex('overall'), '', '/#overall');
|
||||
this.updateIndex('overall', false);
|
||||
return;
|
||||
}
|
||||
|
||||
// There is hash info in url
|
||||
let split = hash.split('/');
|
||||
|
||||
// Not course -> don't know what to do with this url, so just refresh
|
||||
if (split[0] != 'course')
|
||||
{
|
||||
this.initClear();
|
||||
return;
|
||||
}
|
||||
|
||||
// Is course -> Update index with placeholder title
|
||||
this.updateIndex({hash: hash, title: `Loading...`, identifier: 'course', info: {id: +split[1]}}, false);
|
||||
|
||||
// Wait for courses to finish loading
|
||||
pWaitFor(() => App.instance != undefined && App.instance.assignmentsReady).then(() =>
|
||||
{
|
||||
// Find course
|
||||
let course = App.instance.courses.find(c => c.id == +split[1]);
|
||||
|
||||
// This person has no such course, refresh to overall
|
||||
if (course == null)
|
||||
{
|
||||
this.initClear();
|
||||
return;
|
||||
}
|
||||
|
||||
window.history.replaceState(course.urlIndex, '', '/#' + course.urlHash);
|
||||
this.updateIndex(course.urlIndex, false);
|
||||
})
|
||||
}
|
||||
|
||||
private initClear()
|
||||
{
|
||||
window.location.hash = '';
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import Constants from '@/constants';
|
||||
import App from '@/components/app/app';
|
||||
|
||||
export default class GraphUtils
|
||||
{
|
||||
@@ -54,6 +55,9 @@ export default class GraphUtils
|
||||
*/
|
||||
static getGradeMarkAreas(opacity: number)
|
||||
{
|
||||
// TODO: Auto update after switching dark mode (possibly by refreshing)
|
||||
opacity = App.instance.darkMode ? 0.1 : opacity;
|
||||
|
||||
return {
|
||||
silent: true,
|
||||
data:
|
||||
|
||||
@@ -57,6 +57,13 @@
|
||||
text-align: right;
|
||||
float: right;
|
||||
|
||||
// Status / Problems
|
||||
span.status
|
||||
{
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
// Percentage score
|
||||
span.percent
|
||||
{
|
||||
font-style: italic;
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6" class="grade">
|
||||
<span v-if="assignment.problem" class="status entry-box" :style="{color: assignment.problemColor}">
|
||||
{{assignment.problem}}
|
||||
</span>
|
||||
<span class="percent entry-box">
|
||||
{{(assignment.score / assignment.scoreMax * 100).toFixed(1)}}
|
||||
<span class="symbol">%</span>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<div id="info">
|
||||
<div id="top">
|
||||
<div id="title">Veracross Analyzer for SJP</div>
|
||||
<div id="subtitle">Know your grades better.</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {Component, Vue} from 'vue-property-decorator';
|
||||
|
||||
@Component
|
||||
export default class Info extends Vue
|
||||
{
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
#top
|
||||
{
|
||||
padding: 40vh 0;
|
||||
|
||||
// Center and scale the image nicely
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
|
||||
text-align: right;
|
||||
|
||||
#title
|
||||
{
|
||||
font-size: 30px;
|
||||
margin-right: 10vw;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#subtitle
|
||||
{
|
||||
margin-right: 10vw;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
+3
-1
@@ -2,7 +2,9 @@
|
||||
"defaultSeverity": "warning",
|
||||
"linterOptions": {
|
||||
"exclude": [
|
||||
"node_modules/**"
|
||||
"node_modules/**",
|
||||
"*.json",
|
||||
"**/*.json"
|
||||
]
|
||||
},
|
||||
"rules": {
|
||||
|
||||
Reference in New Issue
Block a user