2016-04-15 11:11:13 +09:00
|
|
|
import React, { PropTypes, Component } from 'react';
|
2016-06-09 17:42:20 +09:00
|
|
|
import { FormattedMessage, intlShape } from 'react-intl';
|
2016-04-15 11:11:13 +09:00
|
|
|
import NovaForm from "meteor/nova:forms";
|
2016-06-06 10:06:53 +09:00
|
|
|
import { DocumentContainer } from "meteor/utilities:react-list-container";
|
2016-05-22 15:23:30 +09:00
|
|
|
import { Messages } from "meteor/nova:core";
|
2016-04-15 11:11:13 +09:00
|
|
|
|
|
|
|
class SettingsEditForm extends Component{
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
|
|
|
return (
|
2016-04-19 15:45:36 +09:00
|
|
|
<div className="settings-edit-form">
|
2016-06-09 17:42:20 +09:00
|
|
|
<p><FormattedMessage id="settings.json_message"/></p>
|
2016-04-15 11:11:13 +09:00
|
|
|
<DocumentContainer
|
|
|
|
collection={Telescope.settings.collection}
|
|
|
|
publication="settings.admin"
|
|
|
|
selector={{}}
|
|
|
|
terms={{}}
|
|
|
|
component={NovaForm}
|
|
|
|
componentProps={{
|
|
|
|
// note: the document prop will be passed from DocumentContainer
|
|
|
|
collection: Telescope.settings.collection,
|
|
|
|
currentUser: this.context.currentUser,
|
|
|
|
methodName: "settings.edit",
|
2016-04-21 15:08:43 +09:00
|
|
|
successCallback: (category) => {
|
2016-06-09 17:42:20 +09:00
|
|
|
Messages.flash(this.context.intl.formatMessage({id: "settings.edited"}), "success");
|
|
|
|
}
|
2016-04-15 11:11:13 +09:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SettingsEditForm.contextTypes = {
|
2016-06-09 17:42:20 +09:00
|
|
|
currentUser: React.PropTypes.object,
|
|
|
|
intl: intlShape
|
2016-04-15 11:11:13 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = SettingsEditForm;
|
|
|
|
export default SettingsEditForm;
|