socialforge/app/views/projects/_course_form.html.erb

266 lines
15 KiB
Plaintext

<% object = [] %>
<% object << 'project' %>
<% object << 'course' %>
<%= error_messages_for object %>
<!--[form:project]-->
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;" %></p>
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %></p><!--by young-->
<!-- <p><%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH %>
<% unless @project.identifier_frozen? %>
<em class="info"><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %></em>
<% end %></p> -->
<%= f.fields_for @course do |m| %>
<!-- added by huang -->
<p style="margin-left:-10px;"><%= m.text_field :password, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<em class="info" style="margin-left:95px;"><%= l(:text_command) %></em>
<!-- added by bai 增加了“年度”和“学期” -->
<p><table><tr><td>
<% unless @course.nil? %>
<% if @course.time == 2008 %>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<td class="info" style="width: 10px">
<%= select_tag 'time', "<option value = '2008' selected='selected'>2008</option>
<option value = '2009'>2009</option>
<option value = '2010'>2010</option>
<option value = '2011'>2011</option>
<option value = '2012'>2012</option>
<option value = '2013'>2013</option>
<option value = '2014'>2014</option>
<option value = '2015'>2015</option>
<option value = '2016'>2016</option>
<option value = '2017'>2017</option>".html_safe %></td></tr></table></p>
<% elsif @course.time == 2009 %>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<td class="info" style="width: 10px">
<%= select_tag 'time', "<option value = '2008'>2008</option>
<option value = '2009' selected='selected'>2009</option>
<option value = '2010'>2010</option>
<option value = '2011'>2011</option>
<option value = '2012'>2012</option>
<option value = '2013'>2013</option>
<option value = '2014'>2014</option>
<option value = '2015'>2015</option>
<option value = '2016'>2016</option>
<option value = '2017'>2017</option>".html_safe %></td></tr></table></p>
<% elsif @course.time == 2010 %>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<td class="info" style="width: 10px">
<%= select_tag 'time', "<option value = '2008'>2008</option>
<option value = '2009'>2009</option>
<option value = '2010' selected='selected'>2010</option>
<option value = '2011'>2011</option>
<option value = '2012'>2012</option>
<option value = '2013'>2013</option>
<option value = '2014'>2014</option>
<option value = '2015'>2015</option>
<option value = '2016'>2016</option>
<option value = '2017'>2017</option>".html_safe %></td></tr></table></p>
<% elsif @course.time == 2011 %>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<td class="info" style="width: 10px">
<%= select_tag 'time', "<option value = '2008'>2008</option>
<option value = '2009'>2009</option>
<option value = '2010'>2010</option>
<option value = '2011' selected='selected'>2011</option>
<option value = '2012'>2012</option>
<option value = '2013'>2013</option>
<option value = '2014'>2014</option>
<option value = '2015'>2015</option>
<option value = '2016'>2016</option>
<option value = '2017'>2017</option>".html_safe %></td></tr></table></p>
<% elsif @course.time == 2012 %>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<td class="info" style="width: 10px">
<%= select_tag 'time', "<option value = '2008'>2008</option>
<option value = '2009'>2009</option>
<option value = '2010'>2010</option>
<option value = '2011'>2011</option>
<option value = '2012' selected='selected'>2012</option>
<option value = '2013'>2013</option>
<option value = '2014'>2014</option>
<option value = '2015'>2015</option>
<option value = '2016'>2016</option>
<option value = '2017'>2017</option>".html_safe %></td></tr></table></p>
<% elsif @course.time == 2013 %>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<td class="info" style="width: 10px">
<%= select_tag 'time', "<option value = '2008'>2008</option>
<option value = '2009'>2009</option>
<option value = '2010'>2010</option>
<option value = '2011'>2011</option>
<option value = '2012'>2012</option>
<option value = '2013' selected='selected'>2013</option>
<option value = '2014'>2014</option>
<option value = '2015'>2015</option>
<option value = '2016'>2016</option>
<option value = '2017'>2017</option>".html_safe %></td></tr></table></p>
<% elsif @course.time == 2014 %>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<td class="info" style="width: 10px">
<%= select_tag 'time', "<option value = '2008'>2008</option>
<option value = '2009'>2009</option>
<option value = '2010'>2010</option>
<option value = '2011'>2011</option>
<option value = '2012'>2012</option>
<option value = '2013'>2013</option>
<option value = '2014' selected='selected'>2014</option>
<option value = '2015'>2015</option>
<option value = '2016'>2016</option>
<option value = '2017'>2017</option>".html_safe %></td></tr></table></p>
<% elsif @course.time == 2015 %>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<td class="info" style="width: 10px">
<%= select_tag 'time', "<option value = '2008'>2008</option>
<option value = '2009'>2009</option>
<option value = '2010'>2010</option>
<option value = '2011'>2011</option>
<option value = '2012'>2012</option>
<option value = '2013'>2013</option>
<option value = '2014'>2014</option>
<option value = '2015' selected='selected'>2015</option>
<option value = '2016'>2016</option>
<option value = '2017'>2017</option>".html_safe %></td></tr></table></p>
<% elsif @course.time == 2016 %>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<td class="info" style="width: 10px">
<%= select_tag 'time', "<option value = '2008'>2008</option>
<option value = '2009'>2009</option>
<option value = '2010'>2010</option>
<option value = '2011'>2011</option>
<option value = '2012'>2012</option>
<option value = '2013'>2013</option>
<option value = '2014'>2014</option>
<option value = '2015'>2015</option>
<option value = '2016' selected='selected'>2016</option>
<option value = '2017'>2017</option>".html_safe %></td></tr></table></p>
<% elsif @course.time == 2017 %>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<td class="info" style="width: 10px">
<%= select_tag 'time', "<option value = '2008'>2008</option>
<option value = '2009'>2009</option>
<option value = '2010'>2010</option>
<option value = '2011'>2011</option>
<option value = '2012'>2012</option>
<option value = '2013'>2013</option>
<option value = '2014'>2014</option>
<option value = '2015'>2015</option>
<option value = '2016'>2016</option>
<option value = '2017' selected='selected'>2017</option>".html_safe %></td></tr></table></p>
<% else %>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<td class="info" style="width: 10px">
<%= select_tag 'time', "<option value = '2008'>2008</option>
<option value = '2009'>2009</option>
<option value = '2010'>2010</option>
<option value = '2011'>2011</option>
<option value = '2012'>2012</option>
<option value = '2013'>2013</option>
<option value = '2014'>2014</option>
<option value = '2015'>2015</option>
<option value = '2016'>2016</option>
<option value = '2017'>2017</option>".html_safe %></td></tr></table></p>
<% end %>
<% end %></td>
<td>
<% unless @course.nil? %>
<% if @course.term == l(:label_spring) %>
<p><table><tr>
<td class="info" style="width: 10px">
<%= select_tag 'term', "<option value = '#{l(:label_spring)}' selected='selected'>#{l(:label_spring)}</option>
<option value = '#{l(:label_summer)}'>#{l(:label_summer)}</option>
<option value = '#{l(:label_autumn)}'>#{l(:label_autumn)}</option>
<option value = '#{l(:label_winter)}'>#{l(:label_winter)}</option>".html_safe %></td></tr></table></p>
<% elsif @course.term == l(:label_summer)%>
<p><table><tr>
<td class="info" style="width: 10px">
<%= select_tag 'term', "<option value = '#{l(:label_spring)}'>#{l(:label_spring)}</option>
<option value = '#{l(:label_summer)}' selected='selected'>#{l(:label_summer)}</option>
<option value = '#{l(:label_autumn)}'>#{l(:label_autumn)}</option>
<option value = '#{l(:label_winter)}'>#{l(:label_winter)}</option>".html_safe %></td></tr></table></p>
<% elsif @course.term == l(:label_autumn)%>
<p><table><tr>
<td class="info" style="width: 10px">
<%= select_tag 'term', "<option value = '#{l(:label_spring)}'>#{l(:label_spring)}</option>
<option value = '#{l(:label_summer)}'>#{l(:label_summer)}</option>
<option value = '#{l(:label_autumn)}' selected='selected'>#{l(:label_autumn)}</option>
<option value = '#{l(:label_winter)}'>#{l(:label_winter)}</option>".html_safe %></td></tr></table></p>
<% elsif @course.term == l(:label_winter)%>
<p><table><tr>
<td class="info" style="width: 10px">
<%= select_tag 'term', "<option value = '#{l(:label_spring)}'>#{l(:label_spring)}</option>
<option value = '#{l(:label_summer)}'>#{l(:label_summer)}</option>
<option value = '#{l(:label_autumn)}'>#{l(:label_autumn)}</option>
<option value = '#{l(:label_winter)}' selected='selected'>#{l(:label_winter)}</option>".html_safe %></td></tr></table></p>
<% else %>
<p><table><tr>
<td class="info" style="width: 10px">
<%= select_tag 'term', "<option value = '#{l(:label_spring)}'>#{l(:label_spring)}</option>
<option value = '#{l(:label_summer)}'>#{l(:label_summer)}</option>
<option value = '#{l(:label_autumn)}'>#{l(:label_autumn)}</option>
<option value = '#{l(:label_winter)}'>#{l(:label_winter)}</option>".html_safe %></td></tr></table></p>
<% end %>
<% end %></td></tr></table></p>
<!-- end -->
<% end %>
<p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;"><%= f.check_box :is_public, :style => "margin-left:10px;" %><%= l(:label_public_info) %></em></p>
<p style="display:none;"><%= f.text_field :project_type, :value => 1 %></p>
<%= wikitoolbar_for 'project_description' %>
<% @project.custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :project, value %></p>
<% end %>
<%= call_hook(:view_projects_form, :project => @project, :form => f) %>
<!--[eoform:project]-->
<% unless @project.identifier_frozen? %>
<% content_for :header_tags do %>
<%= javascript_include_tag 'project_identifier' %>
<% end %>
<% end %>
<% if !User.current.admin? && @project.inherit_members? && @project.parent && User.current.member_of?(@project.parent) %>
<%= javascript_tag do %>
$(document).ready(function() {
$("#project_inherit_members").change(function(){
if (!$(this).is(':checked')) {
if (!confirm("<%= escape_javascript(l(:text_own_membership_delete_confirmation)) %>")) {
$("#project_inherit_members").attr("checked", true);
}
}
});
});
<% end %>
<% end %>