2016-04-15 11:11:13 +09:00
|
|
|
import React, { PropTypes, Component } from 'react';
|
|
|
|
import NovaForm from "meteor/nova:forms";
|
|
|
|
|
|
|
|
import SmartContainers from "meteor/utilities:react-list-container";
|
|
|
|
const DocumentContainer = SmartContainers.DocumentContainer;
|
|
|
|
|
|
|
|
import Core from "meteor/nova:core";
|
|
|
|
const Messages = Core.Messages;
|
|
|
|
|
|
|
|
class SettingsEditForm extends Component{
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
|
|
|
return (
|
2016-04-19 15:45:36 +09:00
|
|
|
<div className="settings-edit-form">
|
2016-04-15 15:42:14 +09:00
|
|
|
<p>Note: settings already provided in your <code>settings.json</code> file will be disabled.</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-04-15 11:11:13 +09:00
|
|
|
Messages.flash("Settings edited (please reload).", "success");
|
|
|
|
},
|
|
|
|
labelFunction: fieldName => Telescope.utils.getFieldLabel(fieldName, Telescope.settings.collection)
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SettingsEditForm.contextTypes = {
|
|
|
|
currentUser: React.PropTypes.object
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = SettingsEditForm;
|
|
|
|
export default SettingsEditForm;
|