Merge branch 'master' of https://github.com/ksjdragon/hourglass
This commit is contained in:
commit
41b44eed76
@ -476,6 +476,16 @@ input {
|
||||
|
||||
.mainClassTeacher {
|
||||
font-size: 1.7vh;
|
||||
width: 70%;
|
||||
display: table-cell;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.mainClassStatus {
|
||||
font-size: 1.7vh;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
display: table-cell;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@ -670,7 +680,7 @@ textarea.clickModify {
|
||||
}
|
||||
|
||||
.info {
|
||||
font-size: 130%;
|
||||
font-size: 110%;
|
||||
}
|
||||
|
||||
.workTitle {
|
||||
@ -1289,6 +1299,7 @@ textarea.clickModify {
|
||||
|
||||
}
|
||||
#markDone, #markConfirm, #markReport {
|
||||
font-size: 95%;
|
||||
padding: 5%;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
|
||||
|
||||
@ -190,13 +190,22 @@
|
||||
</template>
|
||||
|
||||
<template name="classesMode">
|
||||
<div class="classWrapper">
|
||||
<div class="mainClass" style="background-color:{{divColor 'classCardColor'}}">
|
||||
<div class="classInfo"> <!-- class color -->
|
||||
<h3 class="mainClassName">{{name}}</h3>
|
||||
<p class="mainClassHour">{{hour}}</p>
|
||||
<p class="mainClassTeacher">{{teacher}}</p>
|
||||
</div>
|
||||
<div class="classWrapper"> <!-- class color -->
|
||||
<div class="mainClass" style="background-color:{{divColor 'classCardColor'}}">
|
||||
{{#if status}}
|
||||
<div class="classInfo">
|
||||
<h3 class="mainClassName">{{name}}</h3>
|
||||
<p class="mainClassHour">{{hour}}</p>
|
||||
<p class="mainClassTeacher">{{teacher}}</p>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="classInfo" style="border-top:1vh solid #E64F4F;padding-top:2vh">
|
||||
<h3 class="mainClassName">{{name}}</h3>
|
||||
<p class="mainClassHour">{{hour}}</p>
|
||||
<p class="mainClassTeacher">{{teacher}}</p>
|
||||
<p class="mainClassStatus">Unapproved</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="creWork" classid="{{_id}}">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
<h4>Add Work</h4>
|
||||
|
||||
@ -383,9 +383,24 @@ Template.main.helpers({
|
||||
});
|
||||
},
|
||||
eventMouseover: function(event, jsEvent, view) {
|
||||
var classid = work.findOne({_id: event.id})["class"];
|
||||
var className = (classid === Meteor.userId()) ? "Personal" : classes.findOne({_id: classid}).name;
|
||||
var span = this.children[0].children[0];
|
||||
$(span).velocity("stop");
|
||||
$(span).velocity({opacity:0}, 50, function() {
|
||||
span.childNodes[0].nodeValue = className;
|
||||
$(span).velocity({opacity:1}, 50);
|
||||
});
|
||||
this.style.boxShadow = "inset 0 0 0 99999px rgba(255,255,255,0.2)";
|
||||
},
|
||||
eventMouseout: function(event, jsEvent, view) {
|
||||
var workName = work.findOne({_id: event.id}).name;
|
||||
var span = this.children[0].children[0];
|
||||
$(span).velocity("stop");
|
||||
$(span).velocity({opacity:0}, 50, function() {
|
||||
span.childNodes[0].nodeValue = workName;
|
||||
$(span).velocity({opacity:1}, 50);
|
||||
});
|
||||
this.style.boxShadow = "";
|
||||
},
|
||||
dayClick: function(date, jsEvent, view) { // On-click for each day.
|
||||
@ -843,8 +858,9 @@ sendData = function(funcName) { // Call Meteor function, and do actions after fu
|
||||
if(funcName === "editProfile") filterWork();
|
||||
Meteor.call(funcName, serverData, function(error, result) {
|
||||
serverData = null;
|
||||
|
||||
if (error !== undefined) {
|
||||
console.log(funcName);
|
||||
console.log(error);
|
||||
sAlert.error(error.error[1] || error.message, {
|
||||
effect: 'stackslide',
|
||||
position: 'top'
|
||||
@ -971,6 +987,7 @@ getClasses = function(myClasses) {
|
||||
classObj.box = " owned";
|
||||
classObj.mine = false; // Actual value is reversed.
|
||||
classObj.subscribers = 1;
|
||||
classObj.status = true;
|
||||
classObj.admin = Meteor.userId();
|
||||
classObj._id = Meteor.userId();
|
||||
} else {
|
||||
@ -990,13 +1007,23 @@ getClasses = function(myClasses) {
|
||||
}
|
||||
|
||||
updateWork = function(id, fields, type) {
|
||||
if(type === "added") {
|
||||
var allWork = Session.get("myWork").concat(Session.get("filterWork"));
|
||||
if(allWork.filter(function(work) {
|
||||
return work._id === id;
|
||||
}).length !== 0) return;
|
||||
}
|
||||
|
||||
if(type === "remove" && Session.get("myWork").concat(Session.get("filterWork")).length === 0) return;
|
||||
if(type === "remove" && Session.get("myWork").filter(function(work) { // Removed work and exists in user data.
|
||||
if(type === "remove" && Session.get("myWork").concat(Session.get("filterWork")).filter(function(work) { // Removed work and exists in user data.
|
||||
return work._id === id;
|
||||
}).length !== 0) {
|
||||
Session.set("myWork", Session.get("myWork").filter(function(work) {
|
||||
return work._id !== id;
|
||||
}));
|
||||
Session.set("filterWork", Session.get("filterWork").filter(function(work) {
|
||||
return work._id !== id;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -515,7 +515,7 @@ Meteor.methods({
|
||||
var security = securityCheck([[[8, 9, true], 16, false], 10, 20, 11, 12, true],
|
||||
Object.assign({}, found || {}, input, {userId: Meteor.userId()}));
|
||||
if (!security) {
|
||||
input = Object.assign({}, input, {confirmations: [Meteor.userId()], reports: [], done: [], numberdone: 0, comments: []});
|
||||
input = Object.assign({}, input, {confirmations: [Meteor.userId()], reports: [], done: [], comments: []});
|
||||
work.insert(input);
|
||||
} else {
|
||||
throw new Meteor.Error(errors[security]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user