diff --git a/client/views/helpButton/help.html b/client/views/helpButton/help.html
new file mode 100644
index 00000000..a0e2552b
--- /dev/null
+++ b/client/views/helpButton/help.html
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/client/views/helpButton/help.js b/client/views/helpButton/help.js
new file mode 100644
index 00000000..04adc253
--- /dev/null
+++ b/client/views/helpButton/help.js
@@ -0,0 +1,13 @@
+Template.helpButton.onRendered(function() {
+ $(".formcontainer").hide().fadeIn(400);
+ $("#darker").hide().fadeIn(400);
+});
+
+Template.helpButton.events({
+ "click #shareclosebutton": function(event, template) {
+ $(".formcontainer").fadeOut(400);
+ $("#darker").fadeOut(400, function() {
+ Blaze.remove(popoverTemplate);
+ });
+ }
+});
\ No newline at end of file
diff --git a/client/views/helpButton/help.scss b/client/views/helpButton/help.scss
new file mode 100644
index 00000000..e69de29b
diff --git a/client/views/helpers/nav/nav.html b/client/views/helpers/nav/nav.html
index 19173698..1354ce3a 100644
--- a/client/views/helpers/nav/nav.html
+++ b/client/views/helpers/nav/nav.html
@@ -28,6 +28,7 @@
Admin
{{/if}}
+
+
{{else}}
+ Create
diff --git a/client/views/helpers/nav/nav.js b/client/views/helpers/nav/nav.js
index ba025c88..8b410e90 100644
--- a/client/views/helpers/nav/nav.js
+++ b/client/views/helpers/nav/nav.js
@@ -29,6 +29,10 @@ Template.nav.events({
Session.set("search", "");
Router.go("/");
},
+ "click #navHelp": function(event, template) {
+ var parentNode = document.getElementById("nav");
+ popoverTemplate = Blaze.render(Template.helpButton, parentNode);
+ },
"click #darker": function(event, template) {
$(".formcontainer").fadeOut(400);
$("#darker").fadeOut(400, function() {
diff --git a/client/views/helpers/nav/nav.scss b/client/views/helpers/nav/nav.scss
index 6cd3f446..6f845d6d 100644
--- a/client/views/helpers/nav/nav.scss
+++ b/client/views/helpers/nav/nav.scss
@@ -167,6 +167,16 @@ $screen-sm-max: ($screen-md - 1);
}
}
+#navHelp {
+ width: 18px;
+ height: 20px;
+ padding: 3px 15px 5px 15px;
+ background-image: url('/help.png');
+ background-repeat: no-repeat;
+ background-size: 1.2em 1.2em;
+ background-position: 0.5em 0.4em;
+}
+
#navLogout {
background-color: #5d6a7b;
diff --git a/public/help.png b/public/help.png
new file mode 100644
index 00000000..6b5ba1ae
Binary files /dev/null and b/public/help.png differ
diff --git a/server/methods.js b/server/methods.js
index 4a526bd3..e7cc3d1d 100644
--- a/server/methods.js
+++ b/server/methods.js
@@ -142,7 +142,6 @@ Meteor.methods({
stale_length: stale,
description: description,
moderators: mods,
- /*password: passwordConfirm,*/
lasttouch: new Date().getTime() - 1000,
admin: admin,
max_question: maxQuestion,
@@ -418,6 +417,43 @@ Meteor.methods({
// If error, store object in keys variable
keys = error.invalidKeys;
} else {
+ var toRemove = Questions.findOne({
+ poster: "the system",
+ instanceid: instanceid
+ });
+ Questions.remove({
+ poster: "the system",
+ instanceid: instanceid
+ }, function(error) {
+ if(error) {
+ keys = error.invalidKeys;
+ } else {
+ var ifExists = Answers.findOne({
+ qid: toRemove.instanceid
+ });
+ if(ifExists) {
+ Answers.remove({
+ qid: toRemove.instanceid
+ }, function(error){
+ if(error) {
+ keys = error.invalidKeys;
+ }
+ });
+ }
+ var ifVotesExist = Votes.findOne({
+ qid: toRemove.instanceid
+ });
+ if(ifVotesExist) {
+ Votes.remove({
+ qid: toRemove.instanceid
+ }, function(error) {
+ if(error) {
+ keys = error.invalidKeys;
+ }
+ });
+ }
+ }
+ });
Instances.update({
_id: table._id
}, {