You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/app/views/syllabuses/edit.html.erb

114 lines
9.1 KiB

6 years ago
<div class="edu-class-container" style="flex: 1 0 auto;">
<p class="mb10"><%= link_to User.current.show_real_name, user_path(User.current),:class => "color-grey-9" %> > <%= link_to '课堂', courses_path ,:class => "color-grey-9" %>
</p>
<div class="edu-con-top ">
<p class="ml15 color-grey">编辑课程</p>
</div>
<div class="edu-con-bg01">
<div class="edu-class-con ">
<div class="alert alert-orange mb30 ">
<button data-dismiss="alert" class="task-close fr" type="button">×</button>
课程的核心是授课大纲,您可以为一门课程创建多个不同的班级
</div>
<div class="panel-form clearfix">
<%= labelled_form_for @syllabus, :html => {:id => 'edit_syllabus'} do |f| %>
<ul>
<li class="clearfix mb20">
<label class="panel-form-label label-w20 fl" ><span class="color-orange mr5">*</span>专业层级&nbsp;&nbsp;&nbsp;&nbsp;</label>
<div class="with80 fl pr" select-for>
<input type="hidden" name="major_level" id="major_level" value="<%= @syllabus.major_level %>">
<input class="task-height-40 task-form-100 panel-box-sizing pr20 color-grey3" value="<%= @syllabus.syllabus_major_level %>" readonly placeholder="选择课程所属专业层级"/>
<div class="down-select bor-grey-e user_bg_shadow" id="major_level_option">
<p data-major="3">专科</p>
<p data-major="2">本科</p>
<p data-major="1">研究生</p>
</div>
</div>
<%#= select_tag :major_level,options_for_select(major_level_option,@syllabus.major_level), {:id=>"major_level", :class=>"fl task-height-40 task-form-80"} %>
<div class="cl"></div>
<span class="color-orange fl none" id="major_level_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>请选择课程所属专业层级</span>
</li>
<li class="clearfix mb20">
<label class="panel-form-label label-w20 fl" ><span class="color-orange mr5">*</span>学科门类&nbsp;&nbsp;&nbsp;&nbsp;</label>
<div class="with80 fl pr" select-for>
<input type="hidden" name="discipline_category_id" id="discipline_category_id" value="<%= @syllabus.discipline_category_id %>">
<input class="task-height-40 task-form-100 panel-box-sizing pr20 color-grey3" value="<%= @syllabus.syllabus_discipline_category %>" readonly placeholder="选择课程所属学科门类"/>
<div class="down-select bor-grey-e user_bg_shadow" id="discipline_category_option">
<% DisciplineCategory.where(:major_level => @syllabus.major_level).each do |dis| %>
<p data-discipline-category-id="<%= dis.id %>"><%= dis.name %></p>
<% end %>
</div>
</div>
<%#= select_tag :discipline_category_id,options_for_select(discipline_category_option(@syllabus.major_level),@syllabus.discipline_category_id), {:id=>"discipline_category_id", :class=>"fl task-height-40 task-form-80"} %>
<div class="cl"></div>
<span class="color-orange fl none" id="discipline_category_id_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>请选择课程所属学科门类</span>
</li>
<li class="clearfix mb20">
<label class="panel-form-label label-w20 fl" ><span class="color-orange mr5">*</span>一级学科&nbsp;&nbsp;&nbsp;&nbsp;</label>
<div class="with80 fl pr" select-for>
<input type="hidden" name="first_level_discipline_id" id="first_level_discipline_id" value="<%= @syllabus.first_level_discipline_id %>">
<input class="task-height-40 task-form-100 panel-box-sizing pr20 color-grey3" value="<%= @syllabus.syllabus_first_level_discipline %>" readonly placeholder="选择课程所属一级学科"/>
<div class="down-select bor-grey-e user_bg_shadow" id="first_level_discipline_option">
<% FirstLevelDiscipline.where(:discipline_category_id => @syllabus.discipline_category_id).each do |fir_dis| %>
<p data-first-level-discipline-id="<%= fir_dis.id %>"><%= fir_dis.name %></p>
<% end %>
</div>
</div>
<%#= select_tag :first_level_discipline_id,options_for_select(first_level_discipline_option(@syllabus.discipline_category_id),@syllabus.first_level_discipline_id), {:id=>"first_level_discipline_id", :class=>"fl task-height-40 task-form-80"} %>
<div class="cl"></div>
<span class="color-orange fl none" id="first_level_discipline_id_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>请选择课程所属一级学科</span>
</li>
<li class="clearfix mb20">
<label class="panel-form-label label-w20 fl" ><span class="color-orange mr5">*</span>专业名称&nbsp;&nbsp;&nbsp;&nbsp;</label>
<div class="with80 fl pr" select-for>
<input type="hidden" name="major_id" id="major_id" value="<%= @syllabus.major_id %>">
<input class="task-height-40 task-form-100 panel-box-sizing pr20 color-grey3" value="<%= @syllabus.syllabus_major %>" readonly placeholder="选择课程所属专业"/>
<div class="down-select bor-grey-e user_bg_shadow" id="syllabus_major_option">
<% Major.where(:first_level_discipline_id => @syllabus.first_level_discipline_id).each do |major| %>
<p data-major_id="<%= major.id %>"><%= major.name %></p>
<% end %>
</div>
</div>
<%#= select_tag :major_id,options_for_select(syllabus_major_option(@syllabus.first_level_discipline_id),@syllabus.major_id), {:id=>"major_id", :class=>"fl task-height-40 task-form-80"} %>
<div class="cl"></div>
<span class="color-orange fl none" id="major_id_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>请选择课程所属专业</span>
</li>
<li class="clearfix mb20">
<label class="panel-form-label label-w20 fl" ><span class="color-orange mr5">*</span>课程名称&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" name="title" maxlength="50" value="&nbsp;<%= @syllabus.title %>" id="new_syllabus_name" class="task-form-80 task-height-40 panel-box-sizing fl color-grey3" placeholder=" 例如&nbsp;&nbsp;计算机基础">
<div class="cl"></div>
<span class="color-orange fl none" id="new_syllabus_name_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>课程名称不能为空且至少有两个字符</span>
<span class="color-orange fl none" id="new_syllabus_name_repeat_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>同一个用户不能创建同名课程</span>
</li>
<li class="clearfix mb20">
<label class="panel-form-label label-w20 fl" >英文名称&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" name="eng_name" value="&nbsp;<%= @syllabus.eng_name %>" maxlength="100" id="new_syllabus_eng_name" class="task-form-80 task-height-40 panel-box-sizing fl color-grey3" placeholder=" 例如&nbsp;&nbsp;Basis of Computer Engineering">
<div class="cl"></div>
</li>
<li class="clearfix mb20">
<label class="panel-form-label label-w20 fl" >课程性质&nbsp;&nbsp;&nbsp;&nbsp;</label>
<div class="with80 fl pr" select-for>
<input type="hidden" name="syllabus_type" id="syllabus_type" value="<%= @syllabus.syllabus_type %>">
<input class="task-height-40 task-form-100 panel-box-sizing pr20 color-grey3" value="<%= @syllabus.syllabus_type_str %>" readonly placeholder="请选择课程性质"/>
<div class="down-select bor-grey-e user_bg_shadow" id="syllabus_type_option">
<p data-syllabus-type="3">专业选修课</p>
<p data-syllabus-type="2">学科必修课</p>
<p data-syllabus-type="1">公共必修课</p>
<p data-syllabus-type="5">实践选修课</p>
<p data-syllabus-type="4">实践必修课</p>
</div>
</div>
<%#= select_tag :syllabus_type,options_for_select(syllabus_type_option,@syllabus.syllabus_type), {:id=>"syllabus_type", :class=>"fl task-height-40 task-form-80"} %>
<div class="cl"></div>
</li>
<li class="clearfix" >
<a href="javascript:void(0);" class="task-btn task-btn-orange fr" onclick="submit_edit_syllabus('<%= @syllabus.id %>');">保存</a>
<%= link_to "取消",syllabus_path(@syllabus),:class => "task-btn fr mr10"%>
</li>
</ul>
<% end %>
</div>
</div>
</div>
</div>