243 lines
6.7 KiB
JavaScript
243 lines
6.7 KiB
JavaScript
require('/imports/startup/both/accounts.js'); //Ensure that the user accounts templates are setup first. We have included the AccountTemplates routing in this document to keep all routing in one place.
|
|
|
|
//**** GROUPS
|
|
let pub = FlowRouter.group({
|
|
});
|
|
let pri = FlowRouter.group({
|
|
//TODO: Require SSL
|
|
triggersEnter: [AccountsTemplates.ensureSignedIn]
|
|
});
|
|
|
|
//**** ADMIN
|
|
//** These first two routes are the defaults that are used after logging in, or if the user types /admin or /Admin without a specific page.
|
|
pri.route("/admin", {
|
|
triggersEnter: [function(context, redirect) {redirect("/Admin/Internships");}]
|
|
});
|
|
pri.route("/Admin", {
|
|
triggersEnter: [function(context, redirect) {redirect("/Admin/Internships");}]
|
|
});
|
|
//** The login pages...
|
|
AccountsTemplates.configureRoute('signIn', {
|
|
name: 'SignIn',
|
|
path: '/Login'
|
|
});
|
|
AccountsTemplates.configureRoute('resetPwd', {
|
|
name: 'ResetPwd',
|
|
path: '/ResetPwd'
|
|
});
|
|
AccountsTemplates.configureRoute('forgotPwd', {
|
|
name: 'ForgotPwd',
|
|
path: '/ForgotPwd'
|
|
});
|
|
AccountsTemplates.configureRoute('changePwd', {
|
|
name: 'ChangePwd',
|
|
path: '/ChangePwd'
|
|
});
|
|
|
|
pri.route("/Admin/Internships", {
|
|
name: "InternshipsEditor",
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Admin/InternshipEditor.js");
|
|
BlazeLayout.render("Admin", {content: "InternshipEditor"});
|
|
}
|
|
});
|
|
pri.route("/Admin/Board", {
|
|
name: "BoardEditor",
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Admin/PageEditor.js");
|
|
BlazeLayout.render("Admin", {content: "PageEditor"});
|
|
}
|
|
});
|
|
pri.route("/Admin/Dates", {
|
|
name: "DatesEditor",
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Admin/PageEditor.js");
|
|
BlazeLayout.render("Admin", {content: "PageEditor"});
|
|
}
|
|
});
|
|
pri.route("/Admin/UserManagement", {
|
|
name: "UserManagement",
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Admin/UserManagement.js");
|
|
BlazeLayout.render("Admin", {content: "UserManagement"});
|
|
}
|
|
});
|
|
pri.route("/Admin/JrHighSummer", {
|
|
name: "JrHighSummerEditor",
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Admin/PageEditor.js");
|
|
BlazeLayout.render("Admin", {content: "PageEditor"});
|
|
}
|
|
});
|
|
pri.route("/Admin/NewsEditor", {
|
|
name: "NewsEditor",
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Admin/PageEditor.js");
|
|
BlazeLayout.render("Admin", {content: "PageEditor"});
|
|
}
|
|
});
|
|
pri.route("/Admin/SlideshowEditor", {
|
|
name: "SlideshowEditor",
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Admin/SlideshowEditor.js");
|
|
BlazeLayout.render("Admin", {content: "SlideshowEditor"});
|
|
}
|
|
});
|
|
pri.route("/Admin/SlideshowPageEditor", {
|
|
name: "SlideshowPageEditor",
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Admin/PageEditor.js");
|
|
BlazeLayout.render("Admin", {content: "PageEditor"});
|
|
}
|
|
});
|
|
pri.route("/Admin/Messages", {
|
|
name: "Messages",
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Admin/Messages.js");
|
|
BlazeLayout.render("Admin", {content: "Messages"});
|
|
}
|
|
});
|
|
|
|
//*** PUBLIC
|
|
pub.route('/', {
|
|
triggersEnter: [function(context, redirect) {redirect("/Home");}]
|
|
});
|
|
pub.route("/Home", {
|
|
name: 'Home',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Home.js");
|
|
BlazeLayout.render("Public", {content: "Home"});
|
|
}
|
|
});
|
|
pub.route("/ImportantDates", {
|
|
name: 'ImportantDates',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/EditablePage.js");
|
|
BlazeLayout.render("Public", {content: "EditablePage"});
|
|
}
|
|
});
|
|
pub.route("/Support", {
|
|
name: 'Support',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Support.js");
|
|
BlazeLayout.render("Public", {content: "Support"});
|
|
}
|
|
});
|
|
pub.route("/Programs", {
|
|
name: 'Programs',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Programs.js");
|
|
BlazeLayout.render("Public", {content: "Programs"});
|
|
}
|
|
});
|
|
pub.route("/Contact", {
|
|
name: 'Contact',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Contact.js");
|
|
BlazeLayout.render("Public", {content: "Contact"});
|
|
}
|
|
});
|
|
pub.route("/About", {
|
|
name: 'About',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/About.js");
|
|
BlazeLayout.render("Public", {content: "About"});
|
|
}
|
|
});
|
|
pub.route("/Grants", {
|
|
name: 'Grants',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Grants.js");
|
|
BlazeLayout.render("Public", {content: "Grants"});
|
|
}
|
|
});
|
|
pub.route("/Internships", {
|
|
name: 'Internships',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Internships.js");
|
|
BlazeLayout.render("Public", {content: "Internships"});
|
|
}
|
|
});
|
|
pub.route("/Internship-Job-List", {
|
|
name: 'Internships Job List',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/InternshipJobs.js");
|
|
BlazeLayout.render("Public", {content: "InternshipJobs"});
|
|
}
|
|
});
|
|
pub.route("/Internship-Job/:_id", {
|
|
name: 'Internship',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/InternshipJobs.js");
|
|
BlazeLayout.render("Public", {content: "InternshipJob"});
|
|
}
|
|
});
|
|
pub.route("/Scholarships", {
|
|
name: 'Scholarships',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Scholarships.js");
|
|
BlazeLayout.render("Public", {content: "Scholarships"});
|
|
}
|
|
});
|
|
pub.route("/Fellowships", {
|
|
name: 'Fellowships',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Fellowships.js");
|
|
BlazeLayout.render("Public", {content: "Fellowships"});
|
|
}
|
|
});
|
|
pub.route("/News", {
|
|
name: 'News',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/EditablePage.js");
|
|
BlazeLayout.render("Public", {content: "EditablePage"});
|
|
}
|
|
});
|
|
pub.route("/SecondChance", {
|
|
name: 'SecondChance',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/SecondChance.js");
|
|
BlazeLayout.render("Public", {content: "SecondChance"});
|
|
}
|
|
});
|
|
pub.route("/PhotoGallery", {
|
|
name: 'PhotoGallery',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/PhotoGallery.js");
|
|
BlazeLayout.render("Public", {content: "PhotoGallery"});
|
|
}
|
|
});
|
|
pub.route("/JrHighSummer", {
|
|
name: 'JrHighSummer',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/EditablePage.js");
|
|
BlazeLayout.render("Public", {content: "EditablePage"});
|
|
}
|
|
});
|
|
pub.route("/HowCanYouHelp", {
|
|
name: 'HowCanYouHelp',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/Support.js");
|
|
BlazeLayout.render("Public", {content: "Support"});
|
|
}
|
|
});
|
|
pub.route("/CurrentBoard", {
|
|
name: 'CurrentBoard',
|
|
action: function(params, queryParams) {
|
|
require("/imports/ui/EditablePage.js");
|
|
BlazeLayout.render("Public", {content: "EditablePage"});
|
|
}
|
|
});
|
|
|
|
// Fix stale routes in Google's search index from old site. Redirect to home.
|
|
pub.route('/!/*', {
|
|
action: function(params, queryParams) {
|
|
FlowRouter.go("/");
|
|
}
|
|
});
|
|
pub.route('/!', {
|
|
action: function(params, queryParams) {
|
|
FlowRouter.go("/");
|
|
}
|
|
});
|