Conflicts:
	client/profile/profile.js
This commit is contained in:
Kenneth Jao 2016-09-27 00:24:43 -04:00
commit d3676ec3ab
7 changed files with 24 additions and 12 deletions

View File

@ -9,7 +9,7 @@ mobile-experience@1.0.4 # Packages for a great mobile UX
mongo@1.1.12 # The database Meteor supports right now
blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views
reactive-var@1.0.10 # Reactive variable for tracker
jquery@1.11.9 # Helpful client-side library
jquery # Helpful client-side library
tracker@1.1.0 # Meteor's client-side reactive programming library
standard-minifier-css@1.2.0 # CSS minifier run for production mode
@ -37,3 +37,5 @@ houston:admin
ahref:dragula
harrison:papa-parse
pfafman:filesaver
flemay:less-autoprefixer
natestrauser:select2

View File

@ -39,6 +39,7 @@ email@1.1.17
es5-shim@4.6.14
eternicode:bootstrap-datepicker@1.6.0_3
fastclick@1.0.12
flemay:less-autoprefixer@1.2.0
fortawesome:fontawesome@4.5.0
geojson-utils@1.0.9
google@1.1.14
@ -78,6 +79,7 @@ modules-runtime@0.7.6
momentjs:moment@2.14.4
mongo@1.1.12
mongo-id@1.0.5
natestrauser:select2@4.0.3
npm-bcrypt@0.9.1
npm-mongo@1.5.49
oauth@1.1.11

View File

@ -88,6 +88,8 @@
width: 80%;
margin: auto;
padding-top: 16vh;
background-color: rgba(0, 0, 0, 0.2);
padding-bottom: 4vh;
}
.text {

View File

@ -16,7 +16,7 @@
</div>
<footer id="loginFooter">
<p id="github">View the <a href="https://github.com/ksjdragon/hourglass">Code!</a></p>
<p id="version">Version 0.2.0</p>
<p id="version">Version 0.1.0</p>
</footer>
</div>
{{> loginButtons}}

View File

@ -76,7 +76,12 @@ Template.profile.helpers({
return Session.get("user").name;
},
motd() { // Returns the current user's description
<<<<<<< HEAD
if (Session.get("user").description !== undefined && Session.get("user").description !== null) return Session.get("user").description;
=======
console.log(Session.get("user").description);
if (Session.get("user").description !== "") return Session.get("user").description;
>>>>>>> cc52ddc64bbeef3b2cf95c446e19577866096196
return "Say something about yourself!";
},
school() { // Returns the current user's school's name
@ -281,7 +286,7 @@ Template.profile.events({
Session.set("selectedClass",array);
Session.set("owned",true);
});
});
},
'click .classBox .fa-times' (event) { // Leaves a class
var box = event.target.parentNode;
@ -457,15 +462,15 @@ Template.profile.events({
try {
for (var i = 0; i < document.getElementsByClassName("profOptions").length; i++) {
var curr = document.getElementsByClassName("profOptions")[i];
if (curr.childNodes[1] !== op.nextSibling.nextSibling.childNodes[1]
&& curr.childNodes[1] !== op.parentNode.parentNode.childNodes[3].childNodes[1]) {
if (curr.childNodes[1] !== op.nextSibling.nextSibling.childNodes[1] &&
curr.childNodes[1] !== op.parentNode.parentNode.childNodes[3].childNodes[1]) {
closeDivFade(document.getElementsByClassName("profOptions")[i]);
}
}
} catch (err) {}
if(event.target.className.includes("op")) {
openDivFade(op.nextSibling.nextSibling);
openDivFade(op.nextSibling.nextSibling);
} else {
openDivFade(op.parentNode.parentNode.childNodes[3]);
}
@ -615,11 +620,11 @@ function getProfileData() { // Gets all data related to profile.
var gradein = document.getElementById("grade").childNodes[0].nodeValue;
profile.grade = parseInt(gradein.substring(gradein.length - 2, gradein));
if(profile.grade.includes("Click here to edit...")) profile.grade = "";
if(!profile.grade) profile.grade = "";
profile.avatar = document.getElementById("profAvatar").src;
profile.banner = document.getElementById("profBanner").src;
profile.preferences = {
"theme":document.getElementById("prefTheme").childNodes[0].nodeValue.toLowerCase(),
"mode":document.getElementById("prefMode").childNodes[0].nodeValue.toLowerCase(),

View File

@ -1,6 +1,6 @@
Router.route('/', {
waitOn: function() {
if (!Meteor.userId()) {
if (!Meteor.userId() || !Meteor.user().profile.school) {
this.redirect('/login');
} else {
return [
@ -57,14 +57,14 @@ Router.route('/user/:email', {
},
action: function() {
if(Meteor.users.findOne({'services.google.email': this.params.email}) !== undefined) {
if(this.params.email === Meteor.user().services.google.email) {
if(Meteor.user() && this.params.email === Meteor.user().services.google.email) {
this.redirect('/profile');
} else {
this.render('user');
}
}
} else {
this.render("NotFound");
}
}
}
});

View File

@ -127,6 +127,7 @@ Meteor.publish('users', function() {
// Only return necessary fields
fields: {
'services.google.email': 1,
'services.google.picture': 1,
'profile.banner': 1,
'profile.grade': 1,
'profile.description': 1,