mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
Working on IR 1.0 update
This commit is contained in:
parent
570fca6fcb
commit
73cb59a088
14 changed files with 476 additions and 404 deletions
|
@ -18,7 +18,7 @@ accounts-ui
|
|||
|
||||
# Atmosphere Packages
|
||||
|
||||
iron:router@1.0.1
|
||||
iron:router
|
||||
|
||||
meteorhacks:fast-render
|
||||
meteorhacks:subs-manager
|
||||
|
@ -65,8 +65,9 @@ telescope-module-embedly
|
|||
telescope-newsletter
|
||||
telescope-daily
|
||||
telescope-update-prompt
|
||||
telescope-notifications
|
||||
telescope-kadira
|
||||
|
||||
# telescope-notifications
|
||||
|
||||
# Accounts Templates
|
||||
useraccounts:unstyled
|
|
@ -39,17 +39,19 @@ html-tools@1.0.2
|
|||
htmljs@1.0.2
|
||||
http@1.0.8
|
||||
id-map@1.0.1
|
||||
iron:core@0.3.4
|
||||
iron:dynamic-template@0.4.1
|
||||
iron:layout@0.4.1
|
||||
iron:router@0.9.4
|
||||
iron:controller@1.0.0
|
||||
iron:core@1.0.0
|
||||
iron:dynamic-template@1.0.0
|
||||
iron:layout@1.0.0
|
||||
iron:location@1.0.1
|
||||
iron:middleware-stack@1.0.0
|
||||
iron:router@1.0.1
|
||||
iron:url@1.0.0
|
||||
jparker:crypto-core@0.1.0
|
||||
jparker:crypto-md5@0.1.1
|
||||
jparker:gravatar@0.3.0
|
||||
jquery@1.0.1
|
||||
json@1.0.1
|
||||
kestanous:herald-email@0.2.1
|
||||
kestanous:herald@0.6.0
|
||||
launch-screen@1.0.0
|
||||
less@1.0.11
|
||||
livedata@1.0.11
|
||||
|
@ -92,12 +94,10 @@ sacha:spin@2.0.4
|
|||
service-configuration@1.0.2
|
||||
session@1.0.4
|
||||
sha@1.0.1
|
||||
softwarerero:accounts-t9n@1.0.0
|
||||
softwarerero:accounts-t9n@1.0.2
|
||||
spacebars-compiler@1.0.3
|
||||
spacebars@1.0.3
|
||||
spiderable@1.0.5
|
||||
splendido:accounts-templates-core@0.11.0
|
||||
splendido:accounts-templates-unstyled@0.11.0
|
||||
srp@1.0.1
|
||||
standard-app-packages@1.0.3
|
||||
stylus@1.0.5
|
||||
|
@ -111,7 +111,6 @@ telescope-lib@0.2.9
|
|||
telescope-module-embedly@0.2.9
|
||||
telescope-module-share@0.0.0
|
||||
telescope-newsletter@0.1.0
|
||||
telescope-notifications@0.1.0
|
||||
telescope-rss@0.0.0
|
||||
telescope-search@0.0.0
|
||||
telescope-tags@0.0.0
|
||||
|
@ -124,5 +123,7 @@ twitter@1.1.2
|
|||
ui@1.0.4
|
||||
underscore@1.0.1
|
||||
url@1.0.2
|
||||
useraccounts:core@1.2.3
|
||||
useraccounts:unstyled@1.2.3
|
||||
webapp-hashing@1.0.1
|
||||
webapp@1.1.4
|
||||
|
|
|
@ -42,5 +42,6 @@ Statuses={
|
|||
};
|
||||
|
||||
Avatar.options = {
|
||||
emailHashProperty: 'email_hash'
|
||||
emailHashProperty: 'email_hash',
|
||||
defaultAvatarUrl: '/img/default-avatar.png',
|
||||
};
|
||||
|
|
|
@ -75,9 +75,3 @@ AccountsTemplates.configure({
|
|||
showPlaceholders: true,
|
||||
*/
|
||||
});
|
||||
|
||||
|
||||
// Initialization
|
||||
Meteor.startup(function(){
|
||||
AccountsTemplates.init();
|
||||
});
|
|
@ -6,7 +6,7 @@ getCurrentTemplate = function() {
|
|||
return Router.current().lookupTemplate();
|
||||
};
|
||||
getCurrentRoute = function() {
|
||||
return Router._currentController.path;
|
||||
return Router.current().url;
|
||||
};
|
||||
t=function(message){
|
||||
var d=new Date();
|
||||
|
|
639
lib/router.js
639
lib/router.js
|
@ -124,6 +124,11 @@ Router._filters = {
|
|||
}
|
||||
},
|
||||
|
||||
clearSeenErrors: function () {
|
||||
clearSeenErrors();
|
||||
this.next();
|
||||
},
|
||||
|
||||
resetScroll: function () {
|
||||
var scrollTo = window.currentScroll || 0;
|
||||
var $body = $('body');
|
||||
|
@ -255,8 +260,8 @@ if(Meteor.isClient){
|
|||
|
||||
// Before Hooks
|
||||
|
||||
// Router.onBeforeAction(filters.isReady);
|
||||
Router.onBeforeAction(clearSeenErrors);
|
||||
Router.onBeforeAction(filters.isReady);
|
||||
Router.onBeforeAction(filters.clearSeenErrors);
|
||||
Router.onBeforeAction(filters.canView, {except: ['atSignIn', 'atSignUp', 'atForgotPwd', 'atResetPwd', 'signOut']});
|
||||
Router.onBeforeAction(filters.hasCompletedProfile);
|
||||
Router.onBeforeAction(filters.isLoggedIn, {only: ['post_submit']});
|
||||
|
@ -288,7 +293,7 @@ if(Meteor.isClient){
|
|||
|
||||
PostsListController = FastRender.RouteController.extend({
|
||||
template: getTemplate('posts_list'),
|
||||
onBeforeAction: function () {
|
||||
subscriptions: function () {
|
||||
// take the first segment of the path to get the view, unless it's '/' in which case the view default to 'top'
|
||||
// note: most of the time this.params.slug will be empty
|
||||
this._terms = {
|
||||
|
@ -302,10 +307,7 @@ PostsListController = FastRender.RouteController.extend({
|
|||
}
|
||||
|
||||
this.postsListSub = coreSubscriptions.subscribe('postsList', this._terms);
|
||||
return [
|
||||
this.postsListSub,
|
||||
coreSubscriptions.subscribe('postsListUsers', this._terms)
|
||||
];
|
||||
this.postsListUsersSub = coreSubscriptions.subscribe('postsListUsers', this._terms);
|
||||
},
|
||||
data: function () {
|
||||
this._terms = {
|
||||
|
@ -402,6 +404,9 @@ PostsDigestController = FastRender.RouteController.extend({
|
|||
// Controller for post pages
|
||||
|
||||
PostPageController = FastRender.RouteController.extend({
|
||||
|
||||
template: getTemplate('post_page'),
|
||||
|
||||
waitOn: function() {
|
||||
this.postSubscription = coreSubscriptions.subscribe('singlePost', this.params._id);
|
||||
this.postUsersSubscription = coreSubscriptions.subscribe('postUsers', this.params._id);
|
||||
|
@ -497,322 +502,316 @@ var getDefaultViewController = function () {
|
|||
//--------------------------------------------------------------------------------------------------//
|
||||
Meteor.startup(function () {
|
||||
|
||||
Router.map(function() {
|
||||
// -------------------------------------------- Post Lists -------------------------------------------- //
|
||||
|
||||
// -------------------------------------------- Post Lists -------------------------------------------- //
|
||||
|
||||
Router.route('/', {
|
||||
name: 'posts_default',
|
||||
controller: getDefaultViewController()
|
||||
});
|
||||
|
||||
Router.route('/top/:limit?', {
|
||||
name: 'posts_top',
|
||||
controller: PostsTopController
|
||||
});
|
||||
|
||||
// New
|
||||
|
||||
Router.route('/new/:limit?', {
|
||||
name: 'posts_new',
|
||||
controller: PostsNewController
|
||||
});
|
||||
|
||||
// Best
|
||||
|
||||
Router.route('/best/:limit?', {
|
||||
name: 'posts_best',
|
||||
controller: PostsBestController
|
||||
});
|
||||
|
||||
// Pending
|
||||
|
||||
Router.route('/pending/:limit?', {
|
||||
name: 'posts_pending',
|
||||
controller: PostsPendingController
|
||||
});
|
||||
|
||||
|
||||
|
||||
// TODO: enable /category/new, /category/best, etc. views
|
||||
|
||||
|
||||
// Digest
|
||||
|
||||
Router.route('/digest/:year/:month/:day', {
|
||||
name: 'posts_digest',
|
||||
controller: PostsDigestController
|
||||
});
|
||||
|
||||
Router.route('/digest', {
|
||||
name: 'posts_digest',
|
||||
controller: PostsDigestController
|
||||
});
|
||||
|
||||
// -------------------------------------------- Post -------------------------------------------- //
|
||||
|
||||
|
||||
// Post Page
|
||||
|
||||
Router.route('/posts/:_id', {
|
||||
name: 'post_page',
|
||||
template: getTemplate('post_page'),
|
||||
controller: PostPageController
|
||||
});
|
||||
|
||||
Router.route('/posts/:_id/comment/:commentId', {
|
||||
name: 'post_page',
|
||||
template: getTemplate('post_page'),
|
||||
controller: PostPageController,
|
||||
onAfterAction: function () {
|
||||
// TODO: scroll to comment position
|
||||
}
|
||||
});
|
||||
|
||||
// Post Edit
|
||||
|
||||
Router.route('/posts/:_id/edit', {
|
||||
name: 'post_edit',
|
||||
template: getTemplate('post_edit'),
|
||||
waitOn: function () {
|
||||
return [
|
||||
coreSubscriptions.subscribe('singlePost', this.params._id),
|
||||
coreSubscriptions.subscribe('allUsersAdmin')
|
||||
];
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
postId: this.params._id,
|
||||
post: Posts.findOne(this.params._id)
|
||||
};
|
||||
},
|
||||
fastRender: true
|
||||
});
|
||||
|
||||
// Post Submit
|
||||
|
||||
Router.route('/submit', {
|
||||
name: 'post_submit',
|
||||
template: getTemplate('post_submit'),
|
||||
});
|
||||
|
||||
// -------------------------------------------- Comment -------------------------------------------- //
|
||||
|
||||
// Comment Reply
|
||||
|
||||
Router.route('/comments/:_id', {
|
||||
name: 'comment_reply',
|
||||
template: getTemplate('comment_reply'),
|
||||
controller: CommentPageController,
|
||||
onAfterAction: function() {
|
||||
window.queueComments = false;
|
||||
}
|
||||
});
|
||||
|
||||
// Comment Edit
|
||||
|
||||
Router.route('/comments/:_id/edit', {
|
||||
name: 'comment_edit',
|
||||
template: getTemplate('comment_edit'),
|
||||
controller: CommentPageController,
|
||||
onAfterAction: function() {
|
||||
window.queueComments = false;
|
||||
}
|
||||
});
|
||||
|
||||
// -------------------------------------------- Users -------------------------------------------- //
|
||||
|
||||
// User Logout
|
||||
|
||||
Router.route('/sign-out', {
|
||||
name: 'signOut',
|
||||
onBeforeAction: function() {
|
||||
Meteor.logout(function() {
|
||||
return Router.go('/');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// User Profile
|
||||
|
||||
Router.route('/users/:_idOrSlug', {
|
||||
name: 'user_profile',
|
||||
template: getTemplate('user_profile'),
|
||||
controller: UserPageController
|
||||
});
|
||||
|
||||
// User Edit
|
||||
|
||||
Router.route('/users/:_idOrSlug/edit', {
|
||||
name: 'user_edit',
|
||||
template: getTemplate('user_edit'),
|
||||
controller: UserPageController
|
||||
});
|
||||
|
||||
// Account
|
||||
|
||||
Router.route('/account', {
|
||||
name: 'account',
|
||||
template: getTemplate('user_edit'),
|
||||
controller: AccountController
|
||||
});
|
||||
|
||||
// All Users
|
||||
|
||||
Router.route('/all-users/:limit?', {
|
||||
name: 'all-users',
|
||||
template: getTemplate('users'),
|
||||
waitOn: function() {
|
||||
var limit = parseInt(this.params.limit) || 20;
|
||||
return coreSubscriptions.subscribe('allUsers', this.params.filterBy, this.params.sortBy, limit);
|
||||
},
|
||||
data: function() {
|
||||
var limit = parseInt(this.params.limit) || 20,
|
||||
parameters = getUsersParameters(this.params.filterBy, this.params.sortBy, limit),
|
||||
filterBy = (typeof this.params.filterBy === 'string') ? this.params.filterBy : 'all',
|
||||
sortBy = (typeof this.params.sortBy === 'string') ? this.params.sortBy : 'createdAt';
|
||||
Session.set('usersLimit', limit);
|
||||
return {
|
||||
users: Meteor.users.find(parameters.find, parameters.options),
|
||||
filterBy: filterBy,
|
||||
sortBy: sortBy
|
||||
};
|
||||
},
|
||||
fastRender: true
|
||||
});
|
||||
|
||||
// Unsubscribe (from notifications)
|
||||
|
||||
Router.route('/unsubscribe/:hash', {
|
||||
name: 'unsubscribe',
|
||||
template: getTemplate('unsubscribe'),
|
||||
data: function() {
|
||||
return {
|
||||
hash: this.params.hash
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// -------------------------------------------- Other -------------------------------------------- //
|
||||
|
||||
|
||||
|
||||
// Settings
|
||||
|
||||
Router.route('/settings', {
|
||||
name: 'settings',
|
||||
template: getTemplate('settings'),
|
||||
data: function () {
|
||||
// we only have one set of settings for now
|
||||
return {
|
||||
hasSettings: !!Settings.find().count(),
|
||||
settings: Settings.findOne()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Loading (for testing purposes)
|
||||
|
||||
Router.route('/loading', {
|
||||
name: 'loading',
|
||||
template: getTemplate('loading')
|
||||
});
|
||||
|
||||
// Toolbox
|
||||
|
||||
Router.route('/toolbox', {
|
||||
name: 'toolbox',
|
||||
template: getTemplate('toolbox')
|
||||
});
|
||||
|
||||
// -------------------------------------------- Server-Side -------------------------------------------- //
|
||||
|
||||
// Link Out
|
||||
|
||||
Router.route('/out', {
|
||||
name: 'out',
|
||||
where: 'server',
|
||||
action: function(){
|
||||
var query = this.request.query;
|
||||
if(query.url){
|
||||
var decodedUrl = decodeURIComponent(query.url);
|
||||
var post = Posts.findOne({url: decodedUrl});
|
||||
if(post){
|
||||
Posts.update(post._id, {$inc: {clicks: 1}});
|
||||
}
|
||||
this.response.writeHead(302, {'Location': query.url});
|
||||
this.response.end();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Notification email
|
||||
|
||||
Router.route('/email/notification/:id?', {
|
||||
name: 'notification',
|
||||
where: 'server',
|
||||
action: function() {
|
||||
var notification = Notifications.findOne(this.params.id);
|
||||
var notificationContents = buildEmailNotification(notification);
|
||||
this.response.write(notificationContents.html);
|
||||
this.response.end();
|
||||
}
|
||||
});
|
||||
|
||||
// New user email
|
||||
|
||||
Router.route('/email/new-user/:id?', {
|
||||
name: 'newUser',
|
||||
where: 'server',
|
||||
action: function() {
|
||||
var user = Meteor.users.findOne(this.params.id);
|
||||
var emailProperties = {
|
||||
profileUrl: getProfileUrl(user),
|
||||
username: getUserName(user)
|
||||
};
|
||||
console.log(Handlebars);
|
||||
|
||||
console.log(Handlebars.templates);
|
||||
|
||||
html = getEmailTemplate('emailNewUser')(emailProperties);
|
||||
this.response.write(buildEmailTemplate(html));
|
||||
this.response.end();
|
||||
}
|
||||
});
|
||||
|
||||
// New post email
|
||||
|
||||
Router.route('/email/new-post/:id?', {
|
||||
name: 'newPost',
|
||||
where: 'server',
|
||||
action: function() {
|
||||
var post = Posts.findOne(this.params.id);
|
||||
html = Handlebars.templates[getTemplate('emailNewPost')](getPostProperties(post));
|
||||
this.response.write(buildEmailTemplate(html));
|
||||
this.response.end();
|
||||
}
|
||||
});
|
||||
|
||||
// Account approved email
|
||||
|
||||
Router.route('/email/account-approved/:id?', {
|
||||
name: 'accountApproved',
|
||||
where: 'server',
|
||||
action: function() {
|
||||
var user = Meteor.users.findOne(this.params.id);
|
||||
var emailProperties = {
|
||||
profileUrl: getProfileUrl(user),
|
||||
username: getUserName(user),
|
||||
siteTitle: getSetting('title'),
|
||||
siteUrl: getSiteUrl()
|
||||
};
|
||||
html = Handlebars.templates[getTemplate('emailAccountApproved')](emailProperties);
|
||||
this.response.write(buildEmailTemplate(html));
|
||||
this.response.end();
|
||||
}
|
||||
});
|
||||
Router.route('/', {
|
||||
name: 'posts_default',
|
||||
controller: getDefaultViewController()
|
||||
});
|
||||
|
||||
Router.route('/top/:limit?', {
|
||||
name: 'posts_top',
|
||||
controller: PostsTopController
|
||||
});
|
||||
|
||||
// New
|
||||
|
||||
Router.route('/new/:limit?', {
|
||||
name: 'posts_new',
|
||||
controller: PostsNewController
|
||||
});
|
||||
|
||||
// Best
|
||||
|
||||
Router.route('/best/:limit?', {
|
||||
name: 'posts_best',
|
||||
controller: PostsBestController
|
||||
});
|
||||
|
||||
// Pending
|
||||
|
||||
Router.route('/pending/:limit?', {
|
||||
name: 'posts_pending',
|
||||
controller: PostsPendingController
|
||||
});
|
||||
|
||||
|
||||
|
||||
// TODO: enable /category/new, /category/best, etc. views
|
||||
|
||||
|
||||
// Digest
|
||||
|
||||
Router.route('/digest/:year/:month/:day', {
|
||||
name: 'posts_digest',
|
||||
controller: PostsDigestController
|
||||
});
|
||||
|
||||
Router.route('/digest', {
|
||||
name: 'posts_digest_default',
|
||||
controller: PostsDigestController
|
||||
});
|
||||
|
||||
// -------------------------------------------- Post -------------------------------------------- //
|
||||
|
||||
|
||||
// Post Page
|
||||
|
||||
Router.route('/posts/:_id', {
|
||||
name: 'post_page',
|
||||
controller: PostPageController
|
||||
});
|
||||
|
||||
Router.route('/posts/:_id/comment/:commentId', {
|
||||
name: 'post_page_comment',
|
||||
controller: PostPageController,
|
||||
onAfterAction: function () {
|
||||
// TODO: scroll to comment position
|
||||
}
|
||||
});
|
||||
|
||||
// Post Edit
|
||||
|
||||
Router.route('/posts/:_id/edit', {
|
||||
name: 'post_edit',
|
||||
template: getTemplate('post_edit'),
|
||||
waitOn: function () {
|
||||
return [
|
||||
coreSubscriptions.subscribe('singlePost', this.params._id),
|
||||
coreSubscriptions.subscribe('allUsersAdmin')
|
||||
];
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
postId: this.params._id,
|
||||
post: Posts.findOne(this.params._id)
|
||||
};
|
||||
},
|
||||
fastRender: true
|
||||
});
|
||||
|
||||
// Post Submit
|
||||
|
||||
Router.route('/submit', {
|
||||
name: 'post_submit',
|
||||
template: getTemplate('post_submit'),
|
||||
});
|
||||
|
||||
// -------------------------------------------- Comment -------------------------------------------- //
|
||||
|
||||
// Comment Reply
|
||||
|
||||
Router.route('/comments/:_id', {
|
||||
name: 'comment_reply',
|
||||
template: getTemplate('comment_reply'),
|
||||
controller: CommentPageController,
|
||||
onAfterAction: function() {
|
||||
window.queueComments = false;
|
||||
}
|
||||
});
|
||||
|
||||
// Comment Edit
|
||||
|
||||
Router.route('/comments/:_id/edit', {
|
||||
name: 'comment_edit',
|
||||
template: getTemplate('comment_edit'),
|
||||
controller: CommentPageController,
|
||||
onAfterAction: function() {
|
||||
window.queueComments = false;
|
||||
}
|
||||
});
|
||||
|
||||
// -------------------------------------------- Users -------------------------------------------- //
|
||||
|
||||
// User Logout
|
||||
|
||||
Router.route('/sign-out', {
|
||||
name: 'signOut',
|
||||
onBeforeAction: function() {
|
||||
Meteor.logout(function() {
|
||||
return Router.go('/');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// User Profile
|
||||
|
||||
Router.route('/users/:_idOrSlug', {
|
||||
name: 'user_profile',
|
||||
template: getTemplate('user_profile'),
|
||||
controller: UserPageController
|
||||
});
|
||||
|
||||
// User Edit
|
||||
|
||||
Router.route('/users/:_idOrSlug/edit', {
|
||||
name: 'user_edit',
|
||||
template: getTemplate('user_edit'),
|
||||
controller: UserPageController
|
||||
});
|
||||
|
||||
// Account
|
||||
|
||||
Router.route('/account', {
|
||||
name: 'account',
|
||||
template: getTemplate('user_edit'),
|
||||
controller: AccountController
|
||||
});
|
||||
|
||||
// All Users
|
||||
|
||||
Router.route('/all-users/:limit?', {
|
||||
name: 'all-users',
|
||||
template: getTemplate('users'),
|
||||
waitOn: function() {
|
||||
var limit = parseInt(this.params.limit) || 20;
|
||||
return coreSubscriptions.subscribe('allUsers', this.params.filterBy, this.params.sortBy, limit);
|
||||
},
|
||||
data: function() {
|
||||
var limit = parseInt(this.params.limit) || 20,
|
||||
parameters = getUsersParameters(this.params.filterBy, this.params.sortBy, limit),
|
||||
filterBy = (typeof this.params.filterBy === 'string') ? this.params.filterBy : 'all',
|
||||
sortBy = (typeof this.params.sortBy === 'string') ? this.params.sortBy : 'createdAt';
|
||||
Session.set('usersLimit', limit);
|
||||
return {
|
||||
users: Meteor.users.find(parameters.find, parameters.options),
|
||||
filterBy: filterBy,
|
||||
sortBy: sortBy
|
||||
};
|
||||
},
|
||||
fastRender: true
|
||||
});
|
||||
|
||||
// Unsubscribe (from notifications)
|
||||
|
||||
Router.route('/unsubscribe/:hash', {
|
||||
name: 'unsubscribe',
|
||||
template: getTemplate('unsubscribe'),
|
||||
data: function() {
|
||||
return {
|
||||
hash: this.params.hash
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// -------------------------------------------- Other -------------------------------------------- //
|
||||
|
||||
|
||||
|
||||
// Settings
|
||||
|
||||
Router.route('/settings', {
|
||||
name: 'settings',
|
||||
template: getTemplate('settings'),
|
||||
data: function () {
|
||||
// we only have one set of settings for now
|
||||
return {
|
||||
hasSettings: !!Settings.find().count(),
|
||||
settings: Settings.findOne()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Loading (for testing purposes)
|
||||
|
||||
Router.route('/loading', {
|
||||
name: 'loading',
|
||||
template: getTemplate('loading')
|
||||
});
|
||||
|
||||
// Toolbox
|
||||
|
||||
Router.route('/toolbox', {
|
||||
name: 'toolbox',
|
||||
template: getTemplate('toolbox')
|
||||
});
|
||||
|
||||
// -------------------------------------------- Server-Side -------------------------------------------- //
|
||||
|
||||
// Link Out
|
||||
|
||||
Router.route('/out', {
|
||||
name: 'out',
|
||||
where: 'server',
|
||||
action: function(){
|
||||
var query = this.request.query;
|
||||
if(query.url){
|
||||
var decodedUrl = decodeURIComponent(query.url);
|
||||
var post = Posts.findOne({url: decodedUrl});
|
||||
if(post){
|
||||
Posts.update(post._id, {$inc: {clicks: 1}});
|
||||
}
|
||||
this.response.writeHead(302, {'Location': query.url});
|
||||
this.response.end();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Notification email
|
||||
|
||||
Router.route('/email/notification/:id?', {
|
||||
name: 'notification',
|
||||
where: 'server',
|
||||
action: function() {
|
||||
var notification = Notifications.findOne(this.params.id);
|
||||
var notificationContents = buildEmailNotification(notification);
|
||||
this.response.write(notificationContents.html);
|
||||
this.response.end();
|
||||
}
|
||||
});
|
||||
|
||||
// New user email
|
||||
|
||||
Router.route('/email/new-user/:id?', {
|
||||
name: 'newUser',
|
||||
where: 'server',
|
||||
action: function() {
|
||||
var user = Meteor.users.findOne(this.params.id);
|
||||
var emailProperties = {
|
||||
profileUrl: getProfileUrl(user),
|
||||
username: getUserName(user)
|
||||
};
|
||||
console.log(Handlebars);
|
||||
|
||||
console.log(Handlebars.templates);
|
||||
|
||||
html = getEmailTemplate('emailNewUser')(emailProperties);
|
||||
this.response.write(buildEmailTemplate(html));
|
||||
this.response.end();
|
||||
}
|
||||
});
|
||||
|
||||
// New post email
|
||||
|
||||
Router.route('/email/new-post/:id?', {
|
||||
name: 'newPost',
|
||||
where: 'server',
|
||||
action: function() {
|
||||
var post = Posts.findOne(this.params.id);
|
||||
html = Handlebars.templates[getTemplate('emailNewPost')](getPostProperties(post));
|
||||
this.response.write(buildEmailTemplate(html));
|
||||
this.response.end();
|
||||
}
|
||||
});
|
||||
|
||||
// Account approved email
|
||||
|
||||
Router.route('/email/account-approved/:id?', {
|
||||
name: 'accountApproved',
|
||||
where: 'server',
|
||||
action: function() {
|
||||
var user = Meteor.users.findOne(this.params.id);
|
||||
var emailProperties = {
|
||||
profileUrl: getProfileUrl(user),
|
||||
username: getUserName(user),
|
||||
siteTitle: getSetting('title'),
|
||||
siteUrl: getSiteUrl()
|
||||
};
|
||||
html = Handlebars.templates[getTemplate('emailAccountApproved')](emailProperties);
|
||||
this.response.write(buildEmailTemplate(html));
|
||||
this.response.end();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// adding common subscriptions that's need to be loaded on all the routes
|
||||
|
|
|
@ -72,21 +72,37 @@
|
|||
"id-map",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:controller",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:core",
|
||||
"0.3.4"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:dynamic-template",
|
||||
"0.4.1"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:layout",
|
||||
"0.4.1"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:location",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:middleware-stack",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:router",
|
||||
"0.9.4"
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:url",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"jquery",
|
||||
|
|
|
@ -76,21 +76,37 @@
|
|||
"id-map",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:controller",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:core",
|
||||
"0.3.4"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:dynamic-template",
|
||||
"0.4.1"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:layout",
|
||||
"0.4.1"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:location",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:middleware-stack",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:router",
|
||||
"0.9.4"
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:url",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"jquery",
|
||||
|
|
|
@ -10,8 +10,8 @@ Package.onUse(function (api) {
|
|||
'telescope-lib',
|
||||
'telescope-base',
|
||||
'telescope-email',
|
||||
'kestanous:herald@0.6.0',
|
||||
'kestanous:herald-email@0.2.1'
|
||||
'kestanous:herald',
|
||||
'kestanous:herald-email'
|
||||
], ['client', 'server']);
|
||||
|
||||
api.use([
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
{
|
||||
"dependencies": [
|
||||
[
|
||||
"accounts-base",
|
||||
"1.1.2"
|
||||
],
|
||||
[
|
||||
"application-configuration",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"autoupdate",
|
||||
"1.1.3"
|
||||
"artwells:queue",
|
||||
"0.0.3"
|
||||
],
|
||||
[
|
||||
"base64",
|
||||
|
@ -52,10 +56,6 @@
|
|||
"ejson",
|
||||
"1.0.4"
|
||||
],
|
||||
[
|
||||
"fastclick",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"follower-livedata",
|
||||
"1.0.2"
|
||||
|
@ -76,29 +76,41 @@
|
|||
"htmljs",
|
||||
"1.0.2"
|
||||
],
|
||||
[
|
||||
"http",
|
||||
"1.0.8"
|
||||
],
|
||||
[
|
||||
"id-map",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:controller",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:core",
|
||||
"0.3.4"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:dynamic-template",
|
||||
"0.4.1"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:layout",
|
||||
"0.4.1"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:location",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:middleware-stack",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:router",
|
||||
"0.9.4"
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:url",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"jquery",
|
||||
|
@ -110,20 +122,20 @@
|
|||
],
|
||||
[
|
||||
"kestanous:herald",
|
||||
"0.6.0"
|
||||
"1.1.3"
|
||||
],
|
||||
[
|
||||
"kestanous:herald-email",
|
||||
"0.2.1"
|
||||
],
|
||||
[
|
||||
"launch-screen",
|
||||
"1.0.0"
|
||||
"0.4.2"
|
||||
],
|
||||
[
|
||||
"livedata",
|
||||
"1.0.11"
|
||||
],
|
||||
[
|
||||
"localstorage",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"logging",
|
||||
"1.0.5"
|
||||
|
@ -132,10 +144,6 @@
|
|||
"meteor",
|
||||
"1.1.3"
|
||||
],
|
||||
[
|
||||
"meteor-platform",
|
||||
"1.2.0"
|
||||
],
|
||||
[
|
||||
"minifiers",
|
||||
"1.1.2"
|
||||
|
@ -144,14 +152,14 @@
|
|||
"minimongo",
|
||||
"1.0.5"
|
||||
],
|
||||
[
|
||||
"mobile-status-bar",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"mongo",
|
||||
"1.0.8"
|
||||
],
|
||||
[
|
||||
"mongo-livedata",
|
||||
"1.0.6"
|
||||
],
|
||||
[
|
||||
"observe-sequence",
|
||||
"1.0.3"
|
||||
|
@ -172,10 +180,6 @@
|
|||
"reactive-var",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"reload",
|
||||
"1.1.1"
|
||||
],
|
||||
[
|
||||
"retry",
|
||||
"1.0.1"
|
||||
|
@ -185,8 +189,8 @@
|
|||
"1.0.2"
|
||||
],
|
||||
[
|
||||
"session",
|
||||
"1.0.4"
|
||||
"service-configuration",
|
||||
"1.0.2"
|
||||
],
|
||||
[
|
||||
"spacebars",
|
||||
|
@ -196,10 +200,6 @@
|
|||
"spacebars-compiler",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"standard-app-packages",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"telescope-base",
|
||||
"0.0.0"
|
||||
|
@ -232,10 +232,6 @@
|
|||
"underscore",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"url",
|
||||
"1.0.2"
|
||||
],
|
||||
[
|
||||
"webapp",
|
||||
"1.1.4"
|
||||
|
|
|
@ -68,21 +68,37 @@
|
|||
"id-map",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:controller",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:core",
|
||||
"0.3.4"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:dynamic-template",
|
||||
"0.4.1"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:layout",
|
||||
"0.4.1"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:location",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:middleware-stack",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:router",
|
||||
"0.9.4"
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:url",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"jquery",
|
||||
|
|
|
@ -68,21 +68,37 @@
|
|||
"id-map",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:controller",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:core",
|
||||
"0.3.4"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:dynamic-template",
|
||||
"0.4.1"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:layout",
|
||||
"0.4.1"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:location",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:middleware-stack",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:router",
|
||||
"0.9.4"
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:url",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"jquery",
|
||||
|
|
|
@ -68,21 +68,37 @@
|
|||
"id-map",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:controller",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:core",
|
||||
"0.3.4"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:dynamic-template",
|
||||
"0.4.1"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:layout",
|
||||
"0.4.1"
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:location",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:middleware-stack",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"iron:router",
|
||||
"0.9.4"
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:url",
|
||||
"1.0.0"
|
||||
],
|
||||
[
|
||||
"jquery",
|
||||
|
|
BIN
public/img/default-avatar.png
Normal file
BIN
public/img/default-avatar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
Loading…
Add table
Reference in a new issue