diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 02d23e174..0a1775c5c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -31,7 +31,7 @@ class UsersController < ApplicationController accept_api_auth :index, :show, :create, :update, :destroy,:tag_save #william - before_filter :require_login,:only => :tag_save + before_filter :need_login,:only => :tag_save helper :sort diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 789861fad..75484a227 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1317,8 +1317,8 @@ module ApplicationHelper # end #added by william - def get_fans_num(user) - user.watcher_users.count + def need_login + redirect_to signin_path end #end end diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 0bf0642dd..d82d3dc9d 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -87,8 +87,7 @@
<% for user in @users -%> -
- +
<%= content_tag "p", "#{format_date(user.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %> <%= image_tag "/images/time_member.png", :class => "img_member_time"%> @@ -99,9 +98,8 @@
<%= l(:label_has_fans,:count=>user.watcher_users.count)%> <%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %> - <%= l(:label_has_praisers,:count=>get_praise_num(user))%>
- +
<% unless user.memberships.empty? %> <%= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>