修改了课程设置里面bug

角色改成英文
This commit is contained in:
huangjingquan 2013-10-10 10:36:56 +08:00
parent b0d413a216
commit 64cddc8687
4 changed files with 37 additions and 13 deletions

View File

@ -780,7 +780,7 @@ class ProjectsController < ApplicationController
project_status = ProjectStatus.find_by_project_id(@project.id) project_status = ProjectStatus.find_by_project_id(@project.id)
project_status.destroy project_status.destroy
elsif params[:project][:is_public] == '1' 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 end
respond_to do |format| respond_to do |format|

View File

@ -47,7 +47,7 @@
<table border="0"> <table border="0">
<tr> <tr>
<td align="cneter"> <td align="cneter">
<%= text_field_tag 'course_password', nil, :size => 30%></td> <%= text_field_tag 'course_password', nil, :size => 27 %></td>
<td align="center"> <td align="center">
<%= submit_tag '加入', :name => nil, :class => "bid_btn", :onclick => "hideModal(this);" %></td> <%= submit_tag '加入', :name => nil, :class => "bid_btn", :onclick => "hideModal(this);" %></td>

View File

@ -18,11 +18,11 @@
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>
<div class ="clear avatar_name"> <p> <div class ="clear avatar_name"> <p>
<% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %> <% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
Teacher 老师
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %> <% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
Student 学生
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %> <% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %>
TA 助教
<% else %> <% else %>
<% end %> <% end %>

View File

@ -20,9 +20,11 @@
<label> <label>
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>
<% if role == Role.find(3) %> <% 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) %> <% 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)%> <% elsif role == Role.find(4)%>
<% else %> <% else %>
<%= check_box_tag 'membership[role_ids][]', role.id %><%=h role %> <%= check_box_tag 'membership[role_ids][]', role.id %><%=h role %>
@ -59,11 +61,11 @@
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>
<% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %> <% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
Teacher 老师
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %> <% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
Student 学生
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %> <% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %>
TA 助教
<% else %> <% else %>
<% end %> <% end %>
@ -88,9 +90,31 @@
:html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }} :html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }}
) do |f| %> ) do |f| %>
<p><% roles.each do |role| %> <p><% roles.each do |role| %>
<label><%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role), <% if @project.project_type ==1 %>
:disabled => member.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %></label><br />
<% 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> <% end %></p>
<%= hidden_field_tag 'membership[role_ids][]', '' %> <%= hidden_field_tag 'membership[role_ids][]', '' %>
<p><%= submit_tag l(:button_change), :class => "small" %> <p><%= submit_tag l(:button_change), :class => "small" %>