Whitelist fixes

master
Noiob 2018-08-22 18:20:31 -07:00
parent d8a41ae155
commit becd1521b5
6 changed files with 16 additions and 17 deletions

View File

@ -3,3 +3,6 @@
import 'font-awesome/css/font-awesome.css'; import 'font-awesome/css/font-awesome.css';
require.context('../images/', true); require.context('../images/', true);
//awoo customization
import 'styles/whitelist.scss';

View File

@ -24,5 +24,3 @@
@import 'mastodon/dashboard'; @import 'mastodon/dashboard';
@import 'mastodon/rtl'; @import 'mastodon/rtl';
@import 'mastodon/accessibility'; @import 'mastodon/accessibility';
@import 'whitelist.scss';

View File

@ -88,5 +88,3 @@
margin: 0 !important margin: 0 !important
} }
} }
@import 'whitelist.scss';

View File

@ -1,15 +1,15 @@
#whitelist { #whitelist {
ul { ul {
columns: 3 250px; columns: 3 250px;
}
} }
}
#whitelist-column {
grid-row: 4;
}
@media screen and (max-width: 415px) {
#whitelist-column { #whitelist-column {
grid-row: 4; grid-row: 5;
} }
}
@media screen and (max-width: 415px) {
#whitelist-column {
grid-row: 5;
}
}

View File

@ -14,8 +14,7 @@ class DomainWhitelist < ApplicationRecord
end end
def self.silenced?(domain) def self.silenced?(domain)
whitelist = where(domain: domain) where(domain: domain, severity: silence).exists?
whitelist.exists? && whitelist[0].severity == :silence
end end
before_validation :normalize_domain before_validation :normalize_domain

View File

@ -6,4 +6,5 @@
- @instance_presenter.whitelist.each do |site| - @instance_presenter.whitelist.each do |site|
.whitelist-site .whitelist-site
%li %li
= link_to site.domain + (DomainWhitelist.silenced?(site.domain) ? ' (silenced)' : ''), 'https://' + site.domain = link_to site.domain, 'https://' + site.domain
= raw(AllowDomainService.silenced?(site.domain) ? ' (silenced)' : '')