Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions client/views/helpButton/help.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template name="helpButton">
<div id="darker">
</div>
<div class="formcontainer">
<h1 class="formtitle">Help</h1>
<p class="modaltopmessage">Welcome to the Q&A tool. Please post questions on an instance. Vote by clicking on the upvote icon to raise a post's prominence. Reply or share a post on Facebook or Twitter by clicking on the respective icons.</p>
<div id="shareclosebutton">
Close
</div>
</div>

</template>
13 changes: 13 additions & 0 deletions client/views/helpButton/help.js
Original file line number Diff line number Diff line change
@@ -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);
});
}
});
Empty file.
1 change: 1 addition & 0 deletions client/views/helpers/nav/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ <h1 id="tablename" class="hidden-xs hidden-sm">
<li><a id="navAdmin" class="link"><i class="fa fa-cog"></i> Admin</a></li>
{{/if}}
<li><a id="navAsk" class="link" data-toggle-text="Close" title="Post a question">+<i class="fa fa-question"></i></a></li>
<li><a id="navHelp" class="link" data-toggle-text="Close" title="Help"><i class="fa fa-question"></i></a></li>
<li><a id="navPresent" class="link hidden-xs hidden-sm" title="Present">&nbsp;</a></li>
{{else}}
<li><a id="navCreate" class="link" data-toggle-text="Close">+ Create</a></li>
Expand Down
4 changes: 4 additions & 0 deletions client/views/helpers/nav/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
10 changes: 10 additions & 0 deletions client/views/helpers/nav/nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Binary file added public/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 37 additions & 1 deletion server/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
}, {
Expand Down