From 875457953f6e50bd5a1612656ca697667b1b21cd Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Wed, 20 Dec 2017 17:23:39 -0700 Subject: [PATCH] Lots of things Add QC shifts, add proper icon, check for app permissions, adjust styles, fix UI bugs, prepare login UI for quick access mode --- assets/css/other.css | 19 +++++++++++++ assets/img/logo_64.png | Bin 2794 -> 1014 bytes cards/js/qwikclock_myshifts.js | 41 +++++++++++++++++++++++++++++ cards/js/qwikclock_punchinout.js | 14 ++++++++++ cards/js/taskfloor_viewmessages.js | 7 +++-- cards/js/taskfloor_viewtasks.js | 7 +++-- cards/qwikclock_myshifts.html | 9 +++++++ cards/taskfloor_viewmessages.html | 6 ++--- cards/taskfloor_viewtasks.html | 6 ++--- index.html | 11 ++++---- js/functions.js | 2 +- js/home.js | 14 ++++++++-- main.js | 3 +-- pages/login.html | 36 ++++++++++++++++++++++++- 14 files changed, 151 insertions(+), 24 deletions(-) create mode 100644 cards/js/qwikclock_myshifts.js create mode 100644 cards/qwikclock_myshifts.html 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 339504741b41fc266996cc3de89669173d485437..73388bd6cf0bdaf27eb82fbfb42d90e36592f891 100644 GIT binary patch delta 919 zcmV;I18Dr}74`>^ZGQuENklt;1W^wbq|`%tZExMK zP!kI&ww?;xlRqv!_NE81|A647m0VnHDZTBs^dL4@r;tO56v03ci?J08?ZQa>_K>XZ zw$)5@X1?8K9vH}E-gkK3PcrYklQ*xS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tgI~7 zu3d|!r7i|JHrP-nd8ZwYI1S40t3Xv%3?q7JFI>EW=T4Y^-!t3%+-)q7{!50a72xrB zZWz3->nvKbf^BEa-?!RT{9laXcDuQH^(wsyf|u!_p+u0c3x5m=|D9wvC@d^Q$t|8Z z@mZ--l&1cSBZ>gO-yij#RaMojS^pSET;=TTGL1iVi{xVa$+&G&L0_+fH4$!58RG_Z zi#vYH9#j*wDo5=OzN5yQ*Pic-S)AaS2cqWzzTg{vbqtYib3g zlsJ1GJTNyRD4JW3qA1L-Z{+3Ep_F%tLRb44OLm`e#D68=%9SfTFh_~}xEO%%H%SKj zE?CxqarE_c@L0$V4mu5HRaUZ~u8#dqGw{h$VN-)bXZtxz?Zzd*Od(ej1cGqLX|QVb?L6ON&h~ffRr(wk@cH5&x~76D zQiU~oV`3Sr7-)5VPXaP9Kt z%Pc83-M}A&mMiAg_p{~DdHPsJY|bbGq?8N|4S%z$YNA`Z3Uy^Ru3x{N5t}oL0A1H9 zDlHA4^#S+{c&<4>!_v%LYnV|46ciNDan-otGuzMlgA|oy<`UbCB4BiMl!YZKYD}Ef zSf=0_y_ON1Gl~Ge-_Jn*MV`IehAq^y1;q-#y-Uz}`glfc+Av>B%$Se(TRuC)Ei3#q zKYzK<{JuEgqxEoernX{f1BRGEw?qxYp!MhxT8|!?^kBqd3@X6U@n4FPyhn&oVx%Vd ze!vz{Kc3xqgCDQ2rjV4y=*#B{=3QC<^78U1E-s$_!&DW!-44Kg4f#oRgr-_Z0fc`2r4Tpsi>$3mtAs8PEPac?5Zl2JS|MX zE?|A+<>}XfwF!Iw)xa*`2_eL2n2yj&*ob+Rb|p{|r}52-0ZhGn5!gO{eg1#NH4-_> T*`{fh00000NkvXXu0mjfBjY_> 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 +
+
+