项目关注车成员列表结构梳理
This commit is contained in:
parent
6d5d93c24e
commit
8393679c9c
|
@ -32,7 +32,7 @@ class ProjectsController < ApplicationController
|
|||
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course]
|
||||
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
|
||||
before_filter :require_admin, :only => [ :copy, :unarchive, :destroy, :calendar]
|
||||
before_filter :file, :statistics #:watcherlist
|
||||
before_filter :file
|
||||
# 除非项目内人员,不可查看成员, TODO: 完了写报表里去
|
||||
# before_filter :memberAccess, only: :member
|
||||
|
||||
|
@ -535,6 +535,23 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def project_watcherlist
|
||||
unless @project.nil?
|
||||
if !@project.is_public? && !User.current.member_of?(@project) && !User.current.admin?
|
||||
render_403
|
||||
else
|
||||
@users -= watched.watcher_users if @watched
|
||||
end
|
||||
@watchers = @project.watcher_users
|
||||
@limit = 20
|
||||
@is_remote = true
|
||||
@watchers_count = @watchers.count
|
||||
@watcher_pages = Paginator.new @watchers_count, @limit, params['page'] || 1
|
||||
@offset ||= @watcher_pages.offset
|
||||
@watchers = paginateHelper @watchers, 20
|
||||
end
|
||||
end
|
||||
|
||||
# include CoursesHelper
|
||||
def member
|
||||
# 消息"同意加入项目"
|
||||
|
@ -671,13 +688,7 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
|
||||
def statistics
|
||||
@watchers = @project.watcher_users
|
||||
@limit = 20
|
||||
@is_remote = true
|
||||
@watchers_count = @watchers.count
|
||||
@watcher_pages = Paginator.new @watchers_count, @limit, params['page'] || 1
|
||||
@offset ||= @watcher_pages.offset
|
||||
@watchers = paginateHelper @watchers, 20
|
||||
|
||||
end
|
||||
#end
|
||||
|
||||
|
@ -978,16 +989,6 @@ class ProjectsController < ApplicationController
|
|||
true
|
||||
end
|
||||
|
||||
def watcherlist
|
||||
unless @project.nil?
|
||||
if !@project.is_public? && !User.current.member_of?(@project) && !User.current.admin?
|
||||
render_403
|
||||
else
|
||||
@users -= watched.watcher_users if @watched
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#gcm
|
||||
def desc_sort_course_by_avtivity(activity_count,projects)
|
||||
return projects if activity_count.size<2
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<!--关注项目-->
|
||||
<li class="mr5 fl">
|
||||
<%= watcher_link_for_project(@project, User.current) %>
|
||||
<%= link_to "#{@project.watcher_users.count}", {:controller => "projects", :action => "watcherlist",
|
||||
<%= link_to "#{@project.watcher_users.count}", {:controller => "projects", :action => "project_watcherlist",
|
||||
:id => @project.id}, :id => "fans_num", :class => 'pro_new_topbtn fl', :title => "关注成员列表" %>
|
||||
</li>
|
||||
<!--加入项目-->
|
||||
|
@ -21,7 +21,7 @@
|
|||
<% if User.current.login? %>
|
||||
<li class="mr5 fl">
|
||||
<%= watcher_link_for_project(@project, User.current) %>
|
||||
<%= link_to "#{@project.watcher_users.count}", {:controller => "projects", :action => "watcherlist",
|
||||
<%= link_to "#{@project.watcher_users.count}", {:controller => "projects", :action => "project_watcherlist",
|
||||
:id => @project.id}, :id => "fans_num", :class => 'pro_new_topbtn fl', :title => "关注成员列表" %>
|
||||
</li>
|
||||
<li class="mr5 fl">
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
<div class="pro_new_info mb10">
|
||||
<h2 class="clear">成员<span class="fr pro_new_font mr15" > 本页面展示关注了 <%= link_to @project.owner.try(:show_name), user_path(@project.owner) %>/<%= link_to @project.name, project_path(@project) %> 的用户</span></h2>
|
||||
<ul class="clear pro_new_users_box">
|
||||
<% @watchers.each do |user| %>
|
||||
<li class="clear">
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像", :class => "pro_new_users fl mr5" %>
|
||||
<div class="fl mt5 clear">
|
||||
<%= link_to user.try(:show_name), user_path(user), :class => "pro_new_users mt5 fl" %>
|
||||
<!-- <span class="ml5 mr5 mt5 fl"> / </span>
|
||||
<%#= link_to project.name, project_path(project), :class => "pro_new_users mt5 fl" %>-->
|
||||
<br/>
|
||||
<span class=" c_grey mt3 fl"><%=h time_tag(user.created_on) %></span>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @watcher_pages, @watchers_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -780,6 +780,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
|
||||
#by young
|
||||
get 'member', :to => 'projects#member', :as => 'member'
|
||||
match 'project_watcherlist', :to => 'projects#project_watcherlist', :as => 'project_watcherlist'
|
||||
match 'store_mine', :to => 'projects#store_mine', :as => 'store_mine'
|
||||
match 'enshrine', :to => 'projects#enshrine', :as => 'enshrine'
|
||||
match 'member_forked', :to => 'projects#member_forked', :as => 'member_forked'
|
||||
|
|
Loading…
Reference in New Issue