Changed Appreciation to Jr High Summer; Fixed sorting of internships such that changes get properly sorted; Added a proper date on news & notices on the home page using the page's update timestamp.
This commit is contained in:
@@ -10,12 +10,13 @@ Tracker.autorun(function() {
|
||||
});
|
||||
|
||||
Template.InternshipEditor.onCreated(function() {
|
||||
this.internships = Meteor.collections.Internship.find({}, {sort: {name: 1}});
|
||||
//this.internships = Meteor.collections.Internship.find({}, {sort: {name: 1}});
|
||||
Session.set(PREFIX + 'selectedInternship', null);
|
||||
});
|
||||
Template.InternshipEditor.helpers({
|
||||
internships: function() {
|
||||
return Template.instance().internships;
|
||||
//return Template.instance().internships;
|
||||
return Meteor.collections.Internship.find({}, {sort: {name: 1}});
|
||||
},
|
||||
selectedInternship: function() {
|
||||
return Session.get(PREFIX + "selectedInternship");
|
||||
@@ -107,7 +108,8 @@ Template.InternshipHtmlEditor.onCreated(function() {
|
||||
let template = this;
|
||||
|
||||
//Only ask the user if they want to update their changes if they actually have changes that have not yet been saved.
|
||||
if(data !== template.currentHtml) {
|
||||
//Note: This is only useful if the user was editing an internship. If the user was looking at the list then template.currentHtml will be undefined.
|
||||
if(template.currentHtml && data !== template.currentHtml) {
|
||||
const changedData = data;
|
||||
|
||||
//Ensure this does not get run twice.
|
||||
|
||||
@@ -6,7 +6,7 @@ let currentHtml = "";
|
||||
let currentPath = "";
|
||||
|
||||
let routeData = {
|
||||
AppreciationEditor: {title: "Appreciation", name: "Appreciation"},
|
||||
JrHighSummerEditor: {title: "Jr High Summer", name: "JrHighSummer"},
|
||||
NewsEditor: {title: "News", name: "News"},
|
||||
DatesEditor: {title: "Dates", name: "Dates"},
|
||||
BoardEditor: {title: "Current Board", name: "Board"},
|
||||
|
||||
@@ -144,7 +144,6 @@ Template.UserEditor.events({
|
||||
let roles = [];
|
||||
|
||||
user.username = template.$('input[name="username"]').val();
|
||||
user.email = template.$('input[name="email"]').val();
|
||||
|
||||
let roleSpans = template.$('.role.selected');
|
||||
for(let i = 0; i < roleSpans.length; i++) {
|
||||
@@ -154,6 +153,7 @@ Template.UserEditor.events({
|
||||
user.roles = roles;
|
||||
|
||||
if(Session.get(PREFIX + 'displayNewUser')) {
|
||||
user.email = template.$('input[name="email"]').val();
|
||||
Meteor.call('insertUser', user, function(error, result) {
|
||||
if(error) {
|
||||
sAlert.error(error);
|
||||
@@ -166,6 +166,7 @@ Template.UserEditor.events({
|
||||
});
|
||||
}
|
||||
else {
|
||||
user.emails = [{address: template.$('input[name="email"]').val(), verified: true}]; //Since this is through the admin console we will assume the address is verified.
|
||||
user._id = this._id;
|
||||
Meteor.call("updateUser", user, function(error, result) {
|
||||
if(error) sAlert.error(error);
|
||||
|
||||
Reference in New Issue
Block a user