Skip to content

Commit

Permalink
Upgraded to 9.0.1 plus started on v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kjetilhau committed Aug 29, 2014
1 parent ecd10a4 commit e53b629
Show file tree
Hide file tree
Showing 18 changed files with 192 additions and 125 deletions.
5 changes: 5 additions & 0 deletions .meteor/.finished-upgraders
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file contains information which helps Meteor properly upgrade your
# app when you run 'meteor update'. You should check it into version control
# with your project.

notices-for-0.9.0
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

762i5q1rs9s2v1jmf92w
20 changes: 8 additions & 12 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
# but you can also edit it by hand.

standard-app-packages
autopublish
insecure

simple-schema
collection2
autoform
iron-router
roles
moment
less-fontawesome-4
less-bootstrap-3
iron-router-progress
blaze-layout
cmather:iron-router
alanning:roles
aldeed:simple-schema
aldeed:collection2
aldeed:autoform
manuelschoebel:less-fontawesome-4
manuelschoebel:less-bootstrap-3
mrt:bootstrap-3
2 changes: 1 addition & 1 deletion .meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.1.3
[email protected]
10 changes: 5 additions & 5 deletions client/lib/autoform_hooks.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
// Autoform hooks

AutoForm.hooks({
myFormId: {
documentForm: {
before: {
insert: function(doc) {},
update: function(docId, modifier) {},
remove: function(docId) {},
"methodName": function(doc) {}
},
after: {
insert: function(error, result, template) {},
update: function(error, result, template) {},
insert: function(error, result, template) { },
update: function(error, result, template) { },
remove: function(error, result, template) {},
"methodName": function(error, result, template) {}
},
onSubmit: function(insertDoc, updateDoc, currentDoc) {},

//called when any operation succeeds, where operation will be
//"insert", "update", "remove", or the method name.
onSuccess: function(operation, result, template) {},
onSuccess: function(operation, result, template) {},

//called when any operation fails, where operation will be
//"validation", "insert", "update", "remove", or the method name.
onError: function(operation, error, template) {},
formToDoc: function(doc) {},
docToForm: function(doc) {}
}
});
});
39 changes: 30 additions & 9 deletions client/routes/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ***************************************************************

Router.map(function() {

// DOCUMENTS INDEX
// -------------------------------------------------------
this.route('documentsIndex', {
Expand All @@ -14,22 +14,43 @@ Router.map(function() {
},
data: {
documents: function () {
return Documents.find({}, {sort: {title: 1}});
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('documentShow', this.params._id);
return Meteor.subscribe('document', this.params._id);
},
data: function () {
return Documents.findOne(this.params._id);
data: function () {
return Documents.findOne(this.params._id);
}
});

});

// 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);
}
});

});
4 changes: 4 additions & 0 deletions client/views/documents/document_edit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<template name="documentEdit">
<h2>Edit document</h2>
{{> quickForm collection="Documents" doc=this id="DocumentForm" type="update"}}
</template>
4 changes: 4 additions & 0 deletions client/views/documents/document_new.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<template name="documentNew">
<h2>Create document</h2>
{{> quickForm collection="Documents" id="DocumentForm" type="insert"}}
</template>
4 changes: 4 additions & 0 deletions client/views/documents/document_show.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<template name="documentShow">
<h2>{{title}}</h2>
<p>{{content}}</p>
</template>
18 changes: 12 additions & 6 deletions client/views/documents/documents_index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
<template name="documentsIndex">
<div class="row">
<div class="col-md-12">
<h1>Documents Index</h1>
<table class="table">
<h1>Documents</h1>
<a class="btn btn-primary" href="{{pathFor 'documentNew'}}" role="button">New document</a>
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Title</th>
<th>Content</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{{#each documents}}
<tr>
<td>{{_id}}</td>
<td>{{title}}</td>
<td><a href="{{pathFor 'documentShow'}}">{{title}}</a></td>
<td>{{content}}</td>
<td>
<a class="btn btn-xs btn-primary" href="{{pathFor 'documentEdit'}}" role="button">Edit</a>
<a class="btn btn-xs btn-danger" href="#" role="button">Delete</a>
</td>
</tr>
{{else}}
No documents
Expand All @@ -22,4 +28,4 @@ <h1>Documents Index</h1>
</table>
</div>
</div>
</template>
</template>
12 changes: 11 additions & 1 deletion client/views/pages/frontpage.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<template name="frontpage">
Frontpage
<div class="container">
<!-- Main component for a primary marketing message or call to action -->
<div class="jumbotron">
<h1>Meteor-skeleton</h1>
<p>This example is a quick exercise to illustrate how the default, static and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.</p>
<p>To see the difference between static and fixed top navbars, just scroll.</p>
<p>
<a class="btn btn-lg btn-primary" href="#" role="button">Button</a>
</p>
</div>
</div> <!-- /container -->
</template>
8 changes: 6 additions & 2 deletions client/views/shared/footer.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<template name="footer">
Footer
</template>
<div class="footer">
<div class="container">
<p class="text-muted">Footer</p>
</div>
</div>
</template>
27 changes: 25 additions & 2 deletions client/views/shared/header.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
<template name="header">
Header
</template>
<!-- Static navbar -->
<div class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{pathFor 'frontpage'}}">Meteor-skeleton</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="{{active 'frontpage'}}"><a href="{{pathFor 'frontpage'}}">Home</a></li>
<li class="{{active 'documentsIndex'}}"><a href="{{pathFor 'documentsIndex'}}">Documents</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="{{active 'frontpage'}}"><a href="#">About (static)</a></li>
<li><a href="#">Github</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</template>
5 changes: 5 additions & 0 deletions lib/collections/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Documents = new Meteor.Collection('documents', {
max: 120,
optional: false
},
content: {
type: String,
label: "Content",
optional: true
},
createdAt: {
type: Date,
optional: true,
Expand Down
15 changes: 9 additions & 6 deletions server/fixtures/documents.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
// Fixture data
// Fixture data
if (Documents.find().count() === 0) {

Documents.insert({
title: "Derp"
title: "Derp",
content: "Lorem ipsum, herp derp durr."
});

Documents.insert({
title: "Hurr"
title: "Hurr",
content: "Lorem ipsum, herp derp durr."
});

Documents.insert({
title: "Durr"
title: "Durr",
content: "Lorem ipsum, herp derp durr."
});

}
}
13 changes: 0 additions & 13 deletions smart.json

This file was deleted.

Loading

0 comments on commit e53b629

Please sign in to comment.