项目关注列表

This commit is contained in:
daiao 2016-11-25 10:47:48 +08:00
parent 89e9a309e3
commit e6e4a320ee
3 changed files with 23 additions and 2 deletions

View File

@ -971,6 +971,14 @@ class ProjectsController < ApplicationController
else else
@users -= watched.watcher_users if @watched @users -= watched.watcher_users if @watched
end 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
#@curse_attachments_all = @all_attachments[@offset, @limit]
@watchers = paginateHelper @watchers,20
end end
end end
@ -987,5 +995,7 @@ class ProjectsController < ApplicationController
end end
return projects return projects
end end
#gcmend #gcmend
end end

View File

@ -12,7 +12,7 @@
<%= link_to "打开<span class='new_roadmap_nav_tagnomal ml5' id='new_roadmap_num_2'>#{@issue_open_count}</span>".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_2" %> <%= link_to "打开<span class='new_roadmap_nav_tagnomal ml5' id='new_roadmap_num_2'>#{@issue_open_count}</span>".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_2" %>
</li> </li>
<li id="new_roadmap_nav_3" onclick="HoverLi(3);"> <li id="new_roadmap_nav_3" onclick="HoverLi(3);">
<%= link_to "锁定<span class='new_roadmap_nav_tagnomal ml5' id='new_roadmap_num_3'>#{@issue_close_count}</span>".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_3" %> <%= link_to "关闭<span class='new_roadmap_nav_tagnomal ml5' id='new_roadmap_num_3'>#{@issue_close_count}</span>".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_3" %>
</li> </li>
</ul> </ul>
</div><!--issues_statistics end--> </div><!--issues_statistics end-->

View File

@ -1,7 +1,7 @@
<div class="pro_new_info mb10"> <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> <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"> <ul class="clear pro_new_users_box">
<% @project.watcher_users.each do |user| %> <% @watchers.each do |user| %>
<li class="clear"> <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" %> <%= 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"> <div class="fl mt5 clear">
@ -15,3 +15,14 @@
<% end %> <% end %>
</ul> </ul>
</div> </div>
<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>