Skip to content

Commit

Permalink
fixes for publiclab#7965
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren committed Aug 4, 2020
1 parent 92834ea commit fae8c66
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
8 changes: 0 additions & 8 deletions app/models/tag.rb
Expand Up @@ -115,14 +115,6 @@ def self.find_nodes_by_type(tagnames, type = 'note', limit = 10)
.order(order)
end

def self.counter(tagname)
Node.where(type: %w(note page))
.where('term_data.name = ?', tagname)
.includes(:node_tag, :tag)
.references(:term_data)
.count
end

# just like find_nodes_by_type, but searches wiki pages, places, and tools
def self.find_pages(tagnames, limit = 10)
find_nodes_by_type(tagnames, %w(page place tool), limit)
Expand Down
2 changes: 1 addition & 1 deletion app/views/tag/_topicCard.html.erb
Expand Up @@ -32,7 +32,7 @@
</div>
<div class="card-footer" style="background-color: inherit; border:none;">
<a style="padding-top:15px;text-decoration:underline;color:#808080;display:inline-block;" href="/tag/<%= tag.name %>"><%= Tag.counter(tag.name)-shown_nids.count - Tag.find_nodes_by_type(tag.name, type = 'note', limit = 3).where.not(nid: shown_nids).count %> <%= translation('tag.index.more_posts') %> &raquo;</a>
<a style="padding-top:15px;text-decoration:underline;color:#808080;display:inline-block;" href="/tag/<%= tag.name %>"><%= Tag.count %> <%= translation('tag.index.posts') %> &raquo;</a>
<div id="follow-unfollow-column-<%=tag.tid%>" style="float:right;margin:10px 0 10px 10px;">
<% if current_user %>
<% if !current_user.following(tag.name) %>
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Expand Up @@ -369,7 +369,7 @@ en:
number_of_subscriptions: "# of people"
subscriptions: "Your subscriptions"
sort_by: "Sort By"
more_posts: "more posts"
posts: "posts"
follow: "Follow"
unfollow: "Unfollow"
notes:
Expand Down

0 comments on commit fae8c66

Please sign in to comment.