don't bump version after all, more readme work

This commit is contained in:
Sacha Greif 2016-04-07 16:05:40 +09:00
parent 1e4f732082
commit 7316b25e74
3 changed files with 48 additions and 2 deletions

View file

@ -89,7 +89,7 @@ nova:core@0.25.7
nova:email@0.25.7
nova:embedly@0.25.7
nova:events@0.25.7
nova:forms@0.25.8
nova:forms@0.25.7
nova:getting-started@0.25.7
nova:i18n@0.25.7
nova:lib@0.25.7

View file

@ -22,6 +22,52 @@ This package can generate new document and edit document forms from a [SimpleSch
### Usage
Example schema:
```js
import BodyFormControl from './components/BodyFormControl.jsx';
const isLoggedIn = (user) => !!user;
const isOwner = (user, document) => user._id === document.userId;
const isAdmin = (user) => user.isAdmin;
const PostsSchema = new SimpleSchema({
postedAt: {
type: Date,
optional: true
// no insertableIf or editableIf means this field won't appear in forms
},
title: {
type: String,
optional: false,
max: 500,
insertableIf: isLoggedIn,
editableIf: isOwner,
control: "text",
order: 1
},
body: {
type: String,
optional: true,
max: 3000,
insertableIf: isLoggedIn,
editableIf: isOwner,
control: BodyFormControl,
order: 2
},
sticky: {
type: Boolean,
optional: true,
defaultValue: false,
insertableIf: isAdmin,
editableIf: isAdmin,
control: "checkbox",
order: 3
},
}
```
New document form:
```jsx

View file

@ -1,7 +1,7 @@
Package.describe({
name: "nova:forms",
summary: "Form containers for React",
version: "0.25.8",
version: "0.25.7",
git: "https://github.com/meteor-utilities/react-form-containers.git"
});