Merge branch 'master' of https://github.com/ksjdragon/hourglass
This commit is contained in:
commit
2e80cdf2fb
@ -189,8 +189,9 @@
|
|||||||
{{#if inRole}}
|
{{#if inRole}}
|
||||||
{{#if newWork}}
|
{{#if newWork}}
|
||||||
<div id="workSubmit">Save</div>
|
<div id="workSubmit">Save</div>
|
||||||
|
{{else}}
|
||||||
|
<div id="workDelete">Delete</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div id="workDelete">Delete</div>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -150,22 +150,12 @@ Template.registerHelper('myClasses', () => { // Gets all classes and respective
|
|||||||
});
|
});
|
||||||
|
|
||||||
Template.registerHelper('pref', (val) => { // Obtains all user preferences.
|
Template.registerHelper('pref', (val) => { // Obtains all user preferences.
|
||||||
if(Meteor.user().profile.preferences === undefined) return;
|
var preferences = Meteor.user().profile.preferences;
|
||||||
if(Object.keys(Meteor.user().profile.preferences).length !== Object.keys(defaults).length) { // Invalid preference checking.
|
if(val === 'timeHide' || val === 'done') {
|
||||||
var array = Meteor.user().profile;
|
var invert = _.invert(ref);
|
||||||
array.preferences = defaults;
|
return invert[preferences[val]];
|
||||||
serverData = array;
|
|
||||||
sendData("editProfile");
|
|
||||||
if(val === 'timeHide' || val === 'done') return defaults[val];
|
|
||||||
return defaults[val].charAt(0).toUpperCase() + defaults[val].slice(1);
|
|
||||||
} else {
|
|
||||||
var preferences = Meteor.user().profile.preferences;
|
|
||||||
if(val === 'timeHide' || val === 'done') {
|
|
||||||
var invert = _.invert(ref);
|
|
||||||
return invert[preferences[val]];
|
|
||||||
}
|
|
||||||
return preferences[val].charAt(0).toUpperCase() + preferences[val].slice(1);
|
|
||||||
}
|
}
|
||||||
|
return preferences[val].charAt(0).toUpperCase() + preferences[val].slice(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.main.helpers({
|
Template.main.helpers({
|
||||||
@ -376,6 +366,7 @@ Template.main.helpers({
|
|||||||
return Session.get("newWork");
|
return Session.get("newWork");
|
||||||
},
|
},
|
||||||
inRole() { // Checks correct permissions.
|
inRole() { // Checks correct permissions.
|
||||||
|
if(Session.get("currentWork") === null) return;
|
||||||
if(Session.get("newWork")) {
|
if(Session.get("newWork")) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -58,15 +58,6 @@ Template.profile.helpers({
|
|||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
loadNew() {
|
|
||||||
if(Meteor.user().profile.preferences === undefined) {
|
|
||||||
var profile = Meteor.user().profile;
|
|
||||||
profile.preferences = defaults;
|
|
||||||
serverData = profile;
|
|
||||||
sendData("editProfile");
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
},
|
|
||||||
mainCenter() { // Centers main div container.
|
mainCenter() { // Centers main div container.
|
||||||
var width = window.innerWidth * 1600 / 1920 + 10;
|
var width = window.innerWidth * 1600 / 1920 + 10;
|
||||||
return "width:" + width.toString() + "px;margin-left:" + -0.5 * width.toString() + "px";
|
return "width:" + width.toString() + "px;margin-left:" + -0.5 * width.toString() + "px";
|
||||||
|
|||||||
@ -26,11 +26,4 @@ themeColors = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
defaults = {
|
|
||||||
"theme":"light",
|
|
||||||
"mode":"classes",
|
|
||||||
"timeHide":1,
|
|
||||||
"done": true
|
|
||||||
};
|
|
||||||
|
|
||||||
serverData = null;
|
serverData = null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user