From f1575bfffd5df77b68e60f36abc3bbdc6245d91f Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Tue, 28 Jul 2020 22:28:56 -0500 Subject: [UI, API, Rebase] Clean up original domain permissions API --- .../flavours/glitch/components/status_content.js | 37 +++++++++++++++++++ .../styles/monsterfork/components/status.scss | 42 ++++++++++++++++++++++ app/javascript/mastodon/locales/en-MP.json | 7 ++-- 3 files changed, 84 insertions(+), 2 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/components/status_content.js b/app/javascript/flavours/glitch/components/status_content.js index 171aff097..d3e7b8718 100644 --- a/app/javascript/flavours/glitch/components/status_content.js +++ b/app/javascript/flavours/glitch/components/status_content.js @@ -302,6 +302,39 @@ export default class StatusContent extends React.PureComponent { ); + const permissions_present = status.get('domain_permissions') && status.get('domain_permissions').size > 0; + + const status_permission_items = permissions_present && status.get('domain_permissions').map((permission) => ( +
  • + + {permission.get('domain')}, + visibility: {permission.get('visibility')}, + }} + /> +
  • + )); + + const permissions = status_permission_items && ( +
    + + + + + +
    + ); + const content = { __html: status.get('contentHtml') }; const spoilerContent = { __html: status.get('spoilerHtml') }; const directionStyle = { direction: 'ltr' }; @@ -383,6 +416,8 @@ export default class StatusContent extends React.PureComponent { {media} + {permissions} + ); } else if (parseClick) { @@ -405,6 +440,7 @@ export default class StatusContent extends React.PureComponent { tabIndex='0' /> {media} + {permissions} ); } else { @@ -419,6 +455,7 @@ export default class StatusContent extends React.PureComponent { {edited}
    {media} + {permissions}
    ); } diff --git a/app/javascript/flavours/glitch/styles/monsterfork/components/status.scss b/app/javascript/flavours/glitch/styles/monsterfork/components/status.scss index d950fdbb5..2759945a7 100644 --- a/app/javascript/flavours/glitch/styles/monsterfork/components/status.scss +++ b/app/javascript/flavours/glitch/styles/monsterfork/components/status.scss @@ -16,6 +16,48 @@ } } +.status__permissions { + font-size: 12px; + margin-top: 1em; + + & > summary { + font-size: 12px; + + &:focus, &:active { + outline: none; + } + } + + & > summary > span, + & > ul > li > span { + color: lighten($dark-text-color, 4%); + padding-left: 8px; + } + + & > ul > li > span > span:first-child { + display: inline-block; + text-transform: capitalize; + min-width: 5em; + } + + & > summary > i { + color: #999966; + } + + & > ul > li.permission-status > i { + color: #99cccc; + } + + & > ul > li.permission-account > i { + color: #cc99cc; + } + + & > ul > li > span > span, + & > ul > li > span > code { + color: lighten($dark-text-color, 30%); + } +} + .status, .detailed-status { &.unpublished { background: darken($ui-base-color, 4%); diff --git a/app/javascript/mastodon/locales/en-MP.json b/app/javascript/mastodon/locales/en-MP.json index 8544a0d1b..41445c538 100644 --- a/app/javascript/mastodon/locales/en-MP.json +++ b/app/javascript/mastodon/locales/en-MP.json @@ -122,6 +122,9 @@ "status.in_reply_to": "This roar is a reply", "status.is_poll": "This roar is a poll", "status.open": "Open this roar", + "status.permissions.title": "Show extended permissions...", + "status.permissions.visibility.status": "{visibility} 🡲 {domain}", + "status.permissions.visibility.account": "{visibility} 🡲 {domain}", "status.pinned": "Pinned", "status.publish": "Publish", "status.reblogs.empty": "No one has boosted this roar yet. When someone does, they will show up here.", @@ -133,7 +136,7 @@ "status.unpublished": "Unpublished", "tabs_bar.federated_timeline": "World", "timeline_hint.resources.statuses": "Older roars", - "trends.counter_by_accounts": "{count, plural, one {{counter} creature} other {{counter} creatures}} talking", + "trends.counter_by_accounts": "{count, plural, one {{counter} creature} other {{counter} creatures}} talking", "ui.beforeunload": "Your draft will be lost if you leave the web page.", "upload_form.edit": "Add description text", "upload_modal.edit_media": "Add description text", @@ -150,4 +153,4 @@ "keyboard_shortcuts.local": "to open Monsterpit timeline", "navigation_bar.community_timeline": "Monsterpit", "tabs_bar.local_timeline": "Monsterpit" -} \ No newline at end of file +} -- cgit