summaryrefslogtreecommitdiffstats
path: root/assets
diff options
context:
space:
mode:
Diffstat (limited to 'assets')
-rw-r--r--assets/css/styles.css4
-rw-r--r--assets/js/gradings.js40
-rw-r--r--assets/js/lang/bundle.js20
-rw-r--r--assets/js/setup-storage.js2
-rw-r--r--assets/pages-src/gradings.bvr38
-rw-r--r--assets/pages-src/misc/grading-add-modal.bvr35
-rw-r--r--assets/pages-src/misc/msg-compose-modal.bvr4
7 files changed, 93 insertions, 50 deletions
diff --git a/assets/css/styles.css b/assets/css/styles.css
index 4e6050b..ba3d5cb 100644
--- a/assets/css/styles.css
+++ b/assets/css/styles.css
@@ -417,3 +417,7 @@ p {
h1, h2, h3, h4, h5, h6 {
color: var(--color-text) !important;
}
+
+.card {
+ background-color: var(--background-accent) !important;
+}
diff --git a/assets/js/gradings.js b/assets/js/gradings.js
index f884bf2..4730248 100644
--- a/assets/js/gradings.js
+++ b/assets/js/gradings.js
@@ -131,6 +131,18 @@ function displayData() {
calendar_obj.addEventSource(transformed_gradings);
}
+async function validateInputs() {
+ if ($("#input-grading-name").val() != null && $("#input-grading-name").val().length > 0) {
+ $("#btn-add-grading").removeAttr("disabled");
+ $("#input-grading-name").addClass("valid");
+ $("#input-grading-name").removeClass("invalid");
+ } else {
+ $("#btn-add-grading").attr("disabled", "disabled");
+ $("#input-grading-name").addClass("invalid");
+ $("#input-grading-name").removeClass("valid");
+ }
+}
+
function gradingClickHandler(eventClickInfo) {
let grading_id = parseInt(eventClickInfo.event.id);
let grading_subject = gradings[grading_id]["subject"];
@@ -144,19 +156,21 @@ function gradingClickHandler(eventClickInfo) {
M.Sidenav.getInstance(modal).open();
}
- function setupPickers() {
- // Setup pickers, todo (adding an event), to be stored in messages
- var date_object = new Date();
- let elems = document.querySelectorAll('#datepicker-add');
- let options = {
- autoClose: true,
- format: "dd.mm.yyyy",
- defaultDate: date_object,
- setDefaultDate: true,
- firstDay: 1
- }
- instances = M.Datepicker.init(elems, options);
+
+function setupPickers() {
+ // Setup pickers, todo (adding an event), to be stored in messages
+ var date_object = new Date();
+ let elems = document.querySelectorAll('#datepicker-add');
+ let options = {
+ autoClose: true,
+ format: "dd.mm.yyyy",
+ defaultDate: date_object,
+ setDefaultDate: true,
+ firstDay: 1
}
+ instances = M.Datepicker.init(elems, options);
+}
+
document.addEventListener("DOMContentLoaded", () => {
@@ -176,6 +190,7 @@ document.addEventListener("DOMContentLoaded", () => {
calendar_obj.render();
// Modal for adding gradings
+
// setupPickers(); // todo (adding an event), to be stored in messages
// // Setup modals
// const modal_elems = document.querySelectorAll('.modal');
@@ -186,6 +201,7 @@ document.addEventListener("DOMContentLoaded", () => {
// };
// M.Modal.init(modal_elems, modal_options);
+
loadGradings(true);
// Setup refresh handler
$("#refresh-icon").click(() => {
diff --git a/assets/js/lang/bundle.js b/assets/js/lang/bundle.js
index 8270527..eeee695 100644
--- a/assets/js/lang/bundle.js
+++ b/assets/js/lang/bundle.js
@@ -10,7 +10,7 @@ var dateString = {
return mesecileta[mesl];
},
longFormatted: (dateObject) => {
- return dateString.day(dateObject.getDay())+", "+(dateObject.getDate())+". "+dateString.month(dateObject.getMonth())+" "+dateObject.getFullYear();
+ return `${dateString.day(dateObject.getDay())}, ${(dateObject.getDate())}. ${dateString.month(dateObject.getMonth())} ${dateObject.getFullYear()}`;
}
};
async function refreshLangDOM() {
@@ -143,7 +143,7 @@ var langstrings = {
and: "and",
thePrivacyPolicy: "the privacy policy",
loginFailed: "login failed",
- browserNotSupported: "bežiapp won't work on your device, unless you update your Internet browser",
+ browserNotSupported: "bežiapp won't work on your device, unless you update your Internet browser",
// index
timetable: "timetable",
gradings: "gradings",
@@ -158,7 +158,11 @@ var langstrings = {
// timetable
noPeriods: "no periods in selected week",
// gradings
+ date: "date",
+ description: "description",
+ add: "add",
requestFailed: "request failed",
+ addGrading: "add grading",
noInternetConnection: "no internet connection",
// grades
temporary: "temporary",
@@ -186,6 +190,7 @@ var langstrings = {
// messaging
loadingMessages: "Loading messages...",
sendAMessage: "send a message",
+ send: "send",
recipient: "recipient",
messageSubject: "subject",
messageBody: "message body",
@@ -226,7 +231,7 @@ var langstrings = {
recipientNotInDirectory: "recipient is not in directory.",
chatExternalInfo: "you have just received a chat. Chats are not supported by GimSIS, so you must reply by changing the subject to something else. Chat body: ",
// meals
- loginError: "login error",
+ loginError: "login error",
loginToLopolis: "login to Lopolis",
loginToLopolisNote: "it seems like you're not currently logged in to eRestavracija, so this form has been presented to you. You have a different username and password combination used for applying and opting out of of menus. In order to use this feature, you have to log in with your Lopolis account.",
logInToLopolis: "log in to Lopolis",
@@ -359,7 +364,11 @@ var langstrings = {
logout: "odjava",
settings: "nastavitve",
// gradings
+ date: "datum",
+ description: "opis",
+ add: "dodaj",
requestFailed: "zahteva spodletela",
+ addGrading: "dodaj ocenjevanje",
noInternetConnection: "ni povezave s spletom",
// grades
temporary: "začasno",
@@ -376,7 +385,7 @@ var langstrings = {
// absences
from: "od",
to: "do",
- cancel: "preklic",
+ cancel: "prekliči",
ok: "v redu",
noAbsences: "ni izostankov v izbranem časovnem obdobju",
lesson: "ura",
@@ -387,6 +396,7 @@ var langstrings = {
// messaging
loadingMessages: "Nalagam sporočila...",
sendAMessage: "pošlji sporočilo",
+ send: "pošlji",
recipient: "prejemnik",
messageSubject: "zadeva",
messageBody: "telo",
@@ -499,7 +509,7 @@ var langstrings = {
on: "vklopljeno",
off: "izklopljeno",
selectErrorReporting: "ali naj so napake v aplikaciji posredovane razvijalcem?",
- triggerWarning: "spodnji gumb omogoči dodatne možnosti, ki lahko razburijo/vznevoljijo nekatere uporabnike. Če omogočite stikalo se strinjate, da avtorjev in/ali njihovih osebnih prepričanj ne boste povezovali s katerokoli od dodatnih omogočenih možnosti.",
+ triggerWarning: "spodnji gumb omogoči dodatne možnosti, ki lahko razburijo/vznevoljijo nekatere uporabnike. Če omogočite stikalo, se strinjate, da avtorjev in/ali njihovih osebnih prepričanj ne boste povezovali s katerokoli od dodatnih omogočenih možnosti",
triggerAgreement: "strinjam se z zgoraj navedenimi pogoji",
triggerWarningSet: "spremenili ste stanje dodatnih nastavitev",
additionalOptions: "dodatne nastavitve",
diff --git a/assets/js/setup-storage.js b/assets/js/setup-storage.js
index 0d2552a..c862d5f 100644
--- a/assets/js/setup-storage.js
+++ b/assets/js/setup-storage.js
@@ -15,7 +15,7 @@ async function setupStorage(force = false) {
localforage.setItem("gradings", []),
localforage.setItem("grades", []),
localforage.setItem("absences", {}),
- localforage.setItem("messages", { "0": [], "1": [], "2": []}), // see messages.js:129, commit 8eb9ca9caca30fbbe023243657535ab4088be377
+ localforage.setItem("messages", [[], [], []]), // see messages.js:129, commit 8eb9ca9caca30fbbe023243657535ab4088be377
localforage.setItem("directory", {}), //\\ well I could remember my own code but I didn't.
localforage.setItem("meals", {}),
localforage.setItem("chosenLang", "en"),
diff --git a/assets/pages-src/gradings.bvr b/assets/pages-src/gradings.bvr
index 672b8a2..109296b 100644
--- a/assets/pages-src/gradings.bvr
+++ b/assets/pages-src/gradings.bvr
@@ -75,37 +75,15 @@
<br>
<div id="calendar"></div>
</div>
-<!--
- <div class="container">
- <div class="row">
- <div class="col s12">
- <h4>Add a personal event</h4>
- <div class="row">
- <div class="input-field col s5">
- <input required="required" type="text" class="datepicker" id="datepicker-add">
- <label for="datepicker-add">Date</label>
- </div>
- <div class="input-field col s5">
- <input required="required" id="event_name" type="text" class="validate">
- <label for="event_name">Name</label>
- </div>
- <div class="input-field col s2">
- <button id="event_btn" class="btn waves-effect waves-light" type="text" class="validate">
- <i class="material-icons">event_available</i>
- </button>
- </div>
- </div>
- <div class="row">
- <div class="input-field col s12">
- <textarea required="required" id="event_description" class="materialize-textarea"></textarea>
- <label for="event_description">Description</label>
- </div>
- </div>
- </div>
- </div>
- </div>
--->
+ <!-- FAB -->
+ <div class="fixed-action-btn" id="fab-new">
+ <a class="btn-floating btn-large fab-new-message modal-trigger" href="#beziapp-add-grading">
+ <i class="large material-icons">add</i>
+ </a>
+ </div>
+ <@?i grading-add-modal@>
+
</body>
</html>
diff --git a/assets/pages-src/misc/grading-add-modal.bvr b/assets/pages-src/misc/grading-add-modal.bvr
new file mode 100644
index 0000000..0b7189d
--- /dev/null
+++ b/assets/pages-src/misc/grading-add-modal.bvr
@@ -0,0 +1,35 @@
+ <!-- Modal Structure -->
+ <div id="beziapp-add-grading" class="modal modal-fixed-footer">
+
+ <div class="modal-content">
+
+ <h4 class="general-text"><x-su>addGrading</x-su></h4>
+
+ <div class="row">
+ <div class="input-field col s6">
+ <input required="required" type="text" class="datepicker" id="datepicker-add">
+ <label for="datepicker-add"><x-su>date</x-su></label>
+ </div>
+ <div class="input-field col s6">
+ <input required="required" id="input-grading-name" type="text" class="validate">
+ <label for="event_name"><x-su>name</x-su></label>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="input-field col s12">
+ <textarea required="required" id="input-grading-description" class="materialize-textarea"></textarea>
+ <label for="event_description"><x-su>description</x-su></label>
+ </div>
+ </div>
+
+ </div>
+
+ <div class="modal-footer">
+ <div id="modal-footer-right">
+ <a href="#" class="modal-close waves-effect waves-green btn-flat"><x-su>cancel</x-su> <i class="material-icons right">close</i></a>
+ <a href="#" id="btn-add-grading" class="modal-close waves-effect waves-green btn-flat" disabled><x-su>add</x-su> <i class="material-icons right">add</i></a>
+ </div>
+ </div>
+ </div>
+
diff --git a/assets/pages-src/misc/msg-compose-modal.bvr b/assets/pages-src/misc/msg-compose-modal.bvr
index 5889214..48afaaf 100644
--- a/assets/pages-src/misc/msg-compose-modal.bvr
+++ b/assets/pages-src/misc/msg-compose-modal.bvr
@@ -57,8 +57,8 @@
<div class="modal-footer">
<div id="modal-footer-right">
- <a href="#" class="modal-close waves-effect waves-green btn-flat">Cancel <i class="material-icons right">close</i></a>
- <a href="#" id="msg-send" class="modal-close waves-effect waves-green btn-flat" disabled>Send <i class="material-icons right">send</i></a>
+ <a href="#" class="modal-close waves-effect waves-green btn-flat"><x-su>cancel</x-su> <i class="material-icons right">close</i></a>
+ <a href="#" id="msg-send" class="modal-close waves-effect waves-green btn-flat" disabled><x-su>send</x-su> <i class="material-icons right">send</i></a>
</div>
</div>
</div>