[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
This commit is contained in:
f0x52
2023-01-25 18:06:41 +01:00
committed by GitHub
parent 993aae5e48
commit 17eecfb6d9
17 changed files with 265 additions and 66 deletions

View File

@ -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;
$list-entry-bg: $gray2;
$list-entry-alternate-bg: $gray3;
$list-entry-hover-bg: $gray4;

View File

@ -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;
}
}

View File

@ -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;
}
}
}