nfp_sites/app/widgets/newsentry.js

23 lines
589 B
JavaScript
Raw Normal View History

2019-09-13 13:33:10 +00:00
const m = require('mithril')
const Newsentry = {
view: function(vnode) {
return m('newsentry', [
vnode.attrs.media
? m('a.cover', {
href: vnode.attrs.media.large_url,
}, m('img', { src: vnode.attrs.media.small_url }))
: m('a.cover.nobg'),
m('div.entrycontent', [
m(m.route.Link,
{ href: '/article/' + vnode.attrs.path },
m('h3', vnode.attrs.name)
),
m('div.entrymeta', 'Posted ' + vnode.attrs.created_at.replace('T', ' ').split('.')[0])
])
])
},
}
module.exports = Newsentry