From e68ffb9dba2ba99f0b7afae4dd36fa26a85c93d9 Mon Sep 17 00:00:00 2001 From: Kenneth Jao Date: Sun, 21 Aug 2016 22:50:23 -0400 Subject: [PATCH] add leave class button --- hourglass/client/main/main.js | 1 + hourglass/client/profile/profile.css | 16 ++++++++++++---- hourglass/client/profile/profile.html | 4 ++++ hourglass/client/profile/profile.js | 5 +++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/hourglass/client/main/main.js b/hourglass/client/main/main.js index 908cce0..4f1a6e9 100644 --- a/hourglass/client/main/main.js +++ b/hourglass/client/main/main.js @@ -74,6 +74,7 @@ Template.registerHelper('myClasses', () => { found.subscribers = found.subscribers.length; if(found.admin === Meteor.userId()) found.box = " owned"; + found.mine = true; array.push(found); var thisWork = work.find({class: courses[i]}).fetch(); diff --git a/hourglass/client/profile/profile.css b/hourglass/client/profile/profile.css index c0c6a7c..2c42106 100644 --- a/hourglass/client/profile/profile.css +++ b/hourglass/client/profile/profile.css @@ -317,11 +317,11 @@ } .name { - width: 40%; + width: 45%; } .teacher { - width: 25%; + width: 20%; } .hour { @@ -332,6 +332,10 @@ width: 13%; } +.hour.classText, .subscribers.classText { + text-align: center; +} + #creRules { position: absolute; } @@ -536,7 +540,11 @@ margin-right: 5%; } -.userBox .fa-times { +.classBox .fa-times { + font-size: 110% !important; +} + +.userBox .fa-times, .classBox .fa-times { font-size: 150%; -webkit-transition: color 0.4s ease; @@ -545,7 +553,7 @@ transition: color 0.4s ease; } -.userBox .fa-times:hover { +.userBox .fa-times:hover, .classBox .fa-times:hover { color: #CC4444; } diff --git a/hourglass/client/profile/profile.html b/hourglass/client/profile/profile.html index 3c8b8f8..131f3ab 100644 --- a/hourglass/client/profile/profile.html +++ b/hourglass/client/profile/profile.html @@ -58,6 +58,7 @@
{{#each myClasses}} {{> classDisplay}} + {{/each}} {{#if noclass}}

No results found...

@@ -199,6 +200,9 @@ {{teacher}} {{hour}} {{subscribers}} + {{#if mine}} + + {{/if}}
diff --git a/hourglass/client/profile/profile.js b/hourglass/client/profile/profile.js index 487e3a0..d5ca89e 100644 --- a/hourglass/client/profile/profile.js +++ b/hourglass/client/profile/profile.js @@ -506,6 +506,11 @@ Template.profile.events({ sendData("trackUserInClass"); }, + 'click .classBox .fa-times' (event) { + var box = event.target.parentNode; + Session.set("serverData", box.getAttribute("classid")); + sendData("leaveClass"); + }, 'click .userBox .fa-times' (event) { var box = event.target.parentNode; Session.set("serverData", [