File tree Expand file tree Collapse file tree 14 files changed +28
-58
lines changed
Expand file tree Collapse file tree 14 files changed +28
-58
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,3 @@ import '/imports/api/stuff';
44import '/imports/ui/layouts' ;
55import '/imports/ui/pages' ;
66import '/imports/ui/stylesheets/style.css' ;
7-
8- // The following is a hack for autoform. Remove it once autoform is removed.
9- import { Stuff } from '../imports/api/stuff/stuff.js' ;
10- window . Stuff = Stuff ;
Original file line number Diff line number Diff line change 11import { Mongo } from 'meteor/mongo' ;
22import { SimpleSchema } from 'meteor/aldeed:simple-schema' ;
33
4- /* eslint-disable object-shorthand, prefer-arrow-callback */
4+ /* eslint-disable object-shorthand */
55
66export const stuff = 'Stuff' ; // avoid typos, this string occurs three times.
77export const Stuff = new Mongo . Collection ( stuff ) ;
Original file line number Diff line number Diff line change @@ -39,36 +39,3 @@ FlowRouter.notFound = {
3939 BlazeLayout . render ( 'App_Body' , { main : 'App_Not_Found' } ) ;
4040 } ,
4141} ;
42-
43- /**
44- // * Configure Iron Router.
45- // * See: http://iron-meteor.github.io/iron-router/
46- // */
47- //
48- // /* eslint-disable object-shorthand, prefer-arrow-callback */
49- //
50- // Router.configure({
51- // layoutTemplate: 'Layout',
52- // loadingTemplate: 'Loading',
53- // });
54- //
55- // // waitOn: function waitOn() { return Meteor.subscribe('Stuff'); },
56- //
57- // Router.route('/', {
58- // name: 'Home',
59- // });
60- //
61- // Router.route('/list', {
62- // name: 'ListStuff',
63- // });
64- //
65- // Router.route('/add', {
66- // name: 'AddStuff',
67- // });
68- //
69- //
70- // Router.route('/stuff/:_id', {
71- // name: 'EditStuff',
72- // data: function editStuff() { return Stuff.findOne(this.params._id); },
73- // });
74-
Original file line number Diff line number Diff line change 11import { Stuff } from '../../api/stuff/stuff.js' ;
22import { _ } from 'meteor/underscore' ;
33
4- /* eslint-disable prefer-arrow-callback */
5-
64/**
75 * A list of Stuff to pre-fill the Collection.
86 * @type {*[] }
Original file line number Diff line number Diff line change 11import { Template } from 'meteor/templating' ;
22
3- /* eslint-disable prefer-arrow-callback */
4-
53Template . App_Body . onCreated ( function appBodyOnCreated ( ) {
64 // placeholder: typically you will put global subscriptions here if you remove the autopublish package.
75} ) ;
Original file line number Diff line number Diff line change 55 {{#if canShow}}
66 {{> UI.contentBlock }}
77 {{else}}
8- < p > You are not authorized to view this page.</ p >
9- < p > Please login.</ p >
8+ < div style ="padding-top: 40px " class ="ui text container ">
9+ < p > You are not authorized to view this page.</ p >
10+ < p > Please login.</ p >
11+ </ div >
1012 {{/if}}
1113 {{/if}}
1214</ template >
Original file line number Diff line number Diff line change 11< template name ="Add_Stuff_Page ">
22 {{#If_Logged_In}}
3- < div style ="padding-top: 40px " class ="ui text container ">
3+ < div style ="padding-top: 20px " class ="ui text container ">
44 {{> quickForm
5- collection="Stuff"
5+ collection=stuffCollection
66 template="semanticUI"
77 id="AddStuffForm"
88 type="insert"
Original file line number Diff line number Diff line change 11import { AutoForm } from 'meteor/aldeed:autoform' ;
22import { FlowRouter } from 'meteor/kadira:flow-router' ;
3+ import { Template } from 'meteor/templating' ;
4+ import { Stuff } from '../../api/stuff/stuff.js' ;
35
46/* eslint-disable object-shorthand, no-unused-vars */
57
@@ -19,3 +21,9 @@ AutoForm.hooks({
1921 } ,
2022 } ,
2123} ) ;
24+
25+ Template . Add_Stuff_Page . helpers ( {
26+ stuffCollection ( ) {
27+ return Stuff ;
28+ } ,
29+ } ) ;
Original file line number Diff line number Diff line change 11< template name ="Edit_Stuff_Page ">
22 {{#If_Logged_In}}
3- < div style ="padding-top: 40px " class ="ui text container ">
3+ < div style ="padding-top: 20px " class ="ui text container ">
44 {{> quickForm
5- collection="Stuff"
5+ collection=stuffCollection
66 template="semanticUI"
77 id="EditStuffForm"
88 type="update"
9- doc=doc
9+ doc=getDoc
1010 buttonContent="Update"
1111 }}
1212 </ div >
Original file line number Diff line number Diff line change @@ -23,9 +23,11 @@ AutoForm.hooks({
2323} ) ;
2424
2525Template . Edit_Stuff_Page . helpers ( {
26- doc : function getDoc ( ) {
26+ getDoc ( ) {
2727 return Stuff . findOne ( FlowRouter . getParam ( '_id' ) ) ;
2828 } ,
29-
29+ stuffCollection ( ) {
30+ return Stuff ;
31+ } ,
3032} ) ;
3133
You can’t perform that action at this time.
0 commit comments