diff options
author | 2023-01-25 18:06:41 +0100 | |
---|---|---|
committer | 2023-01-25 18:06:41 +0100 | |
commit | 17eecfb6d9f50821d7822d60fa4135d59ea5ca57 (patch) | |
tree | 26796a658eb1b05e27c34ec23c2fc8030ffb4458 /web | |
parent | [feature] Accept incoming federated Flag activity (#1382) (diff) | |
download | gotosocial-17eecfb6d9f50821d7822d60fa4135d59ea5ca57.tar.xz |
[feature] Public list of suspended domains (#1362)
* basic rendered domain blocklist (unauthenticated!)
* style basic domain block list
* better formatting for domain blocklist
* add opt-in config option for showing suspended domains
* format/linter
* re-use InstancePeersGet for web-accessible domain blocklist
* reword explanation, border styling
* always attach blocklist handler, update error message
* domain blocklist error message grammar
Diffstat (limited to 'web')
-rw-r--r-- | web/source/css/_colors.css | 6 | ||||
-rw-r--r-- | web/source/css/base.css | 76 | ||||
-rw-r--r-- | web/source/settings/style.css | 47 | ||||
-rw-r--r-- | web/template/domain-blocklist.tmpl | 51 |
4 files changed, 132 insertions, 48 deletions
diff --git a/web/source/css/_colors.css b/web/source/css/_colors.css index 13a75c9f5..6d4b056b8 100644 --- a/web/source/css/_colors.css +++ b/web/source/css/_colors.css @@ -114,6 +114,6 @@ $settings-nav-bg-active: $gray2; $error-fg: $error1; $error-bg: $error2; -$settings-entry-bg: $gray2; -$settings-entry-alternate-bg: $gray3; -$settings-entry-hover-bg: $gray4;
\ No newline at end of file +$list-entry-bg: $gray2; +$list-entry-alternate-bg: $gray3; +$list-entry-hover-bg: $gray4;
\ No newline at end of file diff --git a/web/source/css/base.css b/web/source/css/base.css index ef7eb2e36..9289f18f8 100644 --- a/web/source/css/base.css +++ b/web/source/css/base.css @@ -413,4 +413,80 @@ label { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; +} + +.list { + display: flex; + flex-direction: column; + + &.scrolling { + max-height: 40rem; + overflow: auto; + } + + .header, .entry { + padding: 0.5rem; + } + + .header { + border: 0.1rem solid transparent !important; /* for alignment with .entry border padding */ + background: $gray1 !important; + display: flex; + font-weight: bold; + } + + input[type=checkbox] { + margin-left: 0.5rem; + } + + .entry { + display: flex; + flex-wrap: wrap; + background: $list-entry-bg; + border: 0.1rem solid transparent; + + &:nth-child(even) { + background: $list-entry-alternate-bg; + } + + &:hover { + background: $list-entry-hover-bg; + } + + &:active, &:focus, &:hover, &:target { + border-color: $fg-accent; + } + } +} + +.domain-blocklist { + box-shadow: $boxshadow; + + .entry { + display: grid; + grid-template-columns: 15rem 1fr; + gap: 0.5rem; + align-items: start; + border: $boxshadow-border; + border-top-color: transparent; + + & > div { + display: flex; + align-items: center + } + + .domain a { + font-weight: bold; + text-decoration: none; + display: inline-block; /* so it wraps properly */ + } + + .public_comment p { + margin: 0; + } + } + + .header .domain { + color: $fg; + } }
\ No newline at end of file diff --git a/web/source/settings/style.css b/web/source/settings/style.css index 2d569759f..745021418 100644 --- a/web/source/settings/style.css +++ b/web/source/settings/style.css @@ -368,49 +368,6 @@ span.form-info { font-weight: initial; } -.list { - display: flex; - flex-direction: column; - - &.scrolling { - max-height: 40rem; - overflow: auto; - } - - .header, .entry { - padding: 0.5rem; - } - - .header { - border: 0.1rem solid transparent; /* for alignment with .entry border padding */ - background: $gray2; - display: flex; - } - - input[type=checkbox] { - margin-left: 0.5rem; - } - - .entry { - display: flex; - flex-wrap: wrap; - background: $settings-entry-bg; - border: 0.1rem solid transparent; - - &:nth-child(even) { - background: $settings-entry-alternate-bg; - } - - &:hover { - background: $settings-entry-hover-bg; - } - - &:active, &:focus, &:hover { - border-color: $fg-accent; - } - } -} - .checkbox-list { .header, .entry { gap: 1rem; @@ -446,7 +403,7 @@ span.form-info { } .emoji-list { - background: $settings-entry-bg; + background: $list-entry-bg; .entry { flex-direction: column; @@ -472,7 +429,7 @@ span.form-info { } &:hover { - background: $settings-entry-hover-bg; + background: $list-entry-hover-bg; } } } diff --git a/web/template/domain-blocklist.tmpl b/web/template/domain-blocklist.tmpl new file mode 100644 index 000000000..5e8a19491 --- /dev/null +++ b/web/template/domain-blocklist.tmpl @@ -0,0 +1,51 @@ +{{- /* + GoToSocial + Copyright (C) 2021-2023 GoToSocial Authors admin@gotosocial.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ -}} + +{{ template "header.tmpl" .}} +<main> + <section> + <h1>Suspended Instances</h1> + <p> + The following list of domains have been suspended by the administrator(s) of this server. + </p> + <p> + All current and future accounts on these instances are blocked, and no more data is federated to the remote + servers. + This extends to subdomains, so an entry for 'example.com' includes 'social.example.com' as well. + </p> + <div class="list domain-blocklist"> + <div class="header entry"> + <div class="domain">Domain</div> + <div class="public_comment">Public comment</div> + </div> + {{range .blocklist}} + <div class="entry" id="{{.Domain}}"> + <div class="domain"> + <a class="text-cutoff" href="#{{.Domain}}" title="{{.Domain}}">{{.Domain}}</a> + </div> + <div class="public_comment"> + <p> + {{.PublicComment}} + </p> + </div> + </div> + {{end}} + </div> + </section> +</main> +{{ template "footer.tmpl" .}}
\ No newline at end of file |