summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--css/styles.css30
-rw-r--r--index.html2
-rw-r--r--js/changelog.js24
-rw-r--r--js/grades.js21
-rw-r--r--login.html2
-rw-r--r--logout.html2
-rw-r--r--pages/about.html8
-rw-r--r--pages/absences.html2
-rw-r--r--pages/changelog.html66
-rw-r--r--pages/grades.html21
-rw-r--r--pages/gradings.html2
-rw-r--r--pages/privacypolicy.html2
-rw-r--r--pages/teachers.html2
-rw-r--r--pages/timetable.html2
-rw-r--r--pages/tos.html2
-rw-r--r--sw.js4
16 files changed, 173 insertions, 19 deletions
diff --git a/css/styles.css b/css/styles.css
index d02ed1e..25e5fe0 100644
--- a/css/styles.css
+++ b/css/styles.css
@@ -2,6 +2,7 @@
--color-primary: rgba(0, 128, 83, 1);
--color-secondary: rgba(0, 77, 50, 1);
--color-accent: rgba(0, 156, 101, 1);
+ --color-primary-light: rgba(230, 250, 231, 1);
}
.title-primary {
@@ -59,4 +60,33 @@ a {
a.collection-item {
color: var(--color-primary) !important;
+}
+
+.datepicker-date-display {
+ background-color: var(--color-primary);
+}
+
+.datepicker-table td.is-today {
+ color: var(--color-primary);
+}
+
+.datepicker-table td.is-selected {
+ background-color: var(--color-primary);
+}
+
+.datepicker-table td.is-selected.is-today {
+ background-color: var(--color-primary);
+ color: white;
+}
+
+.datepicker-cancel {
+ color: var(--color-primary);
+}
+
+.datepicker-done {
+ color: var(--color-primary);
+}
+
+.fc-unthemed td.fc-today {
+ background: var(--color-primary-light);
} \ No newline at end of file
diff --git a/index.html b/index.html
index 17c56a0..4c27e9a 100644
--- a/index.html
+++ b/index.html
@@ -2,7 +2,7 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>BežiApp</title>
diff --git a/js/changelog.js b/js/changelog.js
new file mode 100644
index 0000000..9fb9a84
--- /dev/null
+++ b/js/changelog.js
@@ -0,0 +1,24 @@
+async function checkLogin() {
+ localforage.getItem("logged_in").then(function (value) {
+ // This code runs once the value has been loaded
+ // from the offline store.
+ if (value !== true) {
+ window.location.replace("/index.html");
+ }
+ }).catch(function (err) {
+ // This code runs if there were any errors
+ console.log(err);
+ });
+}
+
+document.addEventListener("DOMContentLoaded", () => {
+ checkLogin();
+
+ // Setup back button
+ $("#nav-back-button").click(function () {
+ window.location.replace("/pages/about.html");
+ });
+
+ var elems = document.querySelectorAll(".collapsible");
+ var instances = M.Collapsible.init(elems, {});
+}); \ No newline at end of file
diff --git a/js/grades.js b/js/grades.js
index 1768fb0..5c544fb 100644
--- a/js/grades.js
+++ b/js/grades.js
@@ -1,6 +1,8 @@
const API_ENDPOINT = "https://gimb.tk/test.php";
// const API_ENDPOINT = "http://localhost:5000/test.php";
+let checkbox_state = false;
+
async function checkLogin() {
localforage.getItem("logged_in").then((value) => {
// This code runs once the value has been loaded
@@ -167,8 +169,8 @@ function displayGrades() {
grade_node.appendChild(grade_node_div);
- // Count the grade only if it's not temprary
- if (!grade["temporary"]) {
+ // Count the grade only if it's not temporary or explicitly enabled
+ if (!grade["temporary"] || !checkbox_state) {
grade_sum += grade["grade"];
grade_tot += 1;
}
@@ -205,9 +207,9 @@ function clearGrades() {
}
}
-function refreshGrades() {
+function refreshGrades(force) {
clearGrades();
- loadGrades(true);
+ loadGrades(force);
}
function refreshClickHandlers() {
@@ -252,9 +254,18 @@ document.addEventListener("DOMContentLoaded", async () => {
// Setup refresh handler
$("#refresh-icon").click(function () {
- refreshGrades();
+ refreshGrades(true);
+ });
+
+ // Setup checkbox handler
+ $("#permanent-grades-checkbox").change(function () {
+ checkbox_state = this.checked;
+ refreshGrades(false);
});
+ let elems = document.querySelectorAll('.modal');
+ let instances = M.Modal.init(elems, {});
+
// Setup side menu
const menus = document.querySelectorAll('.side-menu');
M.Sidenav.init(menus, { edge: 'right', draggable: true });
diff --git a/login.html b/login.html
index 6fe37b0..b43949d 100644
--- a/login.html
+++ b/login.html
@@ -2,7 +2,7 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>BežiApp</title>
diff --git a/logout.html b/logout.html
index bfdabcf..cf53cdd 100644
--- a/logout.html
+++ b/logout.html
@@ -2,7 +2,7 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>BežiApp</title>
diff --git a/pages/about.html b/pages/about.html
index d9e052e..f31292f 100644
--- a/pages/about.html
+++ b/pages/about.html
@@ -2,7 +2,7 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>About</title>
@@ -71,7 +71,7 @@
<div class="col s12">
<h3><b class="title-secondary">Beži</b><span class="title-primary">App</span>
</h3>
- <h5 class="subheader">Version 1.0.3-beta</h5>
+ <h5 class="subheader">Version 1.0.4-beta</h5>
</div>
</div>
<div class="row">
@@ -101,9 +101,11 @@
<div class="row">
<div class="col s12">
<div class="collection">
+ <a href="/pages/changelog.html" class="collection-item">What's new</a>
<a href="/pages/tos.html" class="collection-item">Terms of Service</a>
<a href="/pages/privacypolicy.html" class="collection-item">Privacy policy</a>
- <a href="https://instagram.com/beziapp/" target="_blank" class="collection-item">Report a bug / Send a suggestion</a>
+ <a href="https://instagram.com/beziapp/" target="_blank" class="collection-item">Report a bug / Send
+ a suggestion</a>
</div>
</div>
</div>
diff --git a/pages/absences.html b/pages/absences.html
index 78bfd79..ae7a23b 100644
--- a/pages/absences.html
+++ b/pages/absences.html
@@ -2,7 +2,7 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Absences</title>
diff --git a/pages/changelog.html b/pages/changelog.html
new file mode 100644
index 0000000..a2abb77
--- /dev/null
+++ b/pages/changelog.html
@@ -0,0 +1,66 @@
+<html lang="en">
+
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
+ <title>Changelog</title>
+
+ <!-- Materialize -->
+ <link type="text/css" href="/css/materialize.min.css" rel="stylesheet">
+ <link href="/css/materialicons.css" rel="stylesheet">
+ <link href="/css/fontawesome.min.css" rel="stylesheet">
+ <script type="text/javascript" src="/js/lib/materialize.min.js"></script>
+
+ <script src="/js/lib/jquery.min.js"></script>
+ <script type="text/javascript" src="/js/lib/localforage.min.js"></script>
+
+ <link type="text/css" href="/css/styles.css" rel="stylesheet">
+ <script type="text/javascript" src="/js/changelog.js"></script>
+
+ <link rel="manifest" href="/manifest.json">
+ <script src="/js/app.js"></script>
+ <link rel="shortcut icon" type="image/png" href="/favicon.png" />
+
+ <!-- iOS support -->
+ <link rel="apple-touch-icon" href="/img/icons/icon_96.png">
+ <link rel="apple-touch-icon" href="/img/icons/icon_512.png">
+ <meta name="apple-mobile-web-app-status-bar" content="#004d32">
+</head>
+
+<body>
+ <nav class="z-depth-0" id="navigation-main">
+ <div class="nav-wrapper container">
+ <b>Beži</b><span>App</span>
+ <span class="right white-text" id="nav-back-button">
+ <i class="material-icons">arrow_back</i>
+ </span>
+ </div>
+ <div id="loading-bar" class="progress hidden">
+ <div class="indeterminate"></div>
+ </div>
+ </nav>
+
+ <div class="container">
+ <div class="row">
+ <h3>Changelog</h3>
+ <ul class="collapsible">
+ <li>
+ <div class="collapsible-header">Version 1.0.4-beta</div>
+ <div class="collapsible-body">
+ <ul class="collection">
+ <li class="collection-item">Introduced the changelog</li>
+ <li class="collection-item">Fixed date picker color</li>
+ <li class="collection-item">Changed weekly timetable accent color</li>
+ <li class="collection-item">Option for including/excluding temporary grades in average
+ calculation (credit: Tinkara)</li>
+ </ul>
+ </div>
+ </li>
+ </ul>
+ </div>
+ </div>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/pages/grades.html b/pages/grades.html
index 95acd22..6332d59 100644
--- a/pages/grades.html
+++ b/pages/grades.html
@@ -2,7 +2,7 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Grades</title>
@@ -88,8 +88,27 @@
<li><a class="waves-effect" id="grade-type"></a></li>
</ul>
+ <div id="help-modal" class="modal bottom-sheet">
+ <div class="modal-content">
+ <h4>Use only permanent grades</h4>
+ <p>If checked, only permanent grades will be used in the average grade calculation.</p>
+ <p>If left unchecked, the calculation will include every available grade.</p>
+ </div>
+ <!-- <div class="modal-footer">
+ <a href="#!" class="modal-close waves-effect waves-green btn-flat">Agree</a>
+ </div> -->
+ </div>
+
<br>
<div class="container">
+ <p>
+ <label>
+ <input id="permanent-grades-checkbox" type="checkbox" />
+ <span style="vertical-align: sub;">Use only permanent grades <a id="help-icon" class="modal-trigger"
+ href="#help-modal"><i class="material-icons"
+ style="vertical-align: sub;">help_outline</i></a></span>
+
+ </label></p>
<ul class="collapsible" id="grades-collapsible"></ul>
</div>
diff --git a/pages/gradings.html b/pages/gradings.html
index 14f0694..676b5ad 100644
--- a/pages/gradings.html
+++ b/pages/gradings.html
@@ -2,7 +2,7 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Gradings</title>
diff --git a/pages/privacypolicy.html b/pages/privacypolicy.html
index 72e0c2c..8daa469 100644
--- a/pages/privacypolicy.html
+++ b/pages/privacypolicy.html
@@ -2,7 +2,7 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Privacy policy</title>
diff --git a/pages/teachers.html b/pages/teachers.html
index 7e869ca..6c4bc19 100644
--- a/pages/teachers.html
+++ b/pages/teachers.html
@@ -2,7 +2,7 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Teachers</title>
diff --git a/pages/timetable.html b/pages/timetable.html
index 9d6922e..f3426f1 100644
--- a/pages/timetable.html
+++ b/pages/timetable.html
@@ -2,7 +2,7 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Timetable</title>
diff --git a/pages/tos.html b/pages/tos.html
index e25a022..2f0304c 100644
--- a/pages/tos.html
+++ b/pages/tos.html
@@ -2,7 +2,7 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Terms and Conditions</title>
diff --git a/sw.js b/sw.js
index 0e5ef4e..adb6539 100644
--- a/sw.js
+++ b/sw.js
@@ -1,5 +1,5 @@
// Change version to cause cache refresh
-const static_cache_name = "site-static-v1.0.3";
+const static_cache_name = "site-static-v1.0.4";
// Got them with du -a and minor cleaning up
const assets = [
"/img/avatars/asijanec.png",
@@ -21,6 +21,7 @@ const assets = [
"/pages/timetable.html",
"/pages/tos.html",
"/pages/privacypolicy.html",
+ "/pages/changelog.html",
"/fonts/materialicons.woff2",
"/fonts/fa-regular-400.eot",
@@ -51,6 +52,7 @@ const assets = [
"/js/absences.js",
"/js/tos.js",
"/js/privacypolicy.js",
+ "/js/changelog.js",
"/js/lib/materialize.min.js",
"/js/lib/fullcalendar/daygrid/main.min.js",