From f91cfcdec25cee01decbc158b24ee85c0070553e Mon Sep 17 00:00:00 2001 From: nieguanghui Date: Tue, 13 Aug 2013 20:54:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=8D=E6=8F=90=E4=BA=A4=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 18 +++++++++--------- app/controllers/tags_controller.rb | 2 +- app/helpers/application_helper.rb | 15 +++++++++++++++ app/views/layouts/base_bids.html.erb | 2 +- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index c59d196f3..f749c641b 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -87,15 +87,15 @@ class ProjectsController < ApplicationController @offset, @limit = api_offset_and_limit({:limit => 10}) @projects = Project.visible - @projects.each do |project| - @admin = project.users_by_role[Role.find(3)] - unless @admin.nil? - @admin.each do |user| - ProjectInfo.create(:user_id => user.id, :project_id => project.id) - end - - end - end + # @projects.each do |project| + # @admin = project.users_by_role[Role.find(3)] + # unless @admin.nil? + # @admin.each do |user| + # ProjectInfo.create(:user_id => user.id, :project_id => project.id) + # end +# + # end + # end @projects = Project.visible.like(params[:name]) if params[:name].present? @project_count = @projects.count @project_pages = Paginator.new @project_count, @limit, params['page'] diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 9aac1c934..f26f0a05d 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -1,6 +1,6 @@ # This controller was added by william class TagsController < ApplicationController - layout "base_tags" +# layout "base_tags" before_filter :require_admin,:only => :show include ProjectsHelper include IssuesHelper diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0731445b4..0bf1567e2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1301,9 +1301,14 @@ module ApplicationHelper #added by nie # Display watcher picture def show_watcher_profile(obj) + count = 0 html = '' for user in User.watched_by(obj.id) html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.name}") + count = count + 1 + if count >= 12 + break + end end html.html_safe end @@ -1311,8 +1316,13 @@ module ApplicationHelper #display fans picture def show_fans_picture(obj) html = '' + count = 0 for user in obj.watcher_users html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.name}") + count = count + 1 + if count >= 12 + break + end end html.html_safe end @@ -1320,8 +1330,13 @@ module ApplicationHelper # add by huang def show_watcher_list(user) html = '' + count = 0 for user in User.watched_by(user.id) html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.name}") + count = count + 1 + if count >= 12 + break + end end html.html_safe end diff --git a/app/views/layouts/base_bids.html.erb b/app/views/layouts/base_bids.html.erb index 049a7d324..bdd46a0c7 100644 --- a/app/views/layouts/base_bids.html.erb +++ b/app/views/layouts/base_bids.html.erb @@ -35,7 +35,7 @@ - +
<%= h @bid.name %><%= h @bid.name %>
<%= watcher_link(@bid, User.current) %>