个人主页课程列表加入了“退出课程”和加入课程按钮

This commit is contained in:
huangjingquan 2013-11-01 09:06:06 +08:00
parent b2080a4470
commit 5febe8a58d
3 changed files with 8 additions and 6 deletions

View File

@ -100,7 +100,7 @@ class MembersController < ApplicationController
#added by nie
if(params[:membership][:role_ids] && params[:membership][:role_ids][0] == "3")
@projectInfo = ProjectInfo.new(:user_id => @member.user_id, :project_id => @project.id)
@projectInfo.save
@projectInfo.save
else
user_admin = ProjectInfo.where("user_id = ? and project_id = ?", @member.user_id, @project.id)
if user_admin.size > 0

View File

@ -748,7 +748,7 @@ class ProjectsController < ApplicationController
# @course_tag = params[:course]
# if @course_tag == '1'
if @project.project_type == 1
@course = Course.find_by_extra(@project.identifier)
@course = Course.find_by_extra(@project.identifier)
render :layout => 'base_courses'
else
render :layout => 'base_projects'
@ -762,7 +762,7 @@ class ProjectsController < ApplicationController
#by young
def member
if @project.project_type == 1
render :layout => 'base_courses'
render :layout => 'base_courses'
end
# roles = Role.find_all_givable
# members = @project.member_principals.includes(:roles, :principal).all.sort
@ -912,7 +912,7 @@ class ProjectsController < ApplicationController
def watcherlist
if @watched
@users -= watched.watcher_users
@users -= watched.watcher_users
end
end
end

View File

@ -9,8 +9,10 @@
<table width="580" border="0">
<tr>
<td colspan="2" valign="top"><span><%= link_to_project(membership.project) %></span>
<span></span>
<span style="float: right"><%= l(:label_x_base_courses_member, :count => membership.project.members.count) %>(<%= link_to "#{membership.project.members.count}", project_member_path(membership.project), :course =>'1' %>)&nbsp;&nbsp;
<span>
</span>
<span style="float: right"><%= join_in_course(membership.project, User.current)%>&nbsp;&nbsp;&nbsp;&nbsp;<%= l(:label_x_base_courses_member, :count => membership.project.members.count) %>(<%= link_to "#{membership.project.members.count}", project_member_path(membership.project), :course =>'1' %>)&nbsp;&nbsp;
<%= l(:label_homework) %> (<span class=""><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %></span>)
&nbsp;&nbsp;
<%= l(:label_course_news)%> (<span style="color: #ed8924"><%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>)