Skip to content

Commit 1e6454d

Browse files
Tweaks and cleanups
1 parent 93c9269 commit 1e6454d

File tree

14 files changed

+28
-58
lines changed

14 files changed

+28
-58
lines changed

app/client/main.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,3 @@ import '/imports/api/stuff';
44
import '/imports/ui/layouts';
55
import '/imports/ui/pages';
66
import '/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;

app/imports/api/stuff/stuff.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Mongo } from 'meteor/mongo';
22
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
33

4-
/* eslint-disable object-shorthand, prefer-arrow-callback */
4+
/* eslint-disable object-shorthand */
55

66
export const stuff = 'Stuff'; // avoid typos, this string occurs three times.
77
export const Stuff = new Mongo.Collection(stuff);

app/imports/startup/client/router.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff 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-

app/imports/startup/server/stuff.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { Stuff } from '../../api/stuff/stuff.js';
22
import { _ } from 'meteor/underscore';
33

4-
/* eslint-disable prefer-arrow-callback */
5-
64
/**
75
* A list of Stuff to pre-fill the Collection.
86
* @type {*[]}

app/imports/ui/layouts/app-body.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { Template } from 'meteor/templating';
22

3-
/* eslint-disable prefer-arrow-callback */
4-
53
Template.App_Body.onCreated(function appBodyOnCreated() {
64
// placeholder: typically you will put global subscriptions here if you remove the autopublish package.
75
});

app/imports/ui/layouts/if-logged-in.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
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>

app/imports/ui/pages/add-stuff-page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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"

app/imports/ui/pages/add-stuff-page.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { AutoForm } from 'meteor/aldeed:autoform';
22
import { 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+
});

app/imports/ui/pages/edit-stuff-page.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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>

app/imports/ui/pages/edit-stuff-page.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ AutoForm.hooks({
2323
});
2424

2525
Template.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

0 commit comments

Comments
 (0)