Files: f1cc08ac986f18880000b780dae6fb2043e76948 / modules / avatar-profile.js
838 bytesRaw
1 | var h = require('hyperscript') |
2 | var pull = require('pull-stream') |
3 | var self_id = require('../keys') |
4 | var markdown = require('./helpers').markdown |
5 | var query = require('./scuttlebot').query |
6 | var avatar = require('./avatar') |
7 | |
8 | exports.gives = 'avatar_profile' |
9 | |
10 | exports.needs = {avatar_action: 'first'} |
11 | |
12 | exports.create = function (api) { |
13 | return function (id) { |
14 | |
15 | if (id == self_id.id) { |
16 | var edit = h('p', h('a', {href: '#Edit'}, h('button.btn.btn-primary', 'Edit profile'))) |
17 | } else { var edit = api.avatar_action(id)} |
18 | |
19 | var layout = h('div.column', |
20 | h('div.message', |
21 | h('div.avatar--profile', avatar.image(id, 'profile')), |
22 | h('a', {href: '#' + id}, avatar.name(id)), |
23 | avatar.loc(id), |
24 | avatar.description(id), |
25 | h('pre', h('code', id)), |
26 | edit |
27 | ) |
28 | ) |
29 | |
30 | return layout |
31 | } |
32 | } |
33 | |
34 |
Built with git-ssb-web