48 lines
1.5 KiB
JavaScript
48 lines
1.5 KiB
JavaScript
let m = require('mithril')
|
|
let user = require('../models/user')
|
|
|
|
var login = {
|
|
view: function() {
|
|
return m('section', m('form', {
|
|
onsubmit: function(e) {
|
|
e.preventDefault()
|
|
user.login()
|
|
}
|
|
}, [
|
|
m('h1', 'Masuk'),
|
|
m('.flex.four.grow', [
|
|
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}),
|
|
value: user.current.username
|
|
})),
|
|
m('.fourth-600.full', m('input', {
|
|
type: 'password',
|
|
name: 'password',
|
|
placeholder: 'Password',
|
|
oninput: m.withAttr('value', function(value) {
|
|
user.current.password = value
|
|
}),
|
|
value: user.current.password
|
|
})),
|
|
m('.fourth-600.none'),
|
|
m('.fourth-600.none'),
|
|
m('div', m('button.half-600.full.pseudo', {
|
|
type: 'submit'
|
|
}, [
|
|
m('i.fa.fa-check.fa-fw'),
|
|
m('span', {
|
|
style: 'font-size:smaller;'
|
|
}, 'Masuk')
|
|
]))
|
|
])
|
|
]))
|
|
}
|
|
}
|
|
|
|
module.exports = login
|