Files: c10d83fd944362efc0d54d087976db89b74d48bc / render.js
967 bytesRaw
1 | module.exports = function (apply, gathering) { |
2 | var attending = {} |
3 | gathering.value.attendee.forEach(function (attendee) { |
4 | if(attendee.link) attending[attendee.link] = true |
5 | if(attendee.remove) delete attending[attendee.link] |
6 | }) |
7 | var gth = gathering.value |
8 | var epoch = gth.startDateTime && gth.startDateTime.epoch |
9 | var tz = epoch && epoch.tz |
10 | return ['div.Gathering', |
11 | apply('avatar', {id: gathering.creator, name: true, image: true}),' ', |
12 | ['h1', |
13 | ['a', |
14 | {href: apply.toUrl('gatherings/event', {id:gathering.root})}, |
15 | gth.title |
16 | ] |
17 | ], |
18 | ['h2', {title: tz}, new Date(epoch).toString()], |
19 | ['p', gathering.value.description], |
20 | gathering.value.image |
21 | ? ['img', {href: 'http://localhost:8989/blobs/get/'+encodeURIComponent(gathering.value.image.link)}] |
22 | : '', |
23 | ['div.Attending', |
24 | 'attending:', |
25 | Object.keys(attending).map(function (id) { |
26 | return apply('avatar', id) |
27 | }) |
28 | ] |
29 | ] |
30 | } |
31 | |
32 |
Built with git-ssb-web