添加fork成员列表

This commit is contained in:
huang 2016-11-11 16:09:43 +08:00
parent 8fce011392
commit 442fb8a531
5 changed files with 41 additions and 10 deletions

View File

@ -598,7 +598,9 @@ class ProjectsController < ApplicationController
end
def member_forked
@members_forked = User.find_by_sql("SELECT u.* FROM `projects` p,`users` u where p.user_id = u.id and p.forked_from_project_id = #{@project.id} ;")
@forked_projects = Project.where(:forked_from_project_id => @project.id)
# @forked_members = User.find_by_sql("SELECT u.* FROM `projects` p,`users` u where p.user_id = u.id and p.forked_from_project_id = #{@project.id} ;")
end
def update_message_status(user, project)

View File

@ -19,7 +19,7 @@
<!--项目创建者不能退出项目-->
<% if User.current.id != @project.user_id %>
<li class="mr5 fl">
<a href="javascript:void(0);" class="pro_new_topbtn_left fl "> 已加入</a>
<a class="pro_new_topbtn_left fl "> 已加入</a>
<a href="<%= project_member_path(@project) %>" class=" pro_new_topbtn fl"><%= Member.where(:project_id => @project.id).count %></a>
</li>
<%#= link_to "#{Member.where(:project_id => @project.id).count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员" %>

View File

@ -1,3 +1,17 @@
<% @members_forked.each do |id| %>
<% %>
<% end %>
<div class="pro_new_info mb10">
<h2 class="clear">成员<span class="fr pro_new_font mr15" >本页面展示Fork了 <%= 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">
<% @forked_projects.each do |project| %>
<li class="clear">
<%= link_to image_tag(url_to_avatar(project.owner), :width => "50", :height => "50"), user_path(project.owner), :alt => "用户头像", :class => "pro_new_users fl mr5" %>
<div class="fl mt5 clear">
<%= link_to project.owner.try(:show_name), user_path(project.owner), :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"><%=h time_tag(project.created_on) %>前</span>
</div>
</li>
<% end %>
</ul>
</div>

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20161028053000) do
ActiveRecord::Schema.define(:version => 20161111064007) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -325,14 +325,16 @@ ActiveRecord::Schema.define(:version => 20161028053000) do
add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids"
create_table "changesets", :force => true do |t|
t.integer "repository_id", :null => false
t.string "revision", :null => false
t.integer "repository_id", :null => false
t.string "revision", :null => false
t.string "committer"
t.datetime "committed_on", :null => false
t.datetime "committed_on", :null => false
t.text "comments"
t.date "commit_date"
t.string "scmid"
t.integer "user_id"
t.integer "project_id"
t.integer "type", :default => 0
end
add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on"
@ -993,6 +995,10 @@ ActiveRecord::Schema.define(:version => 20161028053000) do
t.datetime "updated_at", :null => false
end
create_table "innodb_monitor", :id => false, :force => true do |t|
t.integer "a"
end
create_table "invite_lists", :force => true do |t|
t.integer "project_id"
t.integer "user_id"

View File

@ -1029,4 +1029,13 @@ textarea.muban_textarea{ width: 98.5%;border:1px solid #ddd; background:#fff; co
/* 课程大纲 */
.icons_tishi{ width: 110px; height: 110px;margin: 135px auto 20px;}
.sy_tab_con_p{ font-size: 16px;text-align: center; margin-bottom:100px; color:#888;}
.sy_tab_con_p{ font-size: 16px;text-align: center; margin-bottom:100px; color:#888;}
/* 成员列表20161101byLB*/
.pro_new_font{ font-weight: normal; color: #666; font-size: 12px;}
.pro_new_users_box{ margin:0 10px;}
.pro_new_users_box li{ width:25%; float: left; margin:10px 0;}
.pro_new_users{ }
a.pro_new_users { max-width:80px; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; word-break:break-all; display: inline-block; font-weight: bold; color: #666;}
a:hover.pro_new_users {color: #3b94d6}
.pro_new_users img{ width:40px;height:40px; border: 3px solid #fff;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;}
.pro_new_users img:hover{border: 3px solid #e6e6e6;}