Compare commits

...

39 Commits

Author SHA1 Message Date
Hykilpikonna 46ef56efbd [M] Move deploy script 2020-01-27 16:49:48 -05:00
Hykilpikonna 7b04d1e006 [F] Enable third quarter 2020-01-27 16:49:38 -05:00
Hykilpikonna 511d4544b6 [U] Release v0.5.3.1373 2020-01-27 16:45:09 -05:00
Hykilpikonna 140893a9b2 [S] Correct margins
#3
2020-01-27 16:38:08 -05:00
Hykilpikonna 427773f4cb [+] Display assignment completion status if it is not complete
#3
2020-01-27 16:37:48 -05:00
Hykilpikonna dfeb5d0272 [+] Create method to get completion status color
#3
2020-01-27 16:37:10 -05:00
Hykilpikonna 304ba63771 [+] Create method to get completion status
#3
2020-01-27 16:36:43 -05:00
Hykilpikonna 1698f1737d [+] Include late and NREQ assignments
#3
2020-01-27 16:03:09 -05:00
Hykilpikonna 9d8a797c54 [-] Remove background for now 2020-01-23 20:35:16 -05:00
Hykilpikonna 4d0c48619d [+] Add title 2020-01-05 18:27:12 -05:00
Hykilpikonna e95d212628 [O] Compress background 2020-01-05 18:25:42 -05:00
Hykilpikonna 936e6ffa41 [+] Create info page background 2020-01-05 18:23:32 -05:00
Hykilpikonna f2a3260b8f [F] Dark mode should not apply to info page 2020-01-05 17:33:25 -05:00
Hykilpikonna 5c8b2b37d4 [O] Mark darkmode as unfinished 2020-01-05 17:31:33 -05:00
Hykilpikonna 44e4b615ba [S] Auto opacity based on darkmode 2020-01-05 17:31:18 -05:00
Hykilpikonna 60a852815b [S] Dark mode for unread number 2020-01-05 17:18:15 -05:00
Hykilpikonna 7c7d7e609a [S] Make course assignment type background look nicer 2020-01-05 17:17:43 -05:00
Hykilpikonna 0da5be9448 [S] Fix darkmode for navbar 2020-01-05 17:13:39 -05:00
Hykilpikonna 1ebb69c89c [S] Fix darkmode for desktop background 2020-01-05 17:13:29 -05:00
Hykilpikonna 99af1c4607 [S] Remove awkward white areas 2020-01-05 17:10:46 -05:00
Hykilpikonna e1caacce34 [+] Implement dark mode switcing 2020-01-05 17:09:13 -05:00
Hykilpikonna e2b6a92743 [O] Change text depending on isDark value 2020-01-05 17:09:03 -05:00
Hykilpikonna 982c8cf872 [+] Create isDark() function 2020-01-05 17:07:58 -05:00
Hykilpikonna 1e928ac1a8 [+] Add darkmode button 2020-01-05 17:07:39 -05:00
Hykilpikonna a17ab1511d [+] Add dark mode class depending on the switch 2020-01-05 17:07:28 -05:00
Hykilpikonna 07c55df766 [+] Initialize dark mode switch to cookie value 2020-01-05 17:07:15 -05:00
Hykilpikonna 06ee7b4de9 [+] Add dark mode switch 2020-01-05 17:07:00 -05:00
Hykilpikonna 0c520d5f50 [+] Use logo more compatible to dark mode 2020-01-05 17:06:48 -05:00
Hykilpikonna 522867a2dc [F] Ignore static page detection for nav-controller 2020-01-05 16:23:17 -05:00
Hykilpikonna d56d985734 [+] Display content according to staticpage 2020-01-05 16:22:56 -05:00
Hykilpikonna 1d404b4f51 [+] Detect static pages 2020-01-05 16:22:25 -05:00
Hykilpikonna c1d3cc88bc [+] Add static page field 2020-01-05 16:22:18 -05:00
Hykilpikonna 1242e2ed58 [+] Import info static page 2020-01-05 16:22:10 -05:00
Hykilpikonna f61dccb90a [+] Add hello world for testing 2020-01-04 21:15:42 -05:00
Hykilpikonna 106da7e7f1 [+] Create info component 2020-01-04 18:57:17 -05:00
Hykilpikonna 4774ad658b [O] Ignore jsons from tslint 2020-01-04 18:51:43 -05:00
Hykilpikonna 6035fe5318 [F] Fix older version url navigation issue 2020-01-04 18:51:26 -05:00
Hykilpikonna 452ac69fb6 [+] Add reminder in deploy script 2020-01-04 18:47:25 -05:00
Hykilpikonna 3ec604f049 [+] Redirect from vera.hydev.org/info 2020-01-04 18:47:13 -05:00
18 changed files with 238 additions and 48 deletions
+3
View File
@@ -1,5 +1,8 @@
#!/usr/bin/env bash
#echo "Switch to production database settings"
#exit
# abort on errors
set -e
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 51 KiB

+14
View File
@@ -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

+5 -10
View File
@@ -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;}
}
// ##############
+17 -1
View File
@@ -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
View File
@@ -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>
+15
View File
@@ -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}
}
+4 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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();
}
/**
+4
View File
@@ -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>
+45
View File
@@ -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
View File
@@ -2,7 +2,9 @@
"defaultSeverity": "warning",
"linterOptions": {
"exclude": [
"node_modules/**"
"node_modules/**",
"*.json",
"**/*.json"
]
},
"rules": {