diff --git a/assets/css/other.css b/assets/css/other.css index 92d14c5..682dc2a 100644 --- a/assets/css/other.css +++ b/assets/css/other.css @@ -6,4 +6,23 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. #card-box .col { padding: 15px; +} + +#userlist .row { + overflow-y: auto; + + /* + 160px obtained from trial-and-error adjustments, if the login screen + is changed, this might need to be updated + */ + max-height: calc(100vh - 160px); +} + +.quick-user { + padding: 15px 5px; + text-align: center; +} + +.nav-tabs { + border-bottom: 1px solid #ddd; } \ No newline at end of file diff --git a/assets/img/logo_64.png b/assets/img/logo_64.png index 3395047..73388bd 100644 Binary files a/assets/img/logo_64.png and b/assets/img/logo_64.png differ diff --git a/cards/js/qwikclock_myshifts.js b/cards/js/qwikclock_myshifts.js new file mode 100644 index 0000000..47f4610 --- /dev/null +++ b/cards/js/qwikclock_myshifts.js @@ -0,0 +1,41 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +$(".card_qwikclock_myshifts").each(function () { + var card = $(this); + $(this).find(".card_title").prepend("Shifts | "); + var shiftbox = $(this).find(".shift-box"); + var shifttable = $(this).find(".shift-table"); + var url = $(this).data("apiurl"); + $.post(url, { + username: getuser(), + password: getAPIKey(), + action: "getassignedshifts" + }, function (resp) { + if (resp.status == "OK") { + var shifts = resp.shifts; + if (shifts.length > 0) { + shifttable.html('Shift Start End Days'); + shifttable.append(""); + for (var shift in shifts) { + var days = ""; + for (var day in shifts[shift]["day_list"]) { + days += " " + shifts[shift]["day_list"][day]; + } + days = days.trim(); + shifttable.append('' + shifts[shift]['shiftname'] + '' + shifts[shift]['start_f'] + '' + shifts[shift]['end_f'] + '' + days + ''); + } + shifttable.append(""); + } else { + shifttable.html('
No shifts assigned.
'); + } + } else { + showmsg(resp.msg, "danger"); + } + }, "json").fail(function () { + card.css("display", "none"); + }); +}); \ No newline at end of file diff --git a/cards/js/qwikclock_punchinout.js b/cards/js/qwikclock_punchinout.js index 26f3aea..b070ff6 100644 --- a/cards/js/qwikclock_punchinout.js +++ b/cards/js/qwikclock_punchinout.js @@ -4,6 +4,20 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +$(".card_qwikclock_punchinout").each(function () { + var card = $(this); + var url = $(this).data("apiurl"); + $.post(url, { + username: getuser(), + password: getAPIKey(), + action: "ping" + }, function (resp) { + // We didn't get a 403 + }, "json").fail(function () { + card.css("display", "none"); + }); +}); + $(".card_qwikclock_punchinout").on("click", ".start_btn", function () { var parent = $(this).parents(".card_app"); var url = parent.data("apiurl"); diff --git a/cards/js/taskfloor_viewmessages.js b/cards/js/taskfloor_viewmessages.js index 66549fe..b050af5 100644 --- a/cards/js/taskfloor_viewmessages.js +++ b/cards/js/taskfloor_viewmessages.js @@ -6,7 +6,8 @@ $(".card_taskfloor_viewmessages").each(function () { - $(this).find(".card_title").append(" Messages"); + var card = $(this); + $(this).find(".card_title").prepend("Messages | "); var msglist = $(this).find(".message-list"); var url = $(this).data("apiurl"); $.post(url, { @@ -27,5 +28,7 @@ $(".card_taskfloor_viewmessages").each(function () { } else { showmsg(resp.msg, "danger"); } - }, "json"); + }, "json").fail(function () { + card.css("display", "none"); + }); }); \ No newline at end of file diff --git a/cards/js/taskfloor_viewtasks.js b/cards/js/taskfloor_viewtasks.js index 73354b5..7e85a03 100644 --- a/cards/js/taskfloor_viewtasks.js +++ b/cards/js/taskfloor_viewtasks.js @@ -6,7 +6,8 @@ $(".card_taskfloor_viewtasks").each(function () { - $(this).find(".card_title").append(" Tasks"); + var card = $(this); + $(this).find(".card_title").prepend("Tasks | "); var tasklist = $(this).find(".task-list"); var url = $(this).data("apiurl"); $.post(url, { @@ -28,5 +29,7 @@ $(".card_taskfloor_viewtasks").each(function () { } else { showmsg(resp.msg, "danger"); } - }, "json"); + }, "json").fail(function () { + card.css("display", "none"); + }); }); \ No newline at end of file diff --git a/cards/qwikclock_myshifts.html b/cards/qwikclock_myshifts.html new file mode 100644 index 0000000..9477b23 --- /dev/null +++ b/cards/qwikclock_myshifts.html @@ -0,0 +1,9 @@ + +

QwikClock | Shifts

+ + +
\ No newline at end of file diff --git a/cards/taskfloor_viewmessages.html b/cards/taskfloor_viewmessages.html index f5b68dd..5f62831 100644 --- a/cards/taskfloor_viewmessages.html +++ b/cards/taskfloor_viewmessages.html @@ -3,8 +3,6 @@ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. --> -

TaskFloor Messages

-
-
-
+

TaskFloor Messages

+
\ No newline at end of file diff --git a/cards/taskfloor_viewtasks.html b/cards/taskfloor_viewtasks.html index a519452..b545d91 100644 --- a/cards/taskfloor_viewtasks.html +++ b/cards/taskfloor_viewtasks.html @@ -3,8 +3,6 @@ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. --> -

TaskFloor Tasks

-
-
-
+

TaskFloor Tasks

+
\ No newline at end of file diff --git a/index.html b/index.html index b92d882..a1c780c 100644 --- a/index.html +++ b/index.html @@ -11,19 +11,18 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. + + -
- -
+
-
-
+
@@ -35,5 +34,5 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. \ No newline at end of file diff --git a/js/functions.js b/js/functions.js index ce93f14..8ba0c98 100644 --- a/js/functions.js +++ b/js/functions.js @@ -44,7 +44,7 @@ function showmsg(text, style, details, timeout) { } $("#alert-box") .hide() - .html('') + .html('') .fadeIn("fast"); clearTimeout(msgtimeout); if (timeout !== false) { diff --git a/js/home.js b/js/home.js index 1a1f625..d2b5a9f 100644 --- a/js/home.js +++ b/js/home.js @@ -8,10 +8,19 @@ var loadedCardTypes = []; var totalCardTypes = []; +var cardSettings = { + "qwikclock_punchinout": {"classes": "col-sm-12 col-md-4 col-lg-4 col-xl-4 order-1"}, + "qwikclock_myshifts": {"classes": "col-sm-12 col-md-8 col-lg-8 col-xl-6 order-2"} +}; + function loadCard(type, apiurl, title) { $.get("cards/" + type + ".html", {}, function (html) { console.log(type + " " + apiurl + " " + title); - var box = $('
'); + var cardClasses = "col-sm-12 col-md-6 col-lg-6 col-xl-4 order-12"; + if (cardSettings.hasOwnProperty(type) && cardSettings[type].hasOwnProperty("classes")) { + cardClasses = cardSettings[type]["classes"]; + } + var box = $('
'); var card = $('
'); $(card).html(html); $(box).html(card); @@ -69,4 +78,5 @@ getApps(function (apps) { startSessionTimeout(); -$("#sign-out-btn").css("display", "inline-block"); \ No newline at end of file +$("#sign-out-btn").css("display", "inline-block"); +$("#refresh-btn").css("display", "inline-block"); \ No newline at end of file diff --git a/main.js b/main.js index 044b742..bd3d3c9 100644 --- a/main.js +++ b/main.js @@ -8,7 +8,6 @@ nw.Window.open('index.html', { "id": "station_mainwindow" }, function (win) { - win.setMinimumSize(780, 640); + win.setMinimumSize(640, 480); win.setPosition("center"); - }); diff --git a/pages/login.html b/pages/login.html index 0f7e170..1d0aba0 100644 --- a/pages/login.html +++ b/pages/login.html @@ -1,6 +1,6 @@
-
+

Login

+
+
+
+ +
+ Caroline Herschel +
+
+ +
+ Edmond Halley +
+
+ +
+ Jocelyn Bell Burnell +
+
+ +
+ Max Born +
+
+ +
+ Patty Jo Watson +
+
+ +
+ Sarah Boysen +
+
+