git ssb

10+

Matt McKegg / patchwork



Commit a11c9497d075ed6b8bda770c39ff3b83868c2451

about: get rid of extra padding on right for descriptions and images

Matt McKegg committed on 4/16/2017, 4:53:21 AM
Parent: d8b6f036c819308b37141732de65ca30cf12b966

Files changed

plugs/message/html/layout/mini.jschanged
plugs/message/html/render/about.jschanged
plugs/message/html/layout/mini.jsView
@@ -47,16 +47,17 @@
4747 return h('Message -mini', {classList}, [
4848 h('header', [
4949 h('div.mini', [
5050 api.profile.html.person(msg.value.author), ' ',
51- opts.content
51 + opts.miniContent
5252 ]),
5353 h('div.meta', {}, [
5454 api.message.html.meta(msg),
5555 api.message.html.timestamp(msg),
5656 additionalMeta
5757 ])
5858 ]),
59 + h('section', [opts.content]),
5960 footer
6061 ])
6162 }
6263 }
plugs/message/html/render/about.jsView
@@ -24,13 +24,15 @@
2424 if (!ref.isFeed(msg.value.content.about)) return
2525
2626 var c = msg.value.content
2727 var self = msg.value.author === c.about
28 +
29 + var miniContent = []
2830 var content = []
2931
3032 if (c.name) {
3133 var target = api.profile.html.person(c.about, c.name)
32- content.push(computed([self, api.about.obs.name(c.about), c.name], (self, a, b) => {
34 + miniContent.push(computed([self, api.about.obs.name(c.about), c.name], (self, a, b) => {
3335 if (self) {
3436 return ['self identifies as "', target, '"']
3537 } else if (a === b) {
3638 return ['identified ', api.profile.html.person(c.about)]
@@ -40,11 +42,11 @@
4042 }))
4143 }
4244
4345 if (c.image) {
44- if (!content.length) {
46 + if (!miniContent.length) {
4547 var imageAction = self ? 'self assigned a display image' : ['assigned a display image to ', api.profile.html.person(c.about)]
46- content.push(imageAction)
48 + miniContent.push(imageAction)
4749 }
4850
4951 content.push(h('a AboutImage', {
5052 href: c.about
@@ -54,11 +56,12 @@
5456 }
5557
5658 var elements = []
5759
58- if (content.length) {
60 + if (miniContent.length) {
5961 var element = api.message.html.layout(msg, extend({
6062 showActions: true,
63 + miniContent,
6164 content,
6265 layout: 'mini'
6366 }, opts))
6467 elements.push(api.message.html.decorate(element, { msg }))
@@ -66,12 +69,10 @@
6669
6770 if (c.description) {
6871 elements.push(api.message.html.decorate(api.message.html.layout(msg, extend({
6972 showActions: true,
70- content: [
71- self ? 'self assigned a description' : ['assigned a description to ', api.profile.html.person(c.about)],
72- api.message.html.markdown(c.description)
73- ],
73 + miniContent: self ? 'self assigned a description' : ['assigned a description to ', api.profile.html.person(c.about)],
74 + content: api.message.html.markdown(c.description),
7475 layout: 'mini'
7576 }, opts)), { msg }))
7677 }
7778

Built with git-ssb-web