Add anti-follow language (#1233)

This commit is contained in:
Ben Halpern 2018-11-30 18:08:51 -05:00 committed by GitHub
parent 651ab3ce35
commit f400b42e38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -18,11 +18,13 @@ function initializeUserSidebar(user) {
}
followedTags.forEach(function(t){
renderedTagsCount++
tagHTML = tagHTML + '<div class="sidebar-nav-element" id="sidebar-element-'+t.name+'">\
if (t.points > 0.0) {
tagHTML = tagHTML + '<div class="sidebar-nav-element" id="sidebar-element-'+t.name+'">\
<a class="sidebar-nav-link" href="/t/'+t.name+'">\
<span class="sidebar-nav-tag-text">#'+t.name+'</span>\
</a>\
</div>';
}
if (document.getElementById("default-sidebar-element-"+t.name)){
document.getElementById("default-sidebar-element-"+t.name).remove();
}

View file

@ -36,9 +36,14 @@
<% if @followed_tags %>
<h2>Followed tags (<%= @user.following_tags_count %>)</h2>
<p><em>Adjust <strong>Follow Weight</strong> to make a tag show up less or more in your feed (default 1.0)</em></p>
<% negative_follow_shown_once = false %>
<% @followed_tags.each do |follow| %>
<% tag = follow.followable %>
<% if tag %>
<% if follow.points < 0 && !negative_follow_shown_once %>
<h2>Negative Tags (anti-follows)</h2>
<% negative_follow_shown_once = true %>
<% end %>
<% color = HexComparer.new([tag.bg_color_hex || "#0000000",tag.text_color_hex || "#ffffff"]).brightness(0.8) %>
<div class="single-article" style="border-color:<%= color %>;box-shadow: 3px 3px 0px <%= color %>">
<h2>