Basic add-contrib form
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
|
||||
id: null,
|
||||
realName: null,
|
||||
address: null,
|
||||
|
||||
classId: function() {
|
||||
let value = this.get('id');
|
||||
return (Ember.isEmpty(value)) ? null : 'valid';
|
||||
}.property('id'),
|
||||
|
||||
classRealName: function() {
|
||||
let value = this.get('realName');
|
||||
return (Ember.isEmpty(value)) ? null : 'valid';
|
||||
}.property('realName'),
|
||||
|
||||
classAddress: function() {
|
||||
let value = this.get('address');
|
||||
return (Ember.isEmpty(value)) ? null : 'valid';
|
||||
}.property('address'),
|
||||
|
||||
|
||||
actions: {
|
||||
|
||||
save() {
|
||||
console.log('id', this.get('id'));
|
||||
console.log('realName', this.get('realName'));
|
||||
console.log('address', this.get('address'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
<form {{action "save" on="submit"}}>
|
||||
<p>
|
||||
{{input name="id"
|
||||
type="text"
|
||||
placeholder="GitHub UID (123)"
|
||||
value=id
|
||||
class=classId}}
|
||||
</p>
|
||||
<p>
|
||||
{{input name="realname"
|
||||
type="text"
|
||||
placeholder="Carl Sagan"
|
||||
value=realName
|
||||
class=classRealName}}
|
||||
</p>
|
||||
<p>
|
||||
{{input name="address"
|
||||
type="text"
|
||||
placeholder="0xF18E631Ea191aE4ebE70046Fcb01a436554421BA4"
|
||||
value=address
|
||||
class=classAddress}}
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit" value="Save">
|
||||
</p>
|
||||
</form>
|
||||
Reference in New Issue
Block a user