2014-09-28 17:14:09 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
function get_options(value) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
2014-10-21 09:28:38 +08:00
|
|
|
url: 'http://<%= Setting.host_name%>/school/get_options/' + encodeURIComponent(value),
|
2014-09-28 17:14:09 +08:00
|
|
|
data: 'text',
|
|
|
|
success: function (data) {
|
|
|
|
$("#occupation").html(data);
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
function check() {
|
|
|
|
var regex = /^\d*$/;
|
|
|
|
if (!regex.test($("#class_period").val())) {
|
|
|
|
alert("学时只能为整数");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<% object = [] %>
|
|
|
|
<% object << 'course' %>
|
|
|
|
<%= error_messages_for object %>
|
|
|
|
<% unless @course.new_record? %>
|
|
|
|
<p><%= render :partial => "avatar/avatar_form", :locals => {source: @course} %></p>
|
|
|
|
<% end %>
|
|
|
|
<p>
|
|
|
|
<label for="course_name" style="font-size: 13px;">
|
|
|
|
<%= l(:label_tags_course_name) %>
|
|
|
|
<span class="required">* </span>
|
|
|
|
</label>
|
|
|
|
<input id="course_name" type="text" value="<%= @course.name %>" style="width:490px;size:60;" name = "course[name]" maxlength="100">
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<%= f.fields_for @course do |m| %>
|
|
|
|
<% unless @course.nil? %>
|
|
|
|
<p>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"><%= l(:label_class_period) %>
|
|
|
|
<span class="required"> * </span></span>
|
2014-10-08 17:31:42 +08:00
|
|
|
<span class="info" style="width: 10px;">
|
2014-10-09 09:07:31 +08:00
|
|
|
<%= text_field_tag :class_period, @course.class_period, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %>
|
2014-10-08 17:31:42 +08:00
|
|
|
</span>
|
2014-09-28 17:14:09 +08:00
|
|
|
<span> <strong><%= l(:label_class_hour) %></strong></span>
|
2014-11-05 14:46:01 +08:00
|
|
|
<span>
|
|
|
|
<strong>
|
|
|
|
<%= l(:label_class_hour) %>
|
|
|
|
</strong>
|
|
|
|
</span>
|
2014-09-28 17:14:09 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</p>
|
|
|
|
<% else %>
|
|
|
|
<p>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td>
|
2014-11-05 14:46:01 +08:00
|
|
|
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px">
|
2014-11-11 08:38:58 +08:00
|
|
|
<%= l(:label_class_period) %>
|
|
|
|
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px">
|
|
|
|
<%= l(:label_class_period) %>
|
|
|
|
<span class="required">
|
|
|
|
*
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px">
|
|
|
|
<%= l(:label_class_period) %>
|
|
|
|
<span class="required">
|
|
|
|
*
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<span class="info" style="width: 10px;">
|
|
|
|
<%= text_field_tag :class_period, nil, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %>
|
|
|
|
</span>
|
|
|
|
<strong>
|
|
|
|
<%= l(:label_class_hour) %>
|
|
|
|
</strong>
|
2014-10-08 17:31:42 +08:00
|
|
|
</span>
|
2014-09-28 17:14:09 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</p>
|
|
|
|
<% end %>
|
|
|
|
<p>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<% if @course != nil %>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td class="info" align="right" style="width: 86px">
|
2014-11-05 14:46:01 +08:00
|
|
|
<strong>
|
|
|
|
<%= l(:label_term) %>
|
|
|
|
<span class="required"> * </span>
|
|
|
|
</strong>
|
2014-09-28 17:14:09 +08:00
|
|
|
</td>
|
|
|
|
<td class="info" style="width: 10px">
|
|
|
|
<%= select_tag :time,options_for_select(course_time_option,@course.time), {} %>
|
|
|
|
</td>
|
|
|
|
<td class="info" style="width: 10px">
|
2014-11-05 14:46:01 +08:00
|
|
|
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %>
|
2014-09-28 17:14:09 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</p>
|
|
|
|
<p style="margin-left:-10px;">
|
2014-11-05 14:46:01 +08:00
|
|
|
<label for="course[course]_password" style="font-size: 13px;">
|
|
|
|
<%= l(:label_new_course_password) %>
|
2014-09-28 17:14:09 +08:00
|
|
|
<span class="required">*</span>
|
|
|
|
</label>
|
|
|
|
<input id="course_course_password" type="text" style="width:488px;margin-left: 10px;" value="<%= @course.password %>" size="60" name="course[password]"/>
|
|
|
|
</p>
|
2014-11-05 14:46:01 +08:00
|
|
|
<em class="info" style="margin-left:95px;">
|
|
|
|
<%= l(:text_command) %>
|
|
|
|
</em>
|
2014-09-28 17:14:09 +08:00
|
|
|
<% end %>
|
|
|
|
<p style="padding-right: 20px;">
|
|
|
|
<label for="course_description" style="font-size: 13px;">
|
|
|
|
<%= l(:label_new_course_description) %>
|
|
|
|
</label>
|
|
|
|
<span class="jstEditor">
|
|
|
|
<textarea id="course_description" class="wiki-edit" style="font-size:small;width:490px;margin-left:10px;" rows="8" name="course[description]" cols="40">
|
|
|
|
<%= @course.description %>
|
|
|
|
</textarea>
|
|
|
|
</span>
|
|
|
|
</p>
|
|
|
|
<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_course_public_info) %>
|
|
|
|
</em>
|
2014-11-03 17:00:01 +08:00
|
|
|
</p>
|
|
|
|
<p style="margin-left:-10px;">
|
|
|
|
<em style="color: #888888;display: block;font-size: 90%;font-style: normal;">
|
|
|
|
<%= f.check_box :open_student, :style => "margin-left:10px;" %>
|
|
|
|
<%= l(:label_course_open_student_info) %>
|
|
|
|
</em>
|
|
|
|
</p>
|
2014-11-05 14:46:01 +08:00
|
|
|
<p style="display:none;">
|
|
|
|
<%= f.text_field :course_type, :value => 1 %>
|
|
|
|
</p>
|
2014-09-28 17:14:09 +08:00
|
|
|
<%= wikitoolbar_for 'course_description' %>
|
|
|
|
<% @course.custom_field_values.each do |value| %>
|
|
|
|
<p><%= custom_field_tag_with_label :course, value %></p>
|
2014-11-05 14:46:01 +08:00
|
|
|
<p>
|
|
|
|
<%= custom_field_tag_with_label :course, value %>
|
|
|
|
</p>
|
2014-09-28 17:14:09 +08:00
|
|
|
<% end %>
|
|
|
|
<%= call_hook(:view_courses_form, :course => @course, :form => f) %>
|
|
|
|
<!--[eoform:course]-->
|
|
|
|
|
|
|
|
<% unless @course.extra_frozen? %>
|
|
|
|
<% content_for :header_tags do %>
|
|
|
|
<%= javascript_include_tag 'course_identifier' %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
|