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({
|
||||
layout: 'layout',
|
||||
// autoRender: false,
|
||||
layoutTemplate: 'layout',
|
||||
loadingTemplate: 'loading',
|
||||
notFoundTemplate: 'not_found'
|
||||
});
|
||||
|
@ -93,93 +94,101 @@ Router.configure({
|
|||
|
||||
var filters = {
|
||||
|
||||
isLoggedIn: function(page) {
|
||||
if (Meteor.loggingIn()) {
|
||||
return 'loading';
|
||||
} else if (Meteor.user()) {
|
||||
return page;
|
||||
} else {
|
||||
return 'user_signin';
|
||||
// isLoggedIn: function(page) {
|
||||
// if (Meteor.loggingIn()) {
|
||||
// return 'loading';
|
||||
// } else if (Meteor.user()) {
|
||||
// return page;
|
||||
// } else {
|
||||
// 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){
|
||||
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;
|
||||
},
|
||||
|
||||
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;
|
||||
canEditComment: function() {
|
||||
var comment = Comments.findOne(this.params._id);
|
||||
if(!currentUserCanEdit(comment)){
|
||||
this.render('no_rights');
|
||||
this.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;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
@ -204,6 +213,8 @@ Router.map(function() {
|
|||
// Top
|
||||
|
||||
// TODO
|
||||
|
||||
// waitOn: subs.topPostHandle = postListSubscription(selectTop, sortPosts('score'), 10);
|
||||
|
||||
// New
|
||||
|
||||
|
@ -256,6 +267,8 @@ Router.map(function() {
|
|||
}
|
||||
});
|
||||
|
||||
// -------------------------------------------- Post -------------------------------------------- //
|
||||
|
||||
// Post Page
|
||||
|
||||
this.route('post_page', {
|
||||
|
@ -304,16 +317,15 @@ Router.map(function() {
|
|||
post: Posts.findOne(this.params._id)
|
||||
}
|
||||
},
|
||||
after: function(){
|
||||
var post = Posts.findOne(this.params._id);
|
||||
filters.canEdit(this, post);
|
||||
}
|
||||
after: filters.canEditPost
|
||||
});
|
||||
|
||||
// Post Submit
|
||||
|
||||
this.route('post_submit', {path: '/submit'});
|
||||
|
||||
// -------------------------------------------- Comment -------------------------------------------- //
|
||||
|
||||
// Comment Page
|
||||
|
||||
this.route('comment_page', {
|
||||
|
@ -348,10 +360,7 @@ Router.map(function() {
|
|||
comment: Comments.findOne(this.params._id)
|
||||
}
|
||||
},
|
||||
after: function(){
|
||||
var comment = Posts.findOne(this.params._id);
|
||||
filters.canEdit(this, comment);
|
||||
}
|
||||
after: filters.canEditComment
|
||||
});
|
||||
|
||||
// User Profile
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
{
|
||||
"meteor": {},
|
||||
"packages": {
|
||||
"router": {},
|
||||
"momentjs": {},
|
||||
"database-forms": {
|
||||
"git": "git://github.com/SachaG/database-forms.git"
|
||||
},
|
||||
"paginated-subscription": {},
|
||||
"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": {},
|
||||
"dependencies": {
|
||||
"basePackages": {
|
||||
"router": {},
|
||||
"momentjs": {},
|
||||
"database-forms": {
|
||||
"git": "git://github.com/SachaG/database-forms.git",
|
||||
|
@ -10,14 +9,12 @@
|
|||
},
|
||||
"paginated-subscription": {},
|
||||
"crypto-md5": {},
|
||||
"iron-router": {}
|
||||
"iron-router": {
|
||||
"git": "https://github.com/EventedMind/iron-router.git",
|
||||
"branch": "dev"
|
||||
}
|
||||
},
|
||||
"packages": {
|
||||
"router": {
|
||||
"git": "https://github.com/tmeasday/meteor-router.git",
|
||||
"tag": "v0.5.4.1",
|
||||
"commit": "d00e380dda2184b70e909fc4a0fb5358d602c586"
|
||||
},
|
||||
"momentjs": {
|
||||
"git": "https://github.com/crapthings/meteor-momentjs.git",
|
||||
"tag": "v2.1.0.2",
|
||||
|
@ -40,18 +37,8 @@
|
|||
},
|
||||
"iron-router": {
|
||||
"git": "https://github.com/EventedMind/iron-router.git",
|
||||
"tag": "v0.5.4",
|
||||
"commit": "3e0e22ff85630b7503d0daa1538c6d90abb84020"
|
||||
},
|
||||
"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"
|
||||
"branch": "dev",
|
||||
"commit": "97ce4e61badaea7987682a530ac627c5c1c116aa"
|
||||
},
|
||||
"crypto-base": {
|
||||
"git": "https://github.com/tmeasday/meteor-crypto-base.git",
|
||||
|
|
Loading…
Add table
Reference in a new issue