git ssb

2+

Dominic / yap



Commit 2bdea09bfa5aa1c86ea50f737a7ed53b700db989

public view contains compose link

Dominic Tarr committed on 2/23/2019, 12:33:57 AM
Parent: 4090021c2ac60ff68c0c80ab6323e98240256b73

Files changed

apis/public.jschanged
apis/public.jsView
@@ -32,9 +32,10 @@
3232 return o
3333 }
3434
3535 module.exports = function (sbot) {
36- return function (opts, apply) {
36 + return function (opts, apply, req) {
37 + var tr = require('../translations')(req.cookies.lang)
3738 var self = this
3839 opts.reverse = opts.reverse !== false
3940 // var min = !isNaN(+opts.lt) ? +opts.lt : Date.now()
4041 // var max = !isNaN(+opts.gt) ? +opts.gt : 0
@@ -83,9 +84,8 @@
8384 if(opts.author)
8485 nav_opts.author = opts.author
8586
8687 var nav = ['span',
87- '<< ',
8888 opts.author ?
8989 apply('avatar', {
9090 id: opts.author,
9191 name: true,
@@ -98,18 +98,28 @@
9898 gt: max
9999 })),
100100 title: new Date(max).toString()
101101 },
102- niceAgo(Date.now(), max)
102 + '<< ',
103 + niceAgo(Date.now(), max)
103104 ], ' + ',
104105 ['a', {
105106 href: toUrl(type, merge(nav_opts, {
106107 lt: min
107108 })),
108109 title: new Date(max).toString()
109110 },
110- niceAgo(Date.now(), min)],
111- ' >>'
111 + niceAgo(Date.now(), min),
112 + ' >>'
113 + ],
114 + ' ',
115 + ['a',
116 + {
117 + href: toUrl('compose', {private: opts.private, content: {channel: opts.channel}}),
118 + title: new Date(max).toString()
119 + },
120 + tr('Compose')
121 + ]
112122 ]
113123 ary.unshift(nav)
114124 ary.push(nav)
115125 cb(null, h('div.' + Type,
@@ -125,4 +135,5 @@
125135 )
126136 }
127137 }
128138 }
139 +

Built with git-ssb-web