Skip to content

Commit

Permalink
Fixed marks for new period system, updated dependencies, version incr…
Browse files Browse the repository at this point in the history
…ement
  • Loading branch information
Litarvan committed Nov 30, 2019
1 parent 302bd06 commit 1e1975e
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 41 deletions.
4 changes: 2 additions & 2 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="fr.litarvan.sakado" version="1.4.0-BETA" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="fr.litarvan.sakado" version="1.6.0-BETA" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Sakado</name>
<description>An app for school.</description>
<author email="[email protected]" href="https://github.com/Litarvan">Adrien 'Litarvan' Navratil</author>
Expand All @@ -12,7 +12,7 @@
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="16" />
<preference name="android-minSdkVersion" value="19" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
Expand Down
3 changes: 1 addition & 2 deletions ionic.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
"integrations": {
"cordova": {}
},
"type": "ionic-angular",
"app_id": ""
"type": "ionic-angular"
}
43 changes: 31 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@ionic-native/splash-screen": "4.4.0",
"@ionic-native/status-bar": "4.4.0",
"@ionic/storage": "2.1.3",
"cordova-android": "7.1.1",
"cordova-android": "^7.1.1",
"cordova-ios": "4.5.5",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-ionic-webview": "^1.1.16",
Expand Down
6 changes: 3 additions & 3 deletions src/app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
import { enableProdMode } from '@angular/core';

export const VERSION = 'Beta 1.5.0';
export const SERVER_URL = 'https://api.sakado.litarvan.com/';
export const DEBUG = true;
export const VERSION = 'Beta 1.6.0';
export const SERVER_URL = 'https://sakado.tk/';
export const DEBUG = false;

if (!DEBUG)
{
Expand Down
2 changes: 1 addition & 1 deletion src/pages/about/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<img id="about-splash" src="assets/imgs/about.svg" />

<h2 id="version">{{ version }}</h2>
<p id="copyright">Copyright (c) 2017-2018 Adrien 'Litarvan' Navratil</p>
<p id="copyright">Copyright (c) 2017-2019 Adrien 'Litarvan' Navratil</p>

<button ion-button (click)="showLicense()">License</button>

Expand Down
40 changes: 24 additions & 16 deletions src/pages/marks-details/marks-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,36 @@ export class MarksDetailsPage implements OnInit
ngOnInit()
{
this.api.userQuery(`{
periods {
id
isDefault
}
marks {
name
average
studentClassAverage
minAverage
maxAverage
period
marks {
title
value
away
max
name
average
higher
lower
coefficient
time
studentClassAverage
minAverage
maxAverage
marks {
title
value
away
max
average
higher
lower
coefficient
time
}
}
}
}`).then(result => {
this.marks = result.marks;
console.log(result.marks);
const period = result.periods.find(p => p.isDefault);
this.marks = result.marks.find(p => p.period === period.id).marks;
});
}

Expand Down
18 changes: 14 additions & 4 deletions src/pages/marks/marks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,23 @@ export class MarksPage implements OnInit
time
}
averages {
student
studentClass
periods {
id
isDefault
}
marks {
period
averages {
student
studentClass
}
}
}`).then(result => {
const period = result.periods.find(p => p.isDefault);

this.averages = result.marks.find(p => p.period === period.id).averages;
this.marks = result.lastMarks;
this.averages = result.averages;
});
}

Expand Down

0 comments on commit 1e1975e

Please sign in to comment.