forked from jacknudt/trustieforge
user列表
This commit is contained in:
parent
0aeb56f8f7
commit
77a47797d2
|
@ -179,6 +179,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
@users = scope.offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_type = 0
|
||||
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
|
||||
# @projects = @projects[@offset, @limit]
|
||||
when '1'
|
||||
|
@ -192,6 +193,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
@users = scope.includes(:user_status).reorder('user_statuses.changesets_count').offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_type = 1
|
||||
#sort {|x,y| y.user_status.changesets_count <=> x.user_status.changesets_count}
|
||||
#@users = @users[@offset, @limit]
|
||||
when '2'
|
||||
|
@ -207,6 +209,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
#@users = @users[@offset, @limit]
|
||||
end
|
||||
@s_type = 2
|
||||
else
|
||||
@offset ||= @user_pages.reverse_offset
|
||||
unless @offset == 0
|
||||
|
@ -218,6 +221,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
@users = scope.offset(@offset).limit(limit).all.reverse
|
||||
end
|
||||
@s_type = 0
|
||||
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
|
||||
# @projects = @projects[@offset, @limit]
|
||||
end
|
||||
|
|
|
@ -91,4 +91,25 @@ module UsersHelper
|
|||
content_tag('div', content, :class => "pagination")
|
||||
end
|
||||
|
||||
# added by huang
|
||||
def sort_user(state)
|
||||
content = ''.html_safe
|
||||
case state
|
||||
when 0
|
||||
content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0'), :class=>"selected"), :class=>"selected")
|
||||
content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1')))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2')))
|
||||
when 1
|
||||
content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0')))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1'), :class=>"selected"), :class=>"selected")
|
||||
content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2')))
|
||||
when 2
|
||||
content << content_tag('li', link_to(l(:label_sort_by_time), users_path(:user_sort_type => '0')))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_active), users_path(:user_sort_type => '1')))
|
||||
content << content_tag('li', link_to(l(:label_sort_by_influence), users_path(:user_sort_type => '2'), :class=>"selected"), :class=>"selected")
|
||||
end
|
||||
content = content_tag('ul', content)
|
||||
content_tag('div', content, :class => "tabs")
|
||||
end
|
||||
#end
|
||||
end
|
||||
|
|
|
@ -61,10 +61,10 @@
|
|||
<td class="font_index"><%=link_to files_count, project_files_path(@project) %></td>
|
||||
|
||||
<tr class="font_aram">
|
||||
<td align="center" width="60px"> <%= l(:label_member) %></td>
|
||||
<td align="center" width="60px"><%= l(:label_user_watcher) %></td>
|
||||
<td align="center" width="60px"> <%= l(:label_project_issues) %></td>
|
||||
<td align="center" width="60px"><%= l(:label_attachment) %></td>
|
||||
<td align="center" width="58px"> <%= l(:label_member) %></td>
|
||||
<td align="center" width="58px"><%= l(:label_user_watcher) %></td>
|
||||
<td align="center" width="58px"> <%= l(:label_project_issues) %></td>
|
||||
<td align="center" width="58px"><%= l(:label_attachment) %></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -84,9 +84,9 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= sort_user(@s_type)%>
|
||||
|
||||
<div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 0px">
|
||||
<!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 0px">
|
||||
<ul style="margin-right:0px">
|
||||
<li>
|
||||
<%= link_to l(:label_sort_by_time), users_path(:user_sort_type => '0') %>
|
||||
|
@ -98,7 +98,7 @@
|
|||
<%= link_to l(:label_sort_by_influence), users_path(:user_sort_type => '2') %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
<div class="autoscroll">
|
||||
|
|
|
@ -1115,7 +1115,7 @@ en:
|
|||
label_file_new: Download
|
||||
label_user_edit: "Edit information"
|
||||
label_user_info: "User information" #huang 添加
|
||||
label_user_watcher: "Following" # huang添加的 # modified by bai
|
||||
label_user_watcher: "Followed" # huang添加的 # modified by bai
|
||||
label_user_fans: "Followed by" # modified by bai
|
||||
label_user_commits: "Code commits"
|
||||
label_user_watchered: "Followed" # huang添加的
|
||||
|
|
|
@ -1571,7 +1571,7 @@ button.tab-right {
|
|||
#content .tabs_new {height: 2.6em; margin-bottom:1.2em; margin-top: 0.8em; position:relative; overflow:hidden;}
|
||||
#content .tabs_new ul {margin:0; position:absolute; bottom:0; padding-left: 0.5em; width: 2000px; border-bottom: 1px solid #15BCCF;font-size:14px;}
|
||||
#content .tabs_new ul li {
|
||||
width:80px; /*modified by linchun*/
|
||||
width:85px; /*modified by linchun*/
|
||||
float:left;
|
||||
list-style-type:none;
|
||||
white-space:nowrap;
|
||||
|
|
Loading…
Reference in New Issue