git ssb

10+

Matt McKegg / patchwork



Tree: 6975c466bb35703e5c76fdd5fef5a2d91e216d4b

Files: 6975c466bb35703e5c76fdd5fef5a2d91e216d4b / modules / page / html / render / gatherings.js

802 bytesRaw
1var { h } = require('mutant')
2var nest = require('depnest')
3
4exports.needs = nest({
5 'feed.pull.type': 'first',
6 'feed.html.rollup': 'first',
7 'gathering.sheet.edit': 'first'
8})
9
10exports.gives = nest('page.html.render')
11
12exports.create = function (api) {
13 return nest('page.html.render', function channel (path) {
14 if (path !== '/gatherings') return
15
16 var prepend = [
17 h('PageHeading', [
18 h('h1', [h('strong', 'Gatherings'), ' from your extended network']),
19 h('div.meta', [
20 h('button -add', {
21 'ev-click': createGathering
22 }, '+ Add Gathering')
23 ])
24 ])
25 ]
26
27 return api.feed.html.rollup(api.feed.pull.type('gathering'), { prepend, windowSize: 100 })
28 })
29
30 function createGathering () {
31 api.gathering.sheet.edit()
32 }
33}
34

Built with git-ssb-web