git ssb

10+

Matt McKegg / patchwork



Commit 5abb67e92e0a7e62bca89816bcd2e6de98f565a3

continue work on post visibility warnings

- coloured backgrounds on warning messages
- display number of recps on private messages
Matt McKegg committed on 7/9/2018, 8:10:59 AM
Parent: 36bc8a5bc0831af40becbbabceb854e88650af06

Files changed

locales/en.jsonchanged
modules/message/sheet/preview.jschanged
modules/sheet/display.jschanged
styles/dark/compose.mcsschanged
styles/dark/sheet.mcsschanged
styles/light/sheet.mcsschanged
locales/en.jsonView
@@ -210,12 +210,19 @@
210210 "OK": "OK",
211211 "You have not made any changes.": "You have not made any changes.",
212212 "Nothing to publish": "Nothing to publish",
213213 "Edit Gathering": "Edit Gathering",
214- "Only visible to you and people that have been mentioned": "Only visible to you and people that have been mentioned",
215- "Only visible to you and other thread participants": "Only visible to you and other thread participants",
216214 "This message will be public and cannot be edited or deleted": "This message will be public and cannot be edited or deleted",
217215 "This message will be public and can be edited by anyone": "This message will be public and can be edited by anyone",
216+ "Only visible to you and %s people that have been mentioned": {
217+ "one": "Only visible to you and one person that has been mentioned",
218+ "other": "Only visible to you and %s people that have been mentioned"
219+ },
220+ "Only visible to you and %s other thread participants": {
221+ "one": "Only visible to you and one other thread participant",
222+ "other": "Only visible to you and %s other thread participants"
223+ },
224+ "This message will only be visible to you": "This message will only be visible to you",
218225 "Show details": "Show details",
219226 "Hide details": "Hide details",
220227 "%s people": {
221228 "one": "%s person",
modules/message/sheet/preview.jsView
@@ -5,34 +5,41 @@
55 exports.needs = nest({
66 'sheet.display': 'first',
77 'message.html.render': 'first',
88 'intl.sync.i18n': 'first',
9+ 'intl.sync.i18n_n': 'first',
910 'emoji.sync.url': 'first'
1011 })
1112
1213 exports.gives = nest('message.sheet.preview')
1314
1415 exports.create = function (api) {
1516 const i18n = api.intl.sync.i18n
17+ const plural = api.intl.sync.i18n_n
18+
1619 return nest('message.sheet.preview', function (msg, cb) {
1720 api.sheet.display(function (close) {
1821 var isPrivate = msg.value.private
1922 var isRoot = !msg.value.content.root
23+ var recps = (msg.value.content.recps || []).filter(id => id !== msg.value.author)
2024 return {
2125 content: [
2226 api.message.html.render(msg)
2327 ],
28+ classList: [
29+ when(isPrivate, '-private', '-public')
30+ ],
2431 footer: [
2532 when(isPrivate,
2633 h('img', {src: api.emoji.sync.url('closed_lock_with_key')}),
2734 h('img', {src: api.emoji.sync.url('globe_with_meridians')})
2835 ),
2936 when(isPrivate,
3037 h('div.info -private', [
31- when(isRoot,
32- i18n('Only visible to you and people that have been mentioned'),
33- i18n('Only visible to you and other thread participants')
34- )
38+ recps.length ? when(isRoot,
39+ plural('Only visible to you and %s people that have been mentioned', recps.length),
40+ plural('Only visible to you and %s other thread participants', recps.length)
41+ ) : i18n('This message will only be visible to you')
3542 ]),
3643 h('div.info -public', [
3744 when(msg.publicallyEditable,
3845 i18n('This message will be public and can be edited by anyone'),
modules/sheet/display.jsView
@@ -4,11 +4,11 @@
44 exports.gives = nest('sheet.display')
55
66 exports.create = function () {
77 return nest('sheet.display', function (handler) {
8- var {content, footer} = handler(done)
8+ var {content, footer, classList} = handler(done)
99
10- var container = h('div', {className: 'Sheet'}, [
10+ var container = h('div', {className: 'Sheet', classList}, [
1111 h('section', [content]),
1212 h('footer', [footer])
1313 ])
1414
styles/dark/compose.mcssView
@@ -108,9 +108,9 @@
108108 }
109109
110110 button {
111111 :hover {
112- background: #6f74e5
112+ background: #e56f6f
113113 }
114114 -private {
115115 :hover {
116116 background: #ceab2f
styles/dark/sheet.mcssView
@@ -14,8 +14,21 @@
1414 display: flex
1515 flex-direction: column
1616 z-index: 50
1717
18+ -private {
19+ footer {
20+ border-color: #5b56b3
21+ background-color: #372a56
22+ }
23+ }
24+
25+ -public {
26+ footer {
27+ background-color: #4a3232
28+ }
29+ }
30+
1831 section {
1932 overflow-y: auto
2033 flex: 1
2134 }
styles/light/sheet.mcssView
@@ -15,8 +15,21 @@
1515 display: flex
1616 flex-direction: column
1717 z-index: 50
1818
19+ -private {
20+ footer {
21+ background-color: #fffbf4
22+ }
23+ }
24+
25+ -public {
26+ footer {
27+ border-color: #c7c3ff;
28+ background-color: #f4f4fd;
29+ }
30+ }
31+
1932 section {
2033 overflow-y: auto
2134 flex: 1
2235 }

Built with git-ssb-web