parent
b0d413a216
commit
64cddc8687
|
@ -780,7 +780,7 @@ class ProjectsController < ApplicationController
|
|||
project_status = ProjectStatus.find_by_project_id(@project.id)
|
||||
project_status.destroy
|
||||
elsif params[:project][:is_public] == '1'
|
||||
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0, :project_type => 1)
|
||||
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0, :project_type => 1)
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<table border="0">
|
||||
<tr>
|
||||
<td align="cneter">
|
||||
<%= text_field_tag 'course_password', nil, :size => 30%></td>
|
||||
<%= text_field_tag 'course_password', nil, :size => 27 %></td>
|
||||
|
||||
<td align="center">
|
||||
<%= submit_tag '加入', :name => nil, :class => "bid_btn", :onclick => "hideModal(this);" %></td>
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
<% if @project.project_type == 1 %>
|
||||
<div class ="clear avatar_name"> <p>
|
||||
<% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
|
||||
Teacher
|
||||
老师
|
||||
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
|
||||
Student
|
||||
学生
|
||||
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %>
|
||||
TA
|
||||
助教
|
||||
<% else %>
|
||||
|
||||
<% end %>
|
||||
|
|
|
@ -20,9 +20,11 @@
|
|||
<label>
|
||||
<% if @project.project_type == 1 %>
|
||||
<% if role == Role.find(3) %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>Teacher
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>老师
|
||||
<% elsif role == Role.find(5) %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>Student
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>学生
|
||||
<% elsif role == Role.find(7) %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>助教
|
||||
<% elsif role == Role.find(4)%>
|
||||
<% else %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %><%=h role %>
|
||||
|
@ -59,11 +61,11 @@
|
|||
<% if @project.project_type == 1 %>
|
||||
|
||||
<% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
|
||||
Teacher
|
||||
老师
|
||||
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
|
||||
Student
|
||||
学生
|
||||
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %>
|
||||
TA
|
||||
助教
|
||||
<% else %>
|
||||
|
||||
<% end %>
|
||||
|
@ -88,9 +90,31 @@
|
|||
:html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }}
|
||||
) do |f| %>
|
||||
|
||||
<p><% roles.each do |role| %>
|
||||
<label><%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
|
||||
:disabled => member.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %></label><br />
|
||||
<p><% roles.each do |role| %>
|
||||
<% if @project.project_type ==1 %>
|
||||
|
||||
<% if role == Role.find(3) %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>老师
|
||||
<% elsif role == Role.find(5) %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>学生
|
||||
<% elsif role == Role.find(7) %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>助教
|
||||
<% elsif role == Role.find(4) %>
|
||||
<% else %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<label>
|
||||
<% if role == Role.find(3) %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>Manager
|
||||
<% elsif role == Role.find(5) %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>Reporter
|
||||
<% elsif role == Role.find(4) %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>Developer
|
||||
<% elsif role == Role.find(7) %>
|
||||
<% else %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</label>
|
||||
<% end %></p>
|
||||
<%= hidden_field_tag 'membership[role_ids][]', '' %>
|
||||
<p><%= submit_tag l(:button_change), :class => "small" %>
|
||||
|
|
Loading…
Reference in New Issue