Files: ff719d8d11108e133fbe0b77d5e7229f2412dd3e / modules / page / html / render / gatherings.js
802 bytesRaw
1 | var { h } = require('mutant') |
2 | var nest = require('depnest') |
3 | |
4 | exports.needs = nest({ |
5 | 'feed.pull.type': 'first', |
6 | 'feed.html.rollup': 'first', |
7 | 'gathering.sheet.edit': 'first' |
8 | }) |
9 | |
10 | exports.gives = nest('page.html.render') |
11 | |
12 | exports.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