diff --git a/.meteor/packages b/.meteor/packages index 1024901c..4e313d53 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -13,3 +13,4 @@ linto:jquery-ui steeve:reactive-cookie email meteorhacks:fast-render +todda00:friendly-slugs diff --git a/.meteor/versions b/.meteor/versions index 5b053165..b7245003 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -11,6 +11,7 @@ boilerplate-generator@1.0.3 callback-hook@1.0.3 check@1.0.5 chuangbo:cookie@1.1.0 +coffeescript@1.0.6 ddp@1.1.0 deps@1.0.7 ejson@1.0.6 @@ -36,6 +37,7 @@ linto:jquery-ui@1.11.2 livedata@1.0.13 localstorage@1.0.3 logging@1.0.7 +matb33:collection-hooks@0.7.15 meteor@1.1.6 meteor-platform@1.2.2 meteorhacks:fast-render@2.7.1 @@ -62,6 +64,7 @@ spacebars-compiler@1.0.6 srp@1.0.3 steeve:reactive-cookie@0.0.8 templating@1.1.1 +todda00:friendly-slugs@0.3.4 tracker@1.0.7 ui@1.0.6 underscore@1.0.3 diff --git a/client/styles/global.css b/client/styles/global.css index 768f8522..60df84e0 100644 --- a/client/styles/global.css +++ b/client/styles/global.css @@ -12,7 +12,6 @@ body { * { text-indent:0px!important; - font-weight:normal!important; } a { @@ -156,7 +155,7 @@ div #wrapper { bottom: 0; right:0; left:0; - opacity:.6; + opacity:.9; overflow:hidden; z-index:999999999999999; cursor:pointer; diff --git a/client/views/add/add.js b/client/views/add/add.js index 5f3f37f2..6690880a 100644 --- a/client/views/add/add.js +++ b/client/views/add/add.js @@ -1,11 +1,11 @@ Template.add.onCreated(function () { // Checks whether the user has a valid table cookie - Meteor.call('listCookieCheck', Session.get("tablename"), function (error, result) { + Meteor.call('listCookieCheck', Session.get("id"), function (error, result) { if(!result) { // If not, return the user to the chooser page window.location.href = "/"; } else { - Meteor.call('adminCheck', Session.get("tablename"), function (error, result) { + Meteor.call('adminCheck', Session.get("id"), function (error, result) { if(!result) { // If not, return the user to the chooser page window.location.href = "/"; @@ -66,7 +66,7 @@ Template.add.events({ }, "click .removebutton": function(event, template) { var mod = event.currentTarget.previousElementSibling.value; - Meteor.call('removeMods', mod, Session.get("tablename")); + Meteor.call('removeMods', mod, Session.get("id")); }, // When the submit button is clicked... "click #modsdonebutton": function(event, template) { @@ -78,7 +78,15 @@ Template.add.events({ mods.push(modsInput[m].value); } } - Meteor.call('addMods', mods, Session.get("tablename"), function(error, result) { + Meteor.call('addMods', mods, Session.get("id"), function(error, result) { + console.log(Meteor.user().emails[0].address); + for(var m = 0; m < mods.length; m++) { + Meteor.call('sendEmail', + mods[m], + Meteor.user().emails[0].address, + 'You have been added as a moderator on Question Tool', + Meteor.user().profile.name + ' added you as a moderator on Question Tool. You are able to modify, combine, and hide questions. You must use this email address when registering to be considered a moderator.'); + } // If the result is an object, there was an error if(typeof result === 'object') { // Alert the error diff --git a/client/views/combine/combine.js b/client/views/combine/combine.js index 10700d96..52057a54 100644 --- a/client/views/combine/combine.js +++ b/client/views/combine/combine.js @@ -6,7 +6,7 @@ Template.combine.onCreated(function () { window.location.href = "/"; } else { // Checks whether the current user has admin privileges - Meteor.call('adminCheck', Session.get("tablename"), function (error, result) { + Meteor.call('adminCheck', Session.get("id"), function (error, result) { if(!result) { // If not, redirects back to the list page window.location.href = "/list"; @@ -44,7 +44,7 @@ Template.combine.events({ // Calls the combine function on the server to update the DBs var id2 = Template.instance().data.second; var id1 = Template.instance().data.first; - Meteor.call('combine', question, id1, id2, Session.get("tablename"), function (error, result) { + Meteor.call('combine', question, id1, id2, Session.get("id"), function (error, result) { // If successful if(!error) { // Hides the second question (combined -> first) diff --git a/client/views/create/create.js b/client/views/create/create.js index dce8930c..1c39eb15 100644 --- a/client/views/create/create.js +++ b/client/views/create/create.js @@ -56,11 +56,13 @@ Template.create.events({ if(!Meteor.user()) { return false; } + //document.getElementById("buttonarea").disabled = true; var anonElement = document.getElementById("allowanoncheck"); + var anonymous; if(anonElement.style.display) { - var anonymous = (anonElement.style.display != "none"); + anonymous = (anonElement.style.display != "none"); } else { - var anonymous = false; + anonymous = false; } // Retrieve data from the form var tablename = document.getElementById("instancenameinput").value; @@ -111,14 +113,13 @@ Template.create.events({ "description": "Please enter a valid description under 255 characters.", "modlength": "You have entered too many moderators. Please try again."/*, "password": "Please enter a valid password using letters, numbers, *, #, @, and between 4 and 10 characters."*/ - } + }; // Alert the error showCreateError(errorCodes[result[0].name]); return false; } else { // Redirects to the newly-created table's list page Blaze.remove(dropDownTemplate); - Router.go("/list/" + result); } }); }, @@ -140,4 +141,14 @@ Template.create.events({ last.previousSibling.focus(); } } -}); \ No newline at end of file +}); + +function showCreateError(reason) { + if(typeof currentError != "undefined") { + Blaze.remove(currentError); + document.getElementById("buttonarea").disabled = false; + } + var parentNode = document.getElementById("creatediv"); + var nextNode = document.getElementById("instancebottominputcontainer"); + currentError = Blaze.renderWithData(Template.form_error, reason, parentNode, nextNode); +} \ No newline at end of file diff --git a/client/views/credits/credits.css b/client/views/credits/credits.css index 3add7fa3..2ea02430 100644 --- a/client/views/credits/credits.css +++ b/client/views/credits/credits.css @@ -1,17 +1,42 @@ #creditstext { - color:#777777; - font-family:regular; - text-align:center; - font-size:14px; - display:block; - margin:0px auto; - padding:0px; - line-height:1.5em; - width:80%; - margin-top:25px; - margin-bottom:35px; + color: #777777; + font-family: regular; + text-align: center; + font-size: 14px; + display: block; + margin: 0 auto; + padding: 0; + line-height: 1.5em; + width: 80%; + margin-top: 25px; + margin-bottom: 35px; } #creditstext a { text-decoration:underline; +} + +.creditsformcontainer { + position: fixed; + background-color:black; + top: 1%; + left: 30%; + width: 40%; + opacity:.9; + overflow:hidden; + z-index:999999999999999; + cursor:pointer; +} + +@media screen and (max-width: 667px) { + .creditsformcontainer { + background-color:black; + top: 0; + left: 0; + width: 100%; + opacity:.9; + overflow:hidden; + z-index:999999999999999; + cursor:pointer; +} } \ No newline at end of file diff --git a/client/views/credits/credits.html b/client/views/credits/credits.html index 03a2b836..1ad3abbf 100644 --- a/client/views/credits/credits.html +++ b/client/views/credits/credits.html @@ -1,76 +1,53 @@ - - diff --git a/client/views/credits/credits.js b/client/views/credits/credits.js index f2b25b29..aabdbd58 100644 --- a/client/views/credits/credits.js +++ b/client/views/credits/credits.js @@ -1,5 +1,11 @@ Template.credits.onRendered(function() { // Sets the document title when the template is rendered $(".formcontainer").hide().fadeIn(400); - $("#darker").hide().fadeIn(400); + +}); + +Template.credits.events({ + "click .closecontainer": function(event, template) { + Blaze.remove(popoverTemplate); + } }); \ No newline at end of file diff --git a/client/views/footer/footer.js b/client/views/footer/footer.js index 7ac7e928..5e470c0c 100644 --- a/client/views/footer/footer.js +++ b/client/views/footer/footer.js @@ -2,11 +2,5 @@ Template.footer.events({ "click #creditsbutton": function(event, template) { var parentNode = document.getElementById("banner"); popoverTemplate = Blaze.render(Template.credits, parentNode); - }, - "click #darker": function(event, template) { - $(".formcontainer").fadeOut(400); - $("#darker").fadeOut(400, function() { - Blaze.remove(popoverTemplate); - }); } }); \ No newline at end of file diff --git a/client/views/helpers/chunks/question_div/question_div.css b/client/views/helpers/chunks/question_div/question_div.css index 75906648..0523d00a 100644 --- a/client/views/helpers/chunks/question_div/question_div.css +++ b/client/views/helpers/chunks/question_div/question_div.css @@ -278,7 +278,6 @@ .replybottom { width:340px; - height:158px; display:none; margin:0px auto; margin-top:55px; diff --git a/client/views/helpers/chunks/question_div/question_div.html b/client/views/helpers/chunks/question_div/question_div.html index 537bbaa6..fe7039eb 100644 --- a/client/views/helpers/chunks/question_div/question_div.html +++ b/client/views/helpers/chunks/question_div/question_div.html @@ -105,13 +105,24 @@ {{#if currentUser}} +
+
+
+
+
+
+
+
+

Post as anonymous?

+
+
{{else}} {{/if}}
-
+
@@ -130,10 +141,8 @@
{{#if adminButtons}}
-
- Hide + {{#if isDisabled}}Unhide{{else}}Hide{{/if}}
Modify diff --git a/client/views/helpers/chunks/question_div/question_div.js b/client/views/helpers/chunks/question_div/question_div.js index 86c14be5..144f819c 100644 --- a/client/views/helpers/chunks/question_div/question_div.js +++ b/client/views/helpers/chunks/question_div/question_div.js @@ -9,4 +9,10 @@ Template.question_div.helpers({ return 150; } }, -}) \ No newline at end of file + isDisabled: function() { + if(Questions.findOne({ _id: this._id}).state === "disabled") { + return true; + } + return false; + } +}); \ No newline at end of file diff --git a/client/views/helpers/navlogin/navlogin.html b/client/views/helpers/navlogin/navlogin.html index 708f4107..b9d72af3 100644 --- a/client/views/helpers/navlogin/navlogin.html +++ b/client/views/helpers/navlogin/navlogin.html @@ -18,9 +18,13 @@

{{/if}} - + {{#if admin}} +
  • + +
  • + {{/if}} {{#if currentUser}}