git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Tree: ff719d8d11108e133fbe0b77d5e7229f2412dd3e

Files: ff719d8d11108e133fbe0b77d5e7229f2412dd3e / 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