blacklists: refactor blacklist html+css.
* Consolidate blacklist css in one file. * blacklist box: fix tag colors not dimming on hover. * blacklist box: allow middle clicking on tags to open in new tab. * /wiki_pages: move blacklist controls to top of tag sidebar. * /wiki_pages: fix missing "disable all" / "re-enable all" buttons.
This commit is contained in:
@@ -55,6 +55,7 @@ Blacklist.toggle_entry = function(e) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Blacklist.apply();
|
Blacklist.apply();
|
||||||
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
Blacklist.update_sidebar = function() {
|
Blacklist.update_sidebar = function() {
|
||||||
@@ -68,6 +69,7 @@ Blacklist.update_sidebar = function() {
|
|||||||
var count = $("<span/>");
|
var count = $("<span/>");
|
||||||
|
|
||||||
link.text(entry.tags);
|
link.text(entry.tags);
|
||||||
|
link.attr("href", `/posts?tags=${encodeURIComponent(entry.tags)}`);
|
||||||
link.click(Blacklist.toggle_entry);
|
link.click(Blacklist.toggle_entry);
|
||||||
count.html(entry.hits);
|
count.html(entry.hits);
|
||||||
count.addClass("count");
|
count.addClass("count");
|
||||||
|
|||||||
31
app/javascript/src/styles/common/blacklists.scss
Normal file
31
app/javascript/src/styles/common/blacklists.scss
Normal file
@@ -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;
|
||||||
|
}
|
||||||
@@ -65,23 +65,6 @@ div#page {
|
|||||||
margin-bottom: 1em;
|
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 {
|
section#content {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
margin-left: 15em;
|
margin-left: 15em;
|
||||||
|
|||||||
@@ -123,10 +123,6 @@ div#c-comments {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
div.post.blacklisted.blacklisted-active {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,14 +51,6 @@ article.post-preview {
|
|||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.blacklisted-active {
|
|
||||||
text-decoration: line-through;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-preview.blacklisted-active, #image-container.blacklisted-active {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#excerpt p.links {
|
#excerpt p.links {
|
||||||
margin-top: 1em;
|
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 {
|
div#unapprove-dialog {
|
||||||
p {
|
p {
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<section id="blacklist-box">
|
<div id="blacklist-box" class="sidebar-blacklist">
|
||||||
<h1>Blacklisted (<%= link_to "Help", wiki_pages_path(:title => "help:blacklists") %>)</h1>
|
<h1>Blacklisted (<%= link_to "Help", wiki_pages_path(:title => "help:blacklists") %>)</h1>
|
||||||
<ul id="blacklist-list">
|
<ul id="blacklist-list">
|
||||||
</ul>
|
</ul>
|
||||||
<%= link_to "Disable all", "#", :id => "disable-all-blacklists", :style => "display: none;" %>
|
<%= link_to "Disable all", "#", :id => "disable-all-blacklists", :style => "display: none;" %>
|
||||||
<%= link_to "Re-enable all", "#", :id => "re-enable-all-blacklists", :style => "display: none;" %>
|
<%= link_to "Re-enable all", "#", :id => "re-enable-all-blacklists", :style => "display: none;" %>
|
||||||
</section>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
<aside id="sidebar">
|
<aside id="sidebar">
|
||||||
|
<%= render "posts/partials/index/blacklist" %>
|
||||||
<%= render "wiki_pages/recent_changes" %>
|
<%= render "wiki_pages/recent_changes" %>
|
||||||
|
|
||||||
<section id="blacklist-box">
|
|
||||||
<h1>Blacklisted</h1>
|
|
||||||
<ul id="blacklist-list">
|
|
||||||
</ul>
|
|
||||||
</section>
|
|
||||||
</aside>
|
</aside>
|
||||||
|
|||||||
Reference in New Issue
Block a user