diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 9fad64ad3..55c4dac72 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -852,12 +852,16 @@ class ProjectsController < ApplicationController end end - # 项目收藏 def store_mine member = Member.where(:project_id => params[:id], :user_id => User.current.id).first member.try(:is_collect) == 1 ? member.update_column(:is_collect, 0) : member.update_column(:is_collect, 1) end + # 项目收藏 + def enshrine + @stores = Member.where(:project_id => params[:id], :is_collect => 1).includes(:user) + end + #加入私有项目 def join_project respond_to do |format| diff --git a/app/views/projects/_applied_status.html.erb b/app/views/projects/_applied_status.html.erb index 79fa9fee8..414449eb8 100644 --- a/app/views/projects/_applied_status.html.erb +++ b/app/views/projects/_applied_status.html.erb @@ -18,7 +18,9 @@ <% else %> <% my_stores = Member.where(:project_id => @project.id, :is_collect => 1).count %> -
  • <%= store_project_link(@project.id, User.current.id) %><%= link_to my_stores, store_mine_project_path(@project), :class => "pro_new_topbtn fl" %>
  • +
  • <%= store_project_link(@project.id, User.current.id) %> + <%= link_to my_stores, enshrine_project_path(@project), :class => "pro_new_topbtn fl" %> +
  • <% if User.current.id != @project.user_id %> <%= exit_project_link(@project) %> diff --git a/app/views/projects/enshrine.html.erb b/app/views/projects/enshrine.html.erb new file mode 100644 index 000000000..c1ddf1355 --- /dev/null +++ b/app/views/projects/enshrine.html.erb @@ -0,0 +1,28 @@ +
    +
    +

    收藏用户列表

    +
    +
    + <%= error_messages_for 'member' %> +
    +
    + 加入时间 +
    + <% @stores.each do |member| %> +
    + + <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %> + + <%= l(:label_user_for_project_grade) %>:<%= format("%.2f" ,read_user_project_scores(member.user,@project)).to_i %> + + <%= l(:label_username)%> + <%= link_to(member.user.name, user_path(member.user),:class => "ml10 c_blue02") %>(<%= rolesToLanguage(member.roles.sort.collect(&:to_s)).join(', ') %>)
    +
    +
    + <% end%> + +
    +
    +
    +
    +
    diff --git a/config/routes.rb b/config/routes.rb index 3c35706ba..b3162f925 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -751,6 +751,7 @@ RedmineApp::Application.routes.draw do #by young get 'member', :to => 'projects#member', :as => 'member' match 'store_mine', :to => 'projects#store_mine', :as => 'store_mine' + match 'enshrine', :to => 'projects#enshrine', :as => 'enshrine' get 'file', :action => 'file', :as => 'file' get 'statistics', :action => 'statistics', :as => 'statistics' get 'repository_tree_changes', :action => 'repository_tree_changes', :as => 'repository_tree_changes'