Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 9 additions & 2 deletions client/views/edit/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h1 class="formtitle">Edit</h1>
<div class="inputcontainer" style="text-align: center;">
<div class="dropdowncontainer">
<p class="dropdownlabel">Number of "featured" questions:</p>
<select name="threshold" size="1" value="4">
<select name="threshold" size="1" value="4">
<option value="2" {{isSelected "threshold" 2}}>2</option>
<option value="4" {{isSelected "threshold" 4}}>4</option>
<option value="6" {{isSelected "threshold" 6}}>6</option>
Expand Down Expand Up @@ -74,9 +74,16 @@ <h1 class="formtitle">Edit</h1>
<option value="off" {{isSelected "social" false}}>Off</option>
</select>
</div>
<div class="dropdowncontainer">
<p class="dropdownlabel">Allow anonymous:</p>
<select name="anonymous" size="1">
<option value="on" {{isSelected "anonymous" true}}>On</option>
<option value="off" {{isSelected "anonymous" false}}>Off</option>
</select>
</div>
<div class="editsubmitbutton">
Done
</div>
</div>
</div>
</template>
</template>
3 changes: 3 additions & 0 deletions client/views/edit/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Template.edit.events({
const stale = template.$('select[name=stale_length]').val();
const isHidden = (template.$('select[name=visibility]').val() === 'hidden');
const social = (template.$('select[name=social]').val() === 'on');
const anonymous = template.$("select[name=anonymous]").val() === "on"; // Fetch the anonymous value from the dropdown
const newValues = {
threshold: parseInt(threshold),
new_length: parseInt(redLength),
Expand All @@ -40,6 +41,7 @@ Template.edit.events({
max_response: parseInt(maxResponse),
hidden: isHidden,
social: social,
anonymous: anonymous
};
Meteor.call('editadv', table._id, newValues, (error, result) => {
if (error) {
Expand All @@ -51,6 +53,7 @@ Template.edit.events({
max_response: "Please enter a valid value in the 'Response max word count' drop down menu.",
hidden: "Please enter a valid value in the 'visibility of instance' drop down menu.",
social: "Please enter a valid value in the 'Social media sharing' drop down menu.",
anonymous: "Please enter a valid value in the 'Allow anonymous' drop down menu."
};
showEditAdvError(errorCodes[error.error]);
} else {
Expand Down