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:
Wynne Crisman
2019-01-07 16:53:54 -08:00
parent 0593c2421a
commit cac2ad9c41
21 changed files with 160 additions and 109 deletions

View File

@@ -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.

View File

@@ -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"},

View File

@@ -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);

View File

@@ -1,5 +0,0 @@
<template name="Appreciation">
<div id="appreciation" class="textView">
{{{appreciationHTML}}}
</div>
</template>

View File

@@ -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

View File

@@ -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;
}
});

View File

@@ -1,7 +1,7 @@
import './EditablePage.html';
let routeData = {
Appreciation: {name: "Appreciation"},
JrHighSummer: {name: "JrHighSummer"},
News: {name: "News"},
ImportantDates: {name: "Dates"},
CurrentBoard: {name: "Board"}

View File

@@ -24,7 +24,7 @@
<a class="menuTile newsMenu" href="{{pathFor 'News'}}">
<div class="menuHeaderBackground"></div>
<div class="menuHeader">News &amp; 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>

View File

@@ -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')

View File

@@ -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") : "";
}
});

View File

@@ -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({

View 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
View 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

View 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;
}
});

View File

@@ -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'}}">