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:
@@ -46,7 +46,7 @@ if(Meteor.isServer) {
|
||||
//Verify the currently logged in user has authority to manage users.
|
||||
if(Roles.userIsInRole(this.userId, [Meteor.UserRoles.ROLE_MANAGE])) {
|
||||
//Verify the user name isn't already used with a different ID.
|
||||
if(Meteor.collections.Users.findOne({username: user.username, _id: {$ne: user._id}}) == undefined) {
|
||||
if(Meteor.collections.Users.findOne({username: user.username, _id: {$ne: user._id}}) === undefined) {
|
||||
//Update the user. Note: I am using direct mongo modification, versus attempting to go through the Accounts and Roles objects. This could cause problems in the future if these packages change their data structures.
|
||||
Meteor.collections.Users.update(user._id, {$set: {username: user.username, emails: user.emails, roles: user.roles}});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { AccountsTemplates } from 'meteor/useraccounts:core';
|
||||
|
||||
AccountsTemplates.configure({
|
||||
enablePasswordChange: true, //Allow the user to change their password via the login UI.
|
||||
forbidClientAccountCreation: true, //Turn off client side account creation. The app is expected to have a feature that will do this.
|
||||
showForgotPasswordLink: true,
|
||||
defaultTemplate: 'OverrideAtForm',
|
||||
@@ -11,7 +12,11 @@ AccountsTemplates.configure({
|
||||
// defaultLayout: 'Body',
|
||||
// defaultContentRegion: 'content',
|
||||
// defaultLayoutRegions: {}
|
||||
homeRoutePath: '/Admin/InternshipJobs', //The path where the user is taken after logging in successfully.
|
||||
homeRoutePath: '/Admin/Internships', //The path where the user is taken after logging in successfully. Unfortunately this is also used for the path when logging out, so we must override that function with an onLogoutHook.
|
||||
onLogoutHook: function() {
|
||||
FlowRouter.go("/");
|
||||
},
|
||||
|
||||
texts: {
|
||||
title: {
|
||||
signIn: ""
|
||||
|
||||
@@ -27,6 +27,10 @@ AccountsTemplates.configureRoute('forgotPwd', {
|
||||
name: 'ForgotPwd',
|
||||
path: '/ForgotPwd'
|
||||
});
|
||||
AccountsTemplates.configureRoute('changePwd', {
|
||||
name: 'ChangePwd',
|
||||
path: '/ChangePwd'
|
||||
});
|
||||
|
||||
pri.route("/Admin/Internships", {
|
||||
name: "InternshipsEditor",
|
||||
@@ -56,8 +60,8 @@ pri.route("/Admin/UserManagement", {
|
||||
BlazeLayout.render("Admin", {content: "UserManagement"});
|
||||
}
|
||||
});
|
||||
pri.route("/Admin/Appreciation", {
|
||||
name: "AppreciationEditor",
|
||||
pri.route("/Admin/JrHighSummer", {
|
||||
name: "JrHighSummerEditor",
|
||||
action: function(params, queryParams) {
|
||||
require("/imports/ui/Admin/PageEditor.js");
|
||||
BlazeLayout.render("Admin", {content: "PageEditor"});
|
||||
@@ -187,8 +191,8 @@ pub.route("/PhotoGallery", {
|
||||
BlazeLayout.render("Public", {content: "PhotoGallery"});
|
||||
}
|
||||
});
|
||||
pub.route("/Appreciation", {
|
||||
name: 'Appreciation',
|
||||
pub.route("/JrHighSummer", {
|
||||
name: 'JrHighSummer',
|
||||
action: function(params, queryParams) {
|
||||
require("/imports/ui/EditablePage.js");
|
||||
BlazeLayout.render("Public", {content: "EditablePage"});
|
||||
|
||||
@@ -1,6 +1,32 @@
|
||||
|
||||
Accounts.emailTemplates.from = "Do Not Reply <administrator@declarativeengineering.com>";
|
||||
Accounts.emailTemplates.siteName = "Petit Teton App";
|
||||
Accounts.emailTemplates.from = "Do Not Reply <no-reply@andersonvalleyeducation.org>";
|
||||
Accounts.emailTemplates.siteName = "Anderson Valley Education Foundation";
|
||||
|
||||
Accounts.emailTemplates.resetPassword.txt = function(user, url) {
|
||||
let result;
|
||||
|
||||
result = "Hello,\n\
|
||||
\n\
|
||||
To reset your password, simply click the link below\n\
|
||||
\n\
|
||||
" + url.replace("#/reset-password","ResetPwd") + "\n\
|
||||
\n\
|
||||
Thank you,\n\
|
||||
\tAnderson Valley Education Foundation";
|
||||
|
||||
return result;
|
||||
};
|
||||
Accounts.emailTemplates.resetPassword.html = function(user, url) {
|
||||
let result;
|
||||
|
||||
result = "<p>Hello,</p>\
|
||||
<p>To reset your password, simply click the link below</p>\
|
||||
<a href='" + url.replace("#/reset-password","ResetPwd") + "'>Reset Link</a>\
|
||||
<p>Thank you,<br/>\
|
||||
<span style='text-indent: 20px'>Anderson Valley Education Foundation</span></p>";
|
||||
|
||||
return result;
|
||||
};
|
||||
// Accounts.emailTemplates.verifyEmail.subject = function (user) {
|
||||
// return "Welcome to My Site! Please verify your email";
|
||||
// };
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<template name="Appreciation">
|
||||
<div id="appreciation" class="textView">
|
||||
{{{appreciationHTML}}}
|
||||
</div>
|
||||
</template>
|
||||
21
imports/ui/Appreciation.import.styl
vendored
21
imports/ui/Appreciation.import.styl
vendored
@@ -1,21 +0,0 @@
|
||||
#appreciationView
|
||||
display: block
|
||||
|
||||
#appreciation p, #appreciationEditor p
|
||||
font-family: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif
|
||||
font-size: 16px
|
||||
margin: 16px 0
|
||||
|
||||
#appreciation h2, #appreciationEditor h2
|
||||
font-family: "Arial Black", "Arial Bold", Gadget, sans-serif
|
||||
font-size: 19px
|
||||
text-transform: uppercase
|
||||
background-color: #EEE
|
||||
font-weight: bold
|
||||
padding-left: 40px
|
||||
|
||||
#appreciation h4, #appreciationEditor h4
|
||||
font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif
|
||||
font-size: 16px
|
||||
font-weight: 800
|
||||
clear: left
|
||||
@@ -1,14 +0,0 @@
|
||||
import './Appreciation.html';
|
||||
|
||||
Tracker.autorun(function() {
|
||||
Meteor.subscribe("pages");
|
||||
});
|
||||
|
||||
|
||||
Template.Appreciation.helpers({
|
||||
appreciationHTML: function() {
|
||||
let doc = Meteor.collections.Pages.findOne({name: 'Appreciation'});
|
||||
|
||||
return doc === undefined ? "" : doc.html;
|
||||
}
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
import './EditablePage.html';
|
||||
|
||||
let routeData = {
|
||||
Appreciation: {name: "Appreciation"},
|
||||
JrHighSummer: {name: "JrHighSummer"},
|
||||
News: {name: "News"},
|
||||
ImportantDates: {name: "Dates"},
|
||||
CurrentBoard: {name: "Board"}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<a class="menuTile newsMenu" href="{{pathFor 'News'}}">
|
||||
<div class="menuHeaderBackground"></div>
|
||||
<div class="menuHeader">News & Notices</div>
|
||||
<div id="newsHeaderTimestampDiv" class="menuHeaderTimestamp">03/13/18</div>
|
||||
<div id="newsHeaderTimestampDiv" class="menuHeaderTimestamp">{{newsDate}}</div> <!--03/13/18-->
|
||||
<!--<a style="display: none" href="#!/news">news</a>-->
|
||||
</a>
|
||||
<a class="menuTile photoGalleryMenu" href="{{pathFor 'PhotoGallery'}}">
|
||||
@@ -32,11 +32,9 @@
|
||||
<div class="menuHeader">Photo Gallery</div>
|
||||
<!--<a style="display: none" href="#!/gallery">gallery</a>-->
|
||||
</a>
|
||||
<a class="menuTile appreciationMenu" href="{{pathFor 'Appreciation'}}">
|
||||
<a class="menuTile jrHighSummerMenu" href="{{pathFor 'JrHighSummer'}}">
|
||||
<div class="menuHeaderBackground"></div>
|
||||
<div class="menuHeader">Appreciation</div>
|
||||
<div id="appreciationHeaderTimestampDiv" class="menuHeaderTimestamp">11/13/17</div>
|
||||
<!--<a style="display: none" href="#!/appreciation">appreciation</a>-->
|
||||
<div class="menuHeader">Jr High Summer</div>
|
||||
</a>
|
||||
<a class="menuTile howCanYouHelpMenu" href="{{pathFor 'HowCanYouHelp'}}">
|
||||
<div class="menuHeaderBackground"></div>
|
||||
|
||||
2
imports/ui/Home.import.styl
vendored
2
imports/ui/Home.import.styl
vendored
@@ -90,7 +90,7 @@
|
||||
left: 245px
|
||||
top: 160px
|
||||
background-image: url('./images/buckeye_seed_v2.jpg')
|
||||
.appreciationMenu
|
||||
.jrHighSummerMenu
|
||||
left: 490px
|
||||
top: 160px
|
||||
background-image: url('./images/bay_seed_v2.jpg')
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
|
||||
import './Home.html';
|
||||
|
||||
Tracker.autorun(function() {
|
||||
Meteor.subscribe("pages");
|
||||
});
|
||||
|
||||
Template.Home.events({
|
||||
'mouseenter .menuTile': function (event, template) {
|
||||
event.preventDefault();
|
||||
@@ -11,3 +15,11 @@ Template.Home.events({
|
||||
$(event.target).find(".menuHeaderBackground").hide();
|
||||
}
|
||||
});
|
||||
Template.Home.helpers({
|
||||
newsDate: function() {
|
||||
let news = Meteor.collections.Pages.findOne({name: "News"});
|
||||
let date = news ? news.updatedAt : undefined;
|
||||
|
||||
return date ? moment(date).format("MM / DD / YY") : "";
|
||||
}
|
||||
});
|
||||
|
||||
@@ -7,11 +7,12 @@ Tracker.autorun(function() {
|
||||
});
|
||||
|
||||
Template.InternshipJobs.onCreated(function() {
|
||||
this.internships = Meteor.collections.Internship.find({}, {sort: {name: 1}});
|
||||
//this.internships = Meteor.collections.Internship.find({}, {sort: {name: 1}});
|
||||
});
|
||||
Template.InternshipJobs.helpers({
|
||||
internships: function() {
|
||||
return Template.instance().internships;
|
||||
//return Template.instance().internships;
|
||||
return Meteor.collections.Internship.find({}, {sort: {name: 1}});
|
||||
}
|
||||
});
|
||||
Template.InternshipJobs.events({
|
||||
|
||||
5
imports/ui/JrHighSummer.html
Normal file
5
imports/ui/JrHighSummer.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<template name="JrHighSummer">
|
||||
<div id="jrHighSummer" class="textView">
|
||||
{{{html}}}
|
||||
</div>
|
||||
</template>
|
||||
21
imports/ui/JrHighSummer.import.styl
vendored
Normal file
21
imports/ui/JrHighSummer.import.styl
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
#jrHighSummer
|
||||
display: block
|
||||
|
||||
p
|
||||
font-family: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif
|
||||
font-size: 16px
|
||||
margin: 16px 0
|
||||
|
||||
h2
|
||||
font-family: "Arial Black", "Arial Bold", Gadget, sans-serif
|
||||
font-size: 19px
|
||||
text-transform: uppercase
|
||||
background-color: #EEE
|
||||
font-weight: bold
|
||||
padding-left: 40px
|
||||
|
||||
h4
|
||||
font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif
|
||||
font-size: 16px
|
||||
font-weight: 800
|
||||
clear: left
|
||||
14
imports/ui/JrHighSummer.js
Normal file
14
imports/ui/JrHighSummer.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import './JrHighSummer.html';
|
||||
|
||||
Tracker.autorun(function() {
|
||||
Meteor.subscribe("pages");
|
||||
});
|
||||
|
||||
|
||||
Template.JrHighSummer.helpers({
|
||||
html: function() {
|
||||
let doc = Meteor.collections.Pages.findOne({name: 'JrHighSummer'});
|
||||
|
||||
return doc === undefined ? "" : doc.html;
|
||||
}
|
||||
});
|
||||
@@ -30,9 +30,9 @@
|
||||
Important Dates
|
||||
</a>
|
||||
</li>
|
||||
<li class="{{isActiveRoute 'AppreciationEditor'}}">
|
||||
<a href="{{pathFor 'AppreciationEditor'}}">
|
||||
Appreciation
|
||||
<li class="{{isActiveRoute 'JrHighSummerEditor'}}">
|
||||
<a href="{{pathFor 'JrHighSummerEditor'}}">
|
||||
Jr High Summer
|
||||
</a>
|
||||
</li>
|
||||
<li class="{{isActiveRoute 'BoardEditor'}}">
|
||||
|
||||
Reference in New Issue
Block a user