58 lines
2.0 KiB
JavaScript
58 lines
2.0 KiB
JavaScript
let m = require('mithril')
|
|
let user = require('../models/user')
|
|
|
|
var registerUser = {
|
|
view: function() {
|
|
return m('main.documentation', m('section', [
|
|
m('h1', 'Registrasi'),
|
|
m('form', {
|
|
onsubmit: function(e) {
|
|
e.preventDefault()
|
|
user.register()
|
|
}
|
|
}, m('.flex.four.grow', [
|
|
m('.fourth-600.full', m('input', {
|
|
type: 'text',
|
|
name: 'full_name',
|
|
placeholder: 'Nama Lengkap',
|
|
autocomplete: 'off',
|
|
oninput: m.withAttr('value', function(value) {
|
|
user.current.full_name = value
|
|
})
|
|
})),
|
|
m('.fourth-600.full', m('input', {
|
|
type: 'text',
|
|
name: 'username',
|
|
placeholder: 'Username',
|
|
maxlength: '25',
|
|
autocomplete: 'off',
|
|
oninput: m.withAttr('value', function(value) {
|
|
user.current.username = value
|
|
})
|
|
})),
|
|
m('.fourth-600.full', m('input', {
|
|
type: 'password',
|
|
name: 'password',
|
|
placeholder: 'Password',
|
|
oninput: m.withAttr('value', function(value) {
|
|
user.current.password = value
|
|
})
|
|
})),
|
|
m('.fourth-600.none'),
|
|
m('div', m('button.pseudo.three-fourth-600.full', {
|
|
type: 'submit'
|
|
}, [
|
|
m('i.fa.fa-plus-circle.fa-fw', {
|
|
'aria-hidden': 'true'
|
|
}),
|
|
m('span', {
|
|
style: 'font-size: smaller;'
|
|
}, 'Register')
|
|
]))
|
|
]))
|
|
]))
|
|
}
|
|
}
|
|
|
|
module.exports = registerUser
|