diff --git a/app/javascript/src/javascripts/blacklists.js b/app/javascript/src/javascripts/blacklists.js index 0f81771f8..066635f4b 100644 --- a/app/javascript/src/javascripts/blacklists.js +++ b/app/javascript/src/javascripts/blacklists.js @@ -55,6 +55,7 @@ Blacklist.toggle_entry = function(e) { } } Blacklist.apply(); + e.preventDefault(); } Blacklist.update_sidebar = function() { @@ -68,6 +69,7 @@ Blacklist.update_sidebar = function() { var count = $(""); link.text(entry.tags); + link.attr("href", `/posts?tags=${encodeURIComponent(entry.tags)}`); link.click(Blacklist.toggle_entry); count.html(entry.hits); count.addClass("count"); diff --git a/app/javascript/src/styles/common/blacklists.scss b/app/javascript/src/styles/common/blacklists.scss new file mode 100644 index 000000000..166ac54a0 --- /dev/null +++ b/app/javascript/src/styles/common/blacklists.scss @@ -0,0 +1,31 @@ +@import "../base/000_vars.scss"; + +#blacklist-box { + display: none; + + a.blacklisted-active { + text-decoration: line-through; + } + + &.sidebar-blacklist ul li { + list-style-type: disc; + list-style-position: inside; + } + + &.inline-blacklist { + margin-bottom: 1em; + + #blacklist-list { + display: inline; + + li { + display: inline; + margin-right: 1em; + } + } + } +} + +.post-preview.blacklisted-active, #image-container.blacklisted-active, #c-comments .post.blacklisted-active { + display: none; +} diff --git a/app/javascript/src/styles/common/main_layout.scss b/app/javascript/src/styles/common/main_layout.scss index 661984bfd..7c35ada30 100644 --- a/app/javascript/src/styles/common/main_layout.scss +++ b/app/javascript/src/styles/common/main_layout.scss @@ -65,23 +65,6 @@ div#page { margin-bottom: 1em; } - aside#sidebar > section#blacklist-box ul { - margin-left: 1em; - - li { - list-style-type: disc; - } - - a { - color: $link_color; - cursor: pointer; - } - - span { - color: #AAA; - } - } - section#content { overflow: visible; margin-left: 15em; diff --git a/app/javascript/src/styles/specific/comments.scss b/app/javascript/src/styles/specific/comments.scss index 7bbeb4c38..c39219295 100644 --- a/app/javascript/src/styles/specific/comments.scss +++ b/app/javascript/src/styles/specific/comments.scss @@ -123,10 +123,6 @@ div#c-comments { } } } - - div.post.blacklisted.blacklisted-active { - display: none; - } } } diff --git a/app/javascript/src/styles/specific/posts.scss b/app/javascript/src/styles/specific/posts.scss index cb905cb0e..19ded8736 100644 --- a/app/javascript/src/styles/specific/posts.scss +++ b/app/javascript/src/styles/specific/posts.scss @@ -51,14 +51,6 @@ article.post-preview { margin-top: 1em; } -a.blacklisted-active { - text-decoration: line-through; -} - -.post-preview.blacklisted-active, #image-container.blacklisted-active { - display: none; -} - #excerpt p.links { margin-top: 1em; } @@ -499,33 +491,6 @@ div#c-explore-posts { } } -#blacklist-box { - display: none; -} - -#blacklist-box.inline-blacklist { - margin-bottom: 1em; - - #blacklist-list { - display: inline; - } - - #blacklist-list li { - display: inline; - margin-right: 1em; - - a { - color: $link_color; - cursor: pointer; - } - - span.count { - color: #AAA; - margin-left: 0; - } - } -} - div#unapprove-dialog { p { margin-bottom: 1em; diff --git a/app/views/posts/partials/index/_blacklist.html.erb b/app/views/posts/partials/index/_blacklist.html.erb index 979d49849..16850d512 100644 --- a/app/views/posts/partials/index/_blacklist.html.erb +++ b/app/views/posts/partials/index/_blacklist.html.erb @@ -1,7 +1,7 @@ -
+
+ diff --git a/app/views/wiki_pages/_sidebar.html.erb b/app/views/wiki_pages/_sidebar.html.erb index 3a4e6981f..461e3bccf 100644 --- a/app/views/wiki_pages/_sidebar.html.erb +++ b/app/views/wiki_pages/_sidebar.html.erb @@ -1,9 +1,4 @@