make the links on featued users tile be the tag with the name in the link. added a following count to tags
This commit is contained in:
parent
1bf51f678c
commit
2b22e1dab5
6 changed files with 17 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
# Copyright (c) 2010-2011, Diaspora Inc. This file is
|
||||
# licensed under the Affero General Public License version 3 or later. See
|
||||
# the COPYRIGHT file.
|
||||
require File.join(Rails.root, 'app', 'models', 'acts_as_taggable_on_tag')
|
||||
|
||||
class TagsController < ApplicationController
|
||||
skip_before_filter :which_action_and_user
|
||||
|
|
@ -47,6 +48,8 @@ class TagsController < ApplicationController
|
|||
def show
|
||||
params[:name].downcase!
|
||||
@aspect = :tag
|
||||
@tag = ActsAsTaggableOn::Tag.find_by_name(params[:name])
|
||||
@tag_follow_count = @tag.followed_count
|
||||
|
||||
if current_user
|
||||
@posts = StatusMessage.owned_or_visible_by_user(current_user)
|
||||
|
|
@ -74,5 +77,4 @@ class TagsController < ApplicationController
|
|||
end
|
||||
@tag_followed
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
5
app/models/acts_as_taggable_on_tag.rb
Normal file
5
app/models/acts_as_taggable_on_tag.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class ActsAsTaggableOn::Tag
|
||||
def followed_count
|
||||
@followed_count ||= TagFollowing.where(:tag_id => self.id).count
|
||||
end
|
||||
end
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
.tags
|
||||
- person.profile.tags.each do |tag|
|
||||
= link_to "##{tag}", tag_path(tag)
|
||||
= link_to "##{tag}", tag_path(:name => tag.name)
|
||||
|
||||
.add_user_to_aspect
|
||||
= render :partial => 'people/relationship_action',
|
||||
|
|
|
|||
|
|
@ -57,6 +57,9 @@
|
|||
= button_to t('.following', :tag => params[:name]), tag_tag_followings_path(:name => params[:name]), :method => :delete, :class => 'button red_on_hover tag_following in_aspects take_action'
|
||||
%h2
|
||||
= "##{params[:name]}"
|
||||
%small
|
||||
= t('.followed_by')
|
||||
= t('people', :count => @tag_follow_count)
|
||||
|
||||
- if current_user
|
||||
= render 'shared/publisher', :selected_aspects => all_aspects.map{|a| a.id}, :aspect_ids => all_aspects.map{|a| a.id}, :for_all_aspects => true, :aspect => all_aspects.first
|
||||
|
|
|
|||
|
|
@ -804,7 +804,7 @@ en:
|
|||
follow: "Follow #%{tag}"
|
||||
following: "Following #%{tag}"
|
||||
stop_following: "Stop Following #%{tag}"
|
||||
|
||||
followed_by: 'followed by'
|
||||
tag_followings:
|
||||
create:
|
||||
success: "Successfully following: #%{name}"
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ h1, h2, h3, h4
|
|||
:margin
|
||||
:bottom 5px
|
||||
|
||||
small
|
||||
:font-size small
|
||||
:color #999
|
||||
|
||||
h1
|
||||
:color #111
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue