From 8689a964f596546b88de44bc46a128284c0adb47 Mon Sep 17 00:00:00 2001 From: Kenneth Jao Date: Thu, 13 Apr 2017 01:10:16 -0400 Subject: [PATCH] more small fixes --- hourglass/client/main/main.css | 17 +++++++++++++++++ hourglass/client/main/main.html | 2 +- hourglass/client/main/main.js | 18 ++++++++++++++++-- hourglass/client/menus/menus.html | 2 +- hourglass/client/profile/profile.html | 2 +- 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/hourglass/client/main/main.css b/hourglass/client/main/main.css index ccc9f0f..2cd7cd4 100644 --- a/hourglass/client/main/main.css +++ b/hourglass/client/main/main.css @@ -570,6 +570,23 @@ input { text-align: right; } +.cWorkBottom .fa-thumbs-up, .cWorkBottom .fa-exclamation-triangle { + pointer-events: all; + + -webkit-transition: color 0.4s ease; + -moz-transition: color 0.4s ease; + -ms-transition: color 0.4s ease; + transition: color 0.4s ease; +} + +.cWorkBottom .fa-thumbs-up:hover { + color: #27A127; +} + +.cWorkBottom .fa-exclamation-triangle:hover { + color: #FF1A1A; +} + input.clickModify, textarea.clickModify { width: 100%; font-size: 2.2vh; diff --git a/hourglass/client/main/main.html b/hourglass/client/main/main.html index db171a5..ee17de1 100644 --- a/hourglass/client/main/main.html +++ b/hourglass/client/main/main.html @@ -293,7 +293,7 @@
Due Date:
- +
Description:
diff --git a/hourglass/client/main/main.js b/hourglass/client/main/main.js index 63c7089..7715e4a 100644 --- a/hourglass/client/main/main.js +++ b/hourglass/client/main/main.js @@ -112,6 +112,7 @@ Template.registerHelper('myClasses', () => { // Gets all classes and respective Template.registerHelper('pref', (val) => { // Obtains all user preferences. try { + if(val === "school") return Session.get("user").school; var preferences = Session.get("user").preferences; return options[val].filter(function(entry) { return (val === 'theme') ? _.isEqual(preferences[val], themeColors[entry.val]) : preferences[val] === entry.val; @@ -395,6 +396,7 @@ Template.main.events({ $("#userDropdown").fadeIn(250); }, 'click .workCard' (event) { // Display work information on work card click. + if(event.target.className.indexOf("fa") !== -1) return; var workid = event.target.getAttribute("workid"); var thisWork = work.findOne({ _id: workid @@ -640,6 +642,14 @@ Template.main.events({ 'click #markReport' () { // Click report button. serverData = [Session.get("currentWork")._id, "reports"]; sendData("toggleWork"); + }, + 'click .cWorkBottom .fa-thumbs-up' (event) { + serverData = [event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("workid"), "confirmations"] + sendData("toggleWork") + }, + 'click .cWorkBottom .fa-exclamation-triangle' (event) { + serverData = [event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("workid"), "reports"] + sendData("toggleWork") } }); @@ -1011,7 +1021,11 @@ myClasses = function() { var repo = thisWork[j].reports.length; var ratio = conf / repo; var normalColor = Session.get("user").preferences.theme.text; - if (Math.abs(conf - repo)) { + + + thisWork[j].doneRatio = normalColor; + // Ratio color handling + /*if (Math.abs(conf - repo)) { if ((conf + repo) <= 1) { thisWork[j].doneRatio = normalColor; } else { @@ -1021,7 +1035,7 @@ myClasses = function() { thisWork[j].doneRatio = "#33DD33"; } else if (ratio <= 0.9) { thisWork[j].doneRatio = "#FF1A1A"; - } + }*/ } array[i].thisClassWork = thisWork.sort(function(a, b) { return Date.parse(a.realDate) - Date.parse(b.realDate); diff --git a/hourglass/client/menus/menus.html b/hourglass/client/menus/menus.html index 4afaa2f..757c1cf 100644 --- a/hourglass/client/menus/menus.html +++ b/hourglass/client/menus/menus.html @@ -299,7 +299,7 @@

**School:

- {{> inputAutocomplete settings=schoolComplete class="form-control creInput" type="text" form="school" placeholder="**School | Ex: International Academy" }} +

Hour:

diff --git a/hourglass/client/profile/profile.html b/hourglass/client/profile/profile.html index 8b4458f..a474c87 100644 --- a/hourglass/client/profile/profile.html +++ b/hourglass/client/profile/profile.html @@ -78,7 +78,7 @@

**School:

- {{> inputAutocomplete settings=schoolComplete class="form-control creInput" type="text" form="school" placeholder="**School | Ex: International Academy" }} +

Hour: