2017-03-18 16:04:27 +09:00
|
|
|
/*
|
|
|
|
|
|
|
|
A component to configure the "new movie" form.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2017-05-19 14:42:43 -06:00
|
|
|
import React from 'react';
|
2017-03-23 16:27:59 +09:00
|
|
|
import { Components, registerComponent, withCurrentUser, getFragment } from 'meteor/vulcan:core';
|
2017-03-18 16:04:27 +09:00
|
|
|
|
|
|
|
import Movies from '../../modules/movies/collection.js';
|
|
|
|
|
|
|
|
const MoviesNewForm = ({currentUser}) =>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
{Movies.options.mutations.new.check(currentUser) ?
|
|
|
|
<div style={{marginBottom: '20px', paddingBottom: '20px', borderBottom: '1px solid #ccc'}}>
|
|
|
|
<h4>Insert New Document</h4>
|
|
|
|
<Components.SmartForm
|
|
|
|
collection={Movies}
|
|
|
|
mutationFragment={getFragment('MoviesItemFragment')}
|
|
|
|
/>
|
|
|
|
</div> :
|
|
|
|
null
|
|
|
|
}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2017-10-06 08:49:36 +09:00
|
|
|
registerComponent('MoviesNewForm', MoviesNewForm, withCurrentUser);
|