Added custom notification
This commit is contained in:
23
assets/js/components/label.js
Normal file
23
assets/js/components/label.js
Normal file
@@ -0,0 +1,23 @@
|
||||
let m = require('mithril')
|
||||
let fadeOutEffect = require('../others/fadeOutEffect')
|
||||
|
||||
module.exports = {
|
||||
view: function() {
|
||||
return m('.label.top', {
|
||||
style: {
|
||||
position: 'fixed',
|
||||
top: '15px',
|
||||
fontSize: 'small',
|
||||
margin: '0 35%',
|
||||
left: '0',
|
||||
right: '0',
|
||||
overflowY: 'auto',
|
||||
maxWidth: '100%',
|
||||
maxHeight: '100%'
|
||||
},
|
||||
onclick: function() {
|
||||
fadeOutEffect.fade(this)
|
||||
}
|
||||
}, window.message)
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ var listAdmin = {
|
||||
m('em', [
|
||||
pengumuman.creatorName,
|
||||
' - ',
|
||||
fecha.format(fecha.parse(pengumuman.valid_at, 'YYYY-MM-DD H:i:s'), 'DD/MM/YYYY')
|
||||
fecha.format(fecha.parse(pengumuman.created_at, 'YYYY-MM-DD H:i:s'), 'DD/MM/YYYY')
|
||||
])
|
||||
]),
|
||||
m('span.stack', {style:'color:' + pengumuman.foreground + '; overflow-y: auto;'}, m.trust(marked(pengumuman.content))),
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
let m = require('mithril')
|
||||
let _ = require('lodash')
|
||||
let user = require('../models/user')
|
||||
let fadeOutEffect = require('../others/fadeOutEffect')
|
||||
|
||||
var login = {
|
||||
view: function() {
|
||||
@@ -18,7 +20,8 @@ var login = {
|
||||
maxlength: '25',
|
||||
autocomplete: 'off',
|
||||
oninput: m.withAttr('value', function(value) {user.current.username = value}),
|
||||
value: user.current.username
|
||||
value: user.current.username,
|
||||
required: 'required'
|
||||
})),
|
||||
m('.fourth-600.full', m('input', {
|
||||
type: 'password',
|
||||
@@ -27,18 +30,32 @@ var login = {
|
||||
oninput: m.withAttr('value', function(value) {
|
||||
user.current.password = value
|
||||
}),
|
||||
value: user.current.password
|
||||
value: user.current.password,
|
||||
required: 'required'
|
||||
})),
|
||||
m('.fourth-600.none'),
|
||||
m('.fourth-600.none'),
|
||||
m('div', m('button.half-600.full.pseudo', {
|
||||
m('.half-600.full', m('button.full.pseudo', {
|
||||
type: 'submit'
|
||||
}, [
|
||||
m('i.fa.fa-check.fa-fw'),
|
||||
m('span', {
|
||||
style: 'font-size:smaller;'
|
||||
}, 'Masuk')
|
||||
]))
|
||||
])),
|
||||
m('.fourth-600.none'),
|
||||
m('.fourth-600.none'),
|
||||
_.isNil(window.message) == false ? [
|
||||
m('.half-600.full.label.error', {
|
||||
style: 'margin: 0; font-size: smaller;',
|
||||
onclick: function() {
|
||||
window.message = null
|
||||
}
|
||||
}, window.message),
|
||||
m('.fourth-600.none'),
|
||||
m('.fourth-600.none')
|
||||
]
|
||||
: null
|
||||
])
|
||||
]))
|
||||
}
|
||||
|
||||
@@ -18,7 +18,8 @@ var registerUser = {
|
||||
autocomplete: 'off',
|
||||
oninput: m.withAttr('value', function(value) {
|
||||
user.current.full_name = value
|
||||
})
|
||||
}),
|
||||
required: 'required'
|
||||
})),
|
||||
m('.fourth-600.full', m('input', {
|
||||
type: 'text',
|
||||
@@ -28,7 +29,8 @@ var registerUser = {
|
||||
autocomplete: 'off',
|
||||
oninput: m.withAttr('value', function(value) {
|
||||
user.current.username = value
|
||||
})
|
||||
}),
|
||||
required: 'required'
|
||||
})),
|
||||
m('.fourth-600.full', m('input', {
|
||||
type: 'password',
|
||||
@@ -36,7 +38,8 @@ var registerUser = {
|
||||
placeholder: 'Password',
|
||||
oninput: m.withAttr('value', function(value) {
|
||||
user.current.password = value
|
||||
})
|
||||
}),
|
||||
required: 'required'
|
||||
})),
|
||||
m('.fourth-600.none'),
|
||||
m('div', m('button.pseudo.three-fourth-600.full', {
|
||||
|
||||
Reference in New Issue
Block a user