1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00

#12 Add FeatureForm for new Features

This commit is contained in:
andsandv 2014-10-23 14:30:02 +02:00
parent cc383eea2c
commit 97cd4c8704
2 changed files with 50 additions and 39 deletions

View File

@ -25,45 +25,6 @@
<div class="container">
<div id="content">Loading...</div>
</div>
<!--
This is the bootstrap form
<form class="form-horizontal">
<fieldset>
<legend>Add a new feature</legend>
<div class="control-group">
<label class="control-label" for="name">Name </label>
<div class="controls">
<input id="name" name="name" type="text" placeholder="Superfeature" class="input-large" required="">
<p class="help-block">Give the feature a name</p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="description">Description</label>
<div class="controls">
<input id="description" name="description" type="text" placeholder="It does this and that " class="input-large">
<p class="help-block">Describe the feature</p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="strategy">Strategy</label>
<div class="controls">
<select id="strategy" name="strategy" class="input-large">
<option>Default</option>
</select>
</div>
</div>
</fieldset>
</form>
-->
<script type="text/jsx" src="js/unleash.jsx"></script>
</body>
</html>

View File

@ -16,6 +16,55 @@
// Meny
// NewFeatureForm
var FeatureForm = React.createClass({
render: function () {
return (
<form className="form-horizontal">
<fieldset>
<legend>Add a new feature</legend>
<div className="control-group">
<label className="control-label" for="name">Name </label>
<div className="controls">
<input id="name" name="name" type="text"
placeholder="Superfeature" className="input-large" required="" />
<p className="help-block">Give the feature a name</p>
</div>
</div>
<div className="control-group">
<label className="control-label" for="description">Description</label>
<div className="controls">
<input id="description" name="description" type="text"
placeholder="It does this and that " className="input-large" />
<p className="help-block">Describe the feature</p>
</div>
</div>
<div className="control-group">
<label className="control-label" for="strategy">Strategy</label>
<div className="controls">
<select id="strategy" name="strategy" className="input-large">
<option>Default</option>
</select>
</div>
</div>
<div className="control-group">
<label className="control-label" for="submit"></label>
<div className="controls">
<button id="submit" name="submit" className="btn btn-success">Submit</button>
</div>
</div>
</fieldset>
</form>
);
}
});
var Feature = React.createClass({
// TODO: validate props?
handleEnableChange: function(event) {
@ -131,6 +180,7 @@ var FeatureList = React.createClass({
</div>
<div className='panel-body'>
{featureNodes}
<FeatureForm />
</div>
</div>
);