mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
switching to dev branch
This commit is contained in:
parent
bd9313da24
commit
632ddd5b00
4 changed files with 111 additions and 113 deletions
|
@ -1 +1 @@
|
||||||
0.6.5.1
|
0.6.6.1
|
||||||
|
|
|
@ -82,7 +82,8 @@ Toolbox
|
||||||
//--------------------------------------------------------------------------------------------------//
|
//--------------------------------------------------------------------------------------------------//
|
||||||
|
|
||||||
Router.configure({
|
Router.configure({
|
||||||
layout: 'layout',
|
// autoRender: false,
|
||||||
|
layoutTemplate: 'layout',
|
||||||
loadingTemplate: 'loading',
|
loadingTemplate: 'loading',
|
||||||
notFoundTemplate: 'not_found'
|
notFoundTemplate: 'not_found'
|
||||||
});
|
});
|
||||||
|
@ -93,93 +94,101 @@ Router.configure({
|
||||||
|
|
||||||
var filters = {
|
var filters = {
|
||||||
|
|
||||||
isLoggedIn: function(page) {
|
// isLoggedIn: function(page) {
|
||||||
if (Meteor.loggingIn()) {
|
// if (Meteor.loggingIn()) {
|
||||||
return 'loading';
|
// return 'loading';
|
||||||
} else if (Meteor.user()) {
|
// } else if (Meteor.user()) {
|
||||||
return page;
|
// return page;
|
||||||
} else {
|
// } else {
|
||||||
return 'user_signin';
|
// return 'user_signin';
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
|
||||||
|
// isLoggedOut: function(page){
|
||||||
|
// return Meteor.user() ? "already_logged_in" : page;
|
||||||
|
// },
|
||||||
|
|
||||||
|
// isAdmin: function(page) {
|
||||||
|
// return isAdmin(Meteor.user()) ? page : "no_rights";
|
||||||
|
// },
|
||||||
|
|
||||||
|
// canView: function(page) {
|
||||||
|
// var error = canView(Meteor.user(), true);
|
||||||
|
// if (error === true)
|
||||||
|
// return page;
|
||||||
|
|
||||||
|
// // a problem.. make sure we are logged in
|
||||||
|
// if (Meteor.loggingIn())
|
||||||
|
// return 'loading';
|
||||||
|
|
||||||
|
// // otherwise the error tells us what to show.
|
||||||
|
// return error;
|
||||||
|
// },
|
||||||
|
|
||||||
|
// canPost: function(page) {
|
||||||
|
// var error = canPost(Meteor.user(), true);
|
||||||
|
// if (error === true)
|
||||||
|
// return page;
|
||||||
|
|
||||||
|
// // a problem.. make sure we are logged in
|
||||||
|
// if (Meteor.loggingIn())
|
||||||
|
// return 'loading';
|
||||||
|
|
||||||
|
// // otherwise the error tells us what to show.
|
||||||
|
// return error;
|
||||||
|
// },
|
||||||
|
|
||||||
|
canEditPost: function() {
|
||||||
|
var post = Posts.findOne(this.params._id);
|
||||||
|
if(!currentUserCanEdit(post)){
|
||||||
|
this.render('no_rights');
|
||||||
|
this.stop();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
isLoggedOut: function(page){
|
canEditComment: function() {
|
||||||
return Meteor.user() ? "already_logged_in" : page;
|
var comment = Comments.findOne(this.params._id);
|
||||||
},
|
if(!currentUserCanEdit(comment)){
|
||||||
|
this.render('no_rights');
|
||||||
isAdmin: function(page) {
|
this.stop();
|
||||||
return isAdmin(Meteor.user()) ? page : "no_rights";
|
|
||||||
},
|
|
||||||
|
|
||||||
canView: function(page) {
|
|
||||||
var error = canView(Meteor.user(), true);
|
|
||||||
if (error === true)
|
|
||||||
return page;
|
|
||||||
|
|
||||||
// a problem.. make sure we are logged in
|
|
||||||
if (Meteor.loggingIn())
|
|
||||||
return 'loading';
|
|
||||||
|
|
||||||
// otherwise the error tells us what to show.
|
|
||||||
return error;
|
|
||||||
},
|
|
||||||
|
|
||||||
canPost: function(page) {
|
|
||||||
var error = canPost(Meteor.user(), true);
|
|
||||||
if (error === true)
|
|
||||||
return page;
|
|
||||||
|
|
||||||
// a problem.. make sure we are logged in
|
|
||||||
if (Meteor.loggingIn())
|
|
||||||
return 'loading';
|
|
||||||
|
|
||||||
// otherwise the error tells us what to show.
|
|
||||||
return error;
|
|
||||||
},
|
|
||||||
|
|
||||||
canEdit: function(router, item) {
|
|
||||||
if(!currentUserCanEdit(item)){
|
|
||||||
router.render('no_rights');
|
|
||||||
router.stop();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
canEditX: function(page) {
|
|
||||||
// make findOne() non reactive to avoid re-triggering the router every time the
|
|
||||||
// current comment or post object changes
|
|
||||||
// but make sure the comment/post is loaded before moving on
|
|
||||||
if (page === 'comment_edit') {
|
|
||||||
var item = Comments.findOne(Session.get('selectedCommentId'), {reactive: false});
|
|
||||||
if(!Session.get('singleCommentReady'))
|
|
||||||
return 'loading'
|
|
||||||
} else {
|
|
||||||
var item = Posts.findOne(Session.get('selectedPostId'), {reactive: false});
|
|
||||||
if(!Session.get('singlePostReady'))
|
|
||||||
return 'loading'
|
|
||||||
}
|
|
||||||
|
|
||||||
var error = canEdit(Meteor.user(), item, true);
|
|
||||||
if (error === true)
|
|
||||||
return page;
|
|
||||||
|
|
||||||
// a problem.. make sure the item has loaded and we have logged in
|
|
||||||
if (! item || Meteor.loggingIn())
|
|
||||||
return 'loading';
|
|
||||||
|
|
||||||
// otherwise the error tells us what to show.
|
|
||||||
return error;
|
|
||||||
},
|
|
||||||
|
|
||||||
hasCompletedProfile: function() {
|
|
||||||
var user = Meteor.user();
|
|
||||||
|
|
||||||
if (user && ! Meteor.loggingIn() && ! userProfileComplete(user)){
|
|
||||||
Session.set('selectedUserId', user._id);
|
|
||||||
return 'user_email';
|
|
||||||
} else {
|
|
||||||
return page;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// canEditX: function(page) {
|
||||||
|
// // make findOne() non reactive to avoid re-triggering the router every time the
|
||||||
|
// // current comment or post object changes
|
||||||
|
// // but make sure the comment/post is loaded before moving on
|
||||||
|
// if (page === 'comment_edit') {
|
||||||
|
// var item = Comments.findOne(Session.get('selectedCommentId'), {reactive: false});
|
||||||
|
// if(!Session.get('singleCommentReady'))
|
||||||
|
// return 'loading'
|
||||||
|
// } else {
|
||||||
|
// var item = Posts.findOne(Session.get('selectedPostId'), {reactive: false});
|
||||||
|
// if(!Session.get('singlePostReady'))
|
||||||
|
// return 'loading'
|
||||||
|
// }
|
||||||
|
|
||||||
|
// var error = canEdit(Meteor.user(), item, true);
|
||||||
|
// if (error === true)
|
||||||
|
// return page;
|
||||||
|
|
||||||
|
// // a problem.. make sure the item has loaded and we have logged in
|
||||||
|
// if (! item || Meteor.loggingIn())
|
||||||
|
// return 'loading';
|
||||||
|
|
||||||
|
// // otherwise the error tells us what to show.
|
||||||
|
// return error;
|
||||||
|
// },
|
||||||
|
|
||||||
|
// hasCompletedProfile: function() {
|
||||||
|
// var user = Meteor.user();
|
||||||
|
|
||||||
|
// if (user && ! Meteor.loggingIn() && ! userProfileComplete(user)){
|
||||||
|
// Session.set('selectedUserId', user._id);
|
||||||
|
// return 'user_email';
|
||||||
|
// } else {
|
||||||
|
// return page;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,6 +213,8 @@ Router.map(function() {
|
||||||
// Top
|
// Top
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
// waitOn: subs.topPostHandle = postListSubscription(selectTop, sortPosts('score'), 10);
|
||||||
|
|
||||||
// New
|
// New
|
||||||
|
|
||||||
|
@ -256,6 +267,8 @@ Router.map(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// -------------------------------------------- Post -------------------------------------------- //
|
||||||
|
|
||||||
// Post Page
|
// Post Page
|
||||||
|
|
||||||
this.route('post_page', {
|
this.route('post_page', {
|
||||||
|
@ -304,16 +317,15 @@ Router.map(function() {
|
||||||
post: Posts.findOne(this.params._id)
|
post: Posts.findOne(this.params._id)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
after: function(){
|
after: filters.canEditPost
|
||||||
var post = Posts.findOne(this.params._id);
|
|
||||||
filters.canEdit(this, post);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Post Submit
|
// Post Submit
|
||||||
|
|
||||||
this.route('post_submit', {path: '/submit'});
|
this.route('post_submit', {path: '/submit'});
|
||||||
|
|
||||||
|
// -------------------------------------------- Comment -------------------------------------------- //
|
||||||
|
|
||||||
// Comment Page
|
// Comment Page
|
||||||
|
|
||||||
this.route('comment_page', {
|
this.route('comment_page', {
|
||||||
|
@ -348,10 +360,7 @@ Router.map(function() {
|
||||||
comment: Comments.findOne(this.params._id)
|
comment: Comments.findOne(this.params._id)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
after: function(){
|
after: filters.canEditComment
|
||||||
var comment = Posts.findOne(this.params._id);
|
|
||||||
filters.canEdit(this, comment);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// User Profile
|
// User Profile
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
{
|
{
|
||||||
"meteor": {},
|
"meteor": {},
|
||||||
"packages": {
|
"packages": {
|
||||||
"router": {},
|
|
||||||
"momentjs": {},
|
"momentjs": {},
|
||||||
"database-forms": {
|
"database-forms": {
|
||||||
"git": "git://github.com/SachaG/database-forms.git"
|
"git": "git://github.com/SachaG/database-forms.git"
|
||||||
},
|
},
|
||||||
"paginated-subscription": {},
|
"paginated-subscription": {},
|
||||||
"crypto-md5": {},
|
"crypto-md5": {},
|
||||||
"iron-router": {}
|
"iron-router": {
|
||||||
|
"git": "https://github.com/EventedMind/iron-router.git",
|
||||||
|
"branch": "dev"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
25
smart.lock
25
smart.lock
|
@ -2,7 +2,6 @@
|
||||||
"meteor": {},
|
"meteor": {},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"basePackages": {
|
"basePackages": {
|
||||||
"router": {},
|
|
||||||
"momentjs": {},
|
"momentjs": {},
|
||||||
"database-forms": {
|
"database-forms": {
|
||||||
"git": "git://github.com/SachaG/database-forms.git",
|
"git": "git://github.com/SachaG/database-forms.git",
|
||||||
|
@ -10,14 +9,12 @@
|
||||||
},
|
},
|
||||||
"paginated-subscription": {},
|
"paginated-subscription": {},
|
||||||
"crypto-md5": {},
|
"crypto-md5": {},
|
||||||
"iron-router": {}
|
"iron-router": {
|
||||||
|
"git": "https://github.com/EventedMind/iron-router.git",
|
||||||
|
"branch": "dev"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"packages": {
|
"packages": {
|
||||||
"router": {
|
|
||||||
"git": "https://github.com/tmeasday/meteor-router.git",
|
|
||||||
"tag": "v0.5.4.1",
|
|
||||||
"commit": "d00e380dda2184b70e909fc4a0fb5358d602c586"
|
|
||||||
},
|
|
||||||
"momentjs": {
|
"momentjs": {
|
||||||
"git": "https://github.com/crapthings/meteor-momentjs.git",
|
"git": "https://github.com/crapthings/meteor-momentjs.git",
|
||||||
"tag": "v2.1.0.2",
|
"tag": "v2.1.0.2",
|
||||||
|
@ -40,18 +37,8 @@
|
||||||
},
|
},
|
||||||
"iron-router": {
|
"iron-router": {
|
||||||
"git": "https://github.com/EventedMind/iron-router.git",
|
"git": "https://github.com/EventedMind/iron-router.git",
|
||||||
"tag": "v0.5.4",
|
"branch": "dev",
|
||||||
"commit": "3e0e22ff85630b7503d0daa1538c6d90abb84020"
|
"commit": "97ce4e61badaea7987682a530ac627c5c1c116aa"
|
||||||
},
|
|
||||||
"page-js-ie-support": {
|
|
||||||
"git": "https://github.com/tmeasday/meteor-page-js-ie-support.git",
|
|
||||||
"tag": "v1.3.5",
|
|
||||||
"commit": "b99ed8380aefd10b2afc8f18d9eed4dd0d8ea9cb"
|
|
||||||
},
|
|
||||||
"HTML5-History-API": {
|
|
||||||
"git": "https://github.com/tmeasday/meteor-HTML5-History-API.git",
|
|
||||||
"tag": "v4.0.0",
|
|
||||||
"commit": "dc4965f1424cfca625ec3fbea17eace03f8e32c5"
|
|
||||||
},
|
},
|
||||||
"crypto-base": {
|
"crypto-base": {
|
||||||
"git": "https://github.com/tmeasday/meteor-crypto-base.git",
|
"git": "https://github.com/tmeasday/meteor-crypto-base.git",
|
||||||
|
|
Loading…
Add table
Reference in a new issue