summaryrefslogtreecommitdiffstats
path: root/web/react/components/setting_item_max.jsx
blob: d3d386534f8b25b270dcda2cd5b1d50d37291c86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.

module.exports = React.createClass({
    render: function() {
        var clientError = this.props.clientError ? <div className='form-group'><label className='col-sm-12 has-error'>{ this.props.clientError }</label></div> : null;
        var server_error = this.props.server_error ? <div className='form-group'><label className='col-sm-12 has-error'>{ this.props.server_error }</label></div> : null;

        var inputs = this.props.inputs;

        return (
            <ul className="section-max form-horizontal">
                <li className="col-sm-12 section-title">{this.props.title}</li>
                <li className="col-sm-9 col-sm-offset-3">
                    <ul className="setting-list">
                        <li className="setting-list-item">
                            {inputs}
                        </li>
                        <li className="setting-list-item">
                            <hr />
                            { server_error }
                            { clientError }
                            { this.props.submit ? <a className="btn btn-sm btn-primary" onClick={this.props.submit}>Submit</a> : "" }
                            <a className="btn btn-sm theme" href="#" onClick={this.props.updateSection}>Cancel</a>
                        </li>
                    </ul>
                </li>
            </ul>
        );
    }
});