Skip to content

Commit

Permalink
Migrated from Iron Router to Flow Router and updated Meteor to 1.2.0.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
kjetilhau committed Oct 11, 2015
1 parent 447da84 commit e2186d3
Show file tree
Hide file tree
Showing 42 changed files with 511 additions and 358 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
*.sublime-workspace
dump
settings.json
.idea/*
.meteor/.id
.idea/*
4 changes: 4 additions & 0 deletions .meteor/.finished-upgraders
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ notices-for-0.9.0
notices-for-0.9.1
0.9.4-platform-file
notices-for-facebook-graph-api-2
1.2.0-standard-minifiers-package
1.2.0-meteor-platform-split
1.2.0-cordova-changes
1.2.0-breaking-changes
7 changes: 7 additions & 0 deletions .meteor/.id
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file contains a token that is unique to your project.
# Check it into your repository along with the rest of this directory.
# It can be used for purposes such as:
# - ensuring you don't accidentally deploy one app on top of another
# - providing package authors with aggregated statistics

17x7iw3cla1ql97roxh
1 change: 0 additions & 1 deletion .meteor/cordova-plugins
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

27 changes: 23 additions & 4 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,33 @@
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

# Meteor core

standard-minifiers
meteor-base
mobile-experience
mongo
blaze-html-templates
session
jquery
tracker
logging
reload
random
ejson
spacebars
check
accounts-base

# Atmosphere

kadira:flow-router
kadira:blaze-layout
arillo:flow-router-helpers
zimme:active-route
aldeed:autoform
aldeed:collection2
aldeed:simple-schema
iron:router
alanning:roles
accounts-base
meteor-platform
twbs:bootstrap
momentjs:moment
momentjs:moment
2 changes: 1 addition & 1 deletion .meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@1.1
METEOR@1.2.0.2
143 changes: 80 additions & 63 deletions .meteor/versions
Original file line number Diff line number Diff line change
@@ -1,63 +1,80 @@
accounts-base@1.2.0
alanning:roles@1.2.13
aldeed:autoform@5.1.2
aldeed:collection2@2.3.3
aldeed:simple-schema@1.3.2
autoupdate@1.2.1
base64@1.0.3
binary-heap@1.0.3
blaze@2.1.1
blaze-tools@1.0.3
boilerplate-generator@1.0.3
callback-hook@1.0.3
check@1.0.5
ddp@1.1.0
deps@1.0.7
ejson@1.0.6
fastclick@1.0.3
geojson-utils@1.0.3
html-tools@1.0.4
htmljs@1.0.4
http@1.1.0
id-map@1.0.3
iron:controller@1.0.7
iron:core@1.0.7
iron:dynamic-template@1.0.7
iron:layout@1.0.7
iron:location@1.0.7
iron:middleware-stack@1.0.7
iron:router@1.0.7
iron:url@1.0.7
jquery@1.11.3_2
json@1.0.3
launch-screen@1.0.2
livedata@1.0.13
localstorage@1.0.3
logging@1.0.7
meteor@1.1.6
meteor-platform@1.2.2
minifiers@1.1.5
minimongo@1.0.8
mobile-status-bar@1.0.3
momentjs:moment@2.9.0
mongo@1.1.0
observe-sequence@1.0.6
ordered-dict@1.0.3
random@1.0.3
reactive-dict@1.1.0
reactive-var@1.0.5
reload@1.1.3
retry@1.0.3
routepolicy@1.0.5
service-configuration@1.0.4
session@1.1.0
spacebars@1.0.6
spacebars-compiler@1.0.6
templating@1.1.1
tracker@1.0.7
twbs:bootstrap@3.3.4
ui@1.0.6
underscore@1.0.3
url@1.0.4
webapp@1.2.0
webapp-hashing@1.0.3
accounts-base@1.2.1
alanning:roles@1.2.14
aldeed:autoform@5.6.1
aldeed:collection2@2.5.0
aldeed:simple-schema@1.3.3
arillo:flow-router-helpers@0.4.5
autoupdate@1.2.3
babel-compiler@5.8.24_1
babel-runtime@0.1.4
base64@1.0.4
binary-heap@1.0.4
blaze@2.1.3
blaze-html-templates@1.0.1
blaze-tools@1.0.4
boilerplate-generator@1.0.4
caching-compiler@1.0.0
caching-html-compiler@1.0.2
callback-hook@1.0.4
check@1.0.6
coffeescript@1.0.10
cosmos:browserify@0.5.1
ddp@1.2.2
ddp-client@1.2.1
ddp-common@1.2.1
ddp-rate-limiter@1.0.0
ddp-server@1.2.1
deps@1.0.9
diff-sequence@1.0.1
ecmascript@0.1.5
ecmascript-collections@0.1.6
ejson@1.0.7
fastclick@1.0.7
geojson-utils@1.0.4
hot-code-push@1.0.0
html-tools@1.0.5
htmljs@1.0.5
http@1.1.1
id-map@1.0.4
jquery@1.11.4
kadira:blaze-layout@2.1.0
kadira:flow-router@2.7.0
launch-screen@1.0.4
livedata@1.0.15
localstorage@1.0.5
logging@1.0.8
meteor@1.1.9
meteor-base@1.0.1
minifiers@1.1.7
minimongo@1.0.10
mobile-experience@1.0.1
mobile-status-bar@1.0.6
momentjs:moment@2.10.6
mongo@1.1.2
mongo-id@1.0.1
npm-mongo@1.4.39_1
observe-sequence@1.0.7
ordered-dict@1.0.4
promise@0.5.0
random@1.0.4
rate-limit@1.0.0
reactive-dict@1.1.2
reactive-var@1.0.6
reload@1.1.4
retry@1.0.4
routepolicy@1.0.6
service-configuration@1.0.5
session@1.1.1
spacebars@1.0.7
spacebars-compiler@1.0.7
standard-minifiers@1.0.1
templating@1.1.4
templating-tools@1.0.0
tracker@1.0.9
twbs:bootstrap@3.3.5
ui@1.0.8
underscore@1.0.4
url@1.0.5
webapp@1.2.2
webapp-hashing@1.0.5
zimme:active-route@2.3.2
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ Take a look at [meteor-skeleton.meteor.com](http://meteor-skeleton.meteor.com) f

## Packages used

- meteor-platform
- accounts-base
- alanning:roles
- iron:router
- kadira:flow-router
- kadira:blaze-layout
- arillo:flow-router-helpers
- zimme:active-route
- aldeed:simple-schema
- aldeed:collection2
- aldeed:autoform
Expand Down
4 changes: 2 additions & 2 deletions client/lib/autoform_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ AutoForm.addHooks(['documentForm'], {
console.log("Insert Error:", error);
} else {
console.log("Document inserted:", result);
Router.go('documentsIndex')
FlowRouter.go('documentsIndex');
}
},
update: function(error) {
if (error) {
console.log("Update Error:", error);
} else {
console.log("Document updated");
Router.go('documentsIndex')
FlowRouter.go('documentsIndex');
}
}
}
Expand Down
11 changes: 1 addition & 10 deletions client/lib/helpers/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
// COMMON HELPERS (client-side only)
// ***************************************************************

// Style link as active if it is the current path
// Usage: <li class="{{active 'frontpage'}}"><a href="{{pathFor 'frontpage'}}">Home</a></li>
UI.registerHelper('active', function(path) {
var route = Router.routes[path].path()
if (Iron.Location.get().originalUrl === route) {
return 'active';
}
});

// Cheap pluralization
UI.registerHelper('pluralize', function(count, word) {
return count === 1 ? '1 ' + word : count + ' ' + word + 's';
Expand Down Expand Up @@ -58,4 +49,4 @@ UI.registerHelper('bytesToSize', function(bytes) {
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];
}
});
});
4 changes: 2 additions & 2 deletions client/lib/helpers/lists.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// ***************************************************************
// LISTS (for use with Autoform)
// LISTS (Example for use with Autoform)
// ***************************************************************

UI.registerHelper("colorOptions", function() {
UI.registerHelper("colors", function() {
return [
{label: "#428bca", value: "#428bca"},
{label: "#a4bdfc", value: "#a4bdfc"},
Expand Down
16 changes: 8 additions & 8 deletions client/routes/config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// ***************************************************************
// ROUTER CONFIGURATION
// FLOW ROUTER CONFIG
// ***************************************************************

Router.configure({
layoutTemplate: 'layout',
notFoundTemplate: '404',
yieldTemplates: {
'header': { to: 'header' },
'footer': { to: 'footer' }
// Not found route
FlowRouter.notFound = {
// Subscriptions registered here don't have Fast Render support.
subscriptions: function() {},
action: function() {
BlazeLayout.render("layout", {header: "header", main: "404", footer: "footer"});
}
});
};
80 changes: 32 additions & 48 deletions client/routes/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,38 @@
// ROUTES (Documents)
// ***************************************************************

Router.map(function() {

// DOCUMENTS INDEX
// -------------------------------------------------------
this.route('documentsIndex', {
template: 'documentsIndex',
path: '/documents',
waitOn: function () {
return Meteor.subscribe('documents');
},
data: {
documents: function () {
return Documents.find({}, {sort: {createdAt: -1}});
}
}
});

// DOCUMENT NEW
// -------------------------------------------------------
this.route('documentNew', {
template: 'documentNew',
path: '/documents/new'
});

// DOCUMENT SHOW
// -------------------------------------------------------
this.route('documentShow', {
template: 'documentShow',
path: '/documents/:_id',
waitOn: function () {
return Meteor.subscribe('document', this.params._id);
},
data: function () {
return Documents.findOne(this.params._id);
}
});
// DOCUMENTS INDEX
// -------------------------------------------------------
FlowRouter.route('/documents', {
action: function() {
BlazeLayout.render("layout", {header: "header", main: "documentsIndex", footer: "footer"});
},
name: "documentsIndex"
});

// DOCUMENT EDIT
// -------------------------------------------------------
this.route('documentEdit', {
template: 'documentEdit',
path: '/documents/:_id/edit',
waitOn: function () {
return Meteor.subscribe('document', this.params._id);
},
data: function () {
return Documents.findOne(this.params._id);
}
});
// DOCUMENT NEW
// -------------------------------------------------------
FlowRouter.route('/documents/new', {
action: function() {
BlazeLayout.render("layout", {header: "header", main: "documentNew", footer: "footer"});
},
name: "documentNew"
});

// DOCUMENT SHOW
// -------------------------------------------------------
FlowRouter.route('/documents/:documentId', {
action: function() {
BlazeLayout.render("layout", {header: "header", main: "documentShow", footer: "footer"});
},
name: "documentShow"
});

// DOCUMENT EDIT
// -------------------------------------------------------
FlowRouter.route('/documents/:documentId/edit', {
action: function() {
BlazeLayout.render("layout", {header: "header", main: "documentEdit", footer: "footer"});
},
name: "documentEdit"
});
Loading

0 comments on commit e2186d3

Please sign in to comment.