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/show.html.erb

268 lines
14 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<%= javascript_include_tag 'baiduTemplate' %>
<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" %> > <%= @syllabus.title %></p>
<div class="edu-class-box pr">
<%# if !(@is_syllabus_admin || @is_syllabus_member) %>
<!--<div class="syllabus_tip_box fontGrey2" style="left:-190px; top:140px;">-->
<!--<em></em>-->
<!--<span></span>-->
<!--<p>-->
<!--私有资源和题库:<br/>仅对本课程的班级成员可见<br/><br/>公共资源和题库:<br/>对所有用户可见-->
<!--</p>-->
<!--</div>-->
<%# end %>
<div class="edu-class-top clearfix mb20 user_bg_shadow">
<ul class="fl edu-class-top-info" style="width: 100%">
<li class="mb10 fl">
<span class="font-24 font-bold fl"><%= @syllabus.title %></span>
<%# if @is_syllabus_admin %>
<!--<a href="<%#= edit_syllabus_path(@syllabus) %>" title="编辑" class="font-24 font-bold link-color-grey fl">
<i class="fa fa-edit ml15 " aria-hidden="true"></i>
</a>-->
<%# end %>
<span class="color-grey font-14 ml15 task-hide fl mt10" style="width:300px; display: block;line-height: 35px"><%= @syllabus.eng_name %></span>
</li>
<% if @is_syllabus_admin %>
<li class="fr">
<a href="<%= edit_syllabus_path(@syllabus) %>" class="font-24 font-bold color-grey fl">
<i class="fa fa-edit ml15 " aria-hidden="true" data-tip-down="编辑"></i>
</a>
</li>
<% end %>
<li class="color-grey font-12 clearfix">
<span class="fr"><%= @syllabus.user.user_extensions.school.blank? ? '' : @syllabus.user.user_extensions.school.name %></span>
<% if @syllabus.major_level %>
<span><%= @syllabus.syllabus_major_level %></span>
<span class="ml15"><%= @syllabus.syllabus_discipline_category %></span>
<span class="ml15"><%= @syllabus.syllabus_first_level_discipline %></span>
<% if @syllabus.major %>
<span class="ml15"><%= @syllabus.syllabus_major %></span>
<% end %>
<% end %>
<span class="ml15 <%= @syllabus.syllabus_type_str ? '' : 'none' %>"><%= @syllabus.syllabus_type_str %></span></li>
</ul>
<!--
<div class="edu-class-top-img fr edu-position" >
<img src="../images/bigdata/edu-class/edu-class-img.jpg" width="260" height="140">
<% if @is_syllabus_member %>
<a href="javascript:void(0)" class="edu-class-right-add edu-undis">
<span>更换图片</span>
</a>
<% end %>
</div>
-->
<%# if @is_syllabus_teacher || @is_authen_teacher %>
<%#= link_to '选用', choose_user_course_syllabus_path(@syllabus, :type => 'A'), :class => 'task-btn task-btn-orange fr ml20', :style => '', :remote => true %>
<%# end %>
</div>
<div class="edu-class-inner mb20">
<div class="with65 fl">
<div class="edu-tab clearfix mb20 user_bg_shadow">
<ul id="edu-tab-nav" class="back-orange-01 bor-radius-upper">
<p class="fl ml15 font-16 color_white" style="line-height: 47px;">授课大纲</p>
<a href="javascript:void(0);" style="line-height: 47px;" id="edit_sy_des" class="fr font-16 mr15"><i class="fa fa-edit color_white" data-tip-down="编辑"></i></a>
<a href="javascript:void(0)" style="line-height: 47px;" id="save_sy_des" class="color_white font-16 fr mr15 undis"><i class="fa fa-floppy-o" data-tip-down="保存"></i></a>
<a href="javascript:void(0)" style="line-height: 47px;" id="cancel_edit_sy_des" class="color_white font-16 fr mr15 undis"><i class="fa fa-undo" data-tip-down="取消"></i></a>
<!--<li id="edu-tab-nav-1" class="new-tab-nav" onclick="HoverLi(1);">
<a href="javascript:void(0);" class="tab_type color_white font-16">授课大纲</a>
</li>
<li id="edu-tab-nav-2" class="new-tab-nav">-->
<!--<%#= link_to '课程资源库', syllabus_resources_syllabus_path(@syllabus), :remote => true, :class => 'tab_type' %>-->
<!--</li>-->
<!--<li id="edu-tab-nav-3" class="new-tab-nav">-->
<!--<%#= link_to '课程题库', syllabus_homeworks_syllabus_path(@syllabus), :remote => true, :class => 'tab_type' %>-->
<!--</li>-->
</ul>
<div class="cl"></div>
<div id="edu-tab-con-1">
<div id="syllabus_des_box">
<%= render :partial => 'syllabus_des' %>
</div>
<!-- <div class="edu-bg undis" id="sy_reference_edit_box">
</div>-->
</div>
<div id="edu-tab-con-2" class="undis">
</div>
<div id="edu-tab-con-3" class="undis">
<%#= render :partial => 'syllabus_homeworks', :locals => {:homeworks => nil} %>
</div>
<div class="cl"></div>
</div>
<!---参考资料---->
<div class="edu-bg user_bg_shadow mh440 mb20" id="sy_reference_show_box">
<%= render :partial => 'show_ref' %>
</div>
<div class="edu-bg undis mb20" id="sy_reference_edit_box">
</div>
</div>
<div class="with35 fr ">
<div class="edu-class-right-box ml15 mb20 user_bg_shadow">
<div class="edu-con-top clearfix bor-bottom-orange">
<p class="fl ml15">教师团队</p>
<% if @is_syllabus_admin %>
<a href="<%= add_sy_member_alert_syllabus_path(@syllabus) %>" data-remote="true" class="fr color-light-green mr15 font-14 mt3">
<i class="fa fa-plus"></i>
<span>添加教师</span>
</a>
<% end %>
<div class="edu-weixin-share fr">
<a href="javascript:void(0)" class="link-color-grey fr font-12 mr15 mt3">分享<i class="fa fa-weixin fr mt5 ml5" aria-hidden="true"></i></a>
<div class="cl"></div>
<div class="edu-weixin-hide">
<font></font>
<img src="../images/bigdata/trustie_QR.jpg" width="100" height="100" alt="微信分享" >
<p class="edu-weixin-p">用微信扫描二维码分享给你的小伙伴</p>
</div>
</div>
</div>
<div class="" id="syllabus_members_box">
<%= render :partial => "syllabus_members" %>
</div>
</div>
<div class="edu-class-right-box ml15 mb20 user_bg_shadow">
<div class="edu-con-top clearfix mb10 bor-bottom-orange">
<p class="fl ml15 ">课堂列表</p>
<% if @is_syllabus_admin %>
<a href="<%= new_course_path() %>" class="fr color-light-green mr15 font-14 mt3">
<i class="fa fa-plus"></i>
<span>新建课堂</span>
</a>
<% end %>
<!--<span class="fr mr15 color-blue font-12 mt3">正在进行</span>-->
</div>
<div class="ml15 clearfix mb10">
<a href="javascript:void(0);" class="user_course_filtrate fl mr30"><span class="user_filtrate_span1 user_filtrate_span1_bg">正在进行</span><span class="user_filtrate_span2 user_filtrate_span2_bg ml10"><%= @courses.count %></span></a>
<a href="javascript:void(0);" class="user_course_filtrate fl"><span class="user_filtrate_span1">已结束</span><span class="user_filtrate_span2 ml10"><%= @end_courses.count %></span></a>
</div>
<ul class="edu-class-list-style edu-h350-auto mh400">
<% if @courses.count == 0 %>
<p class="edu-nodata-p mb10" style="line-height: 390px">暂无</p>
<% else %>
<% @courses.each_with_index do |course, index| %>
<li class="pl15 pr15 pt10 pb10 <%= index > 19 ? 'undis' : '' %>">
<i class="fa fa-circle mr5 color-orange05 font-12"></i>
<%= link_to course.name, course_path(course), :target => '_blank' %>
</li>
<% if index == 20 %>
<a href="javascript:void(0);" onclick="show_all_members(this)" class="edu-class-right-add color-orange05" style="background:#fff; border-top:1px solid #eee; position: inherit;">
<i class="fa fa-angle-down"></i>
<span>查看全部</span>
</a>
<% end %>
<% end %>
<% end %>
</ul>
<ul class="edu-class-list-style edu-h350-auto undis mh400">
<% if @end_courses.count == 0 %>
<p class="edu-nodata-p" style="line-height: 390px">暂无</p>
<% else %>
<% @end_courses.each_with_index do |course, index| %>
<li class="pl15 pr15 pt10 pb10 <%= index > 19 ? 'undis' : '' %>">
<i class="fa fa-circle mr5 color-orange05 font-12"></i>
<%= link_to course.name, course_path(course), :target => '_blank' %>
</li>
<% if index == 20 %>
<a href="javascript:void(0);" onclick="show_all_members(this)" class="edu-class-right-add color-light-green" style="background:#fff; border-top:1px solid #eee; position: inherit;">
<i class="fa fa-angle-down"></i>
<span>查看全部</span>
</a>
<% end %>
<% end %>
<% end %>
</ul>
<!--分页-->
<%# if @is_syllabus_admin %>
<!--<a href="<%#= new_course_path() %>" class="edu-class-right-add color-light-green" style="background:#fff; border-top:1px solid #eee;">
<i class="fa fa-plus"></i>
<span>新建班级</span>
</a>-->
<%# end %>
</div>
<!--<div class="edu-class-right-box ml15 mb20 user_bg_shadow">
<div class="edu-con-top clearfix mb20">
<h2 class="fl ml15 ">班级列表</h2>
<span class="fr mr15 color-grey font-12 mt3">已结束</span>
</div>
<ul class="edu-class-list-style ml15 mr15 edu-h350-auto">
<%# if @end_courses.count == 0 %>
<p class="edu-nodata-p">暂无</p>
<%# else %>
<%# @end_courses.each do |course| %>
<li>
<i class="fa fa-caret-right mr5 color-grey"></i>
<%#= link_to course.name, course_path(course), :target => '_blank' %>
</li>
<%# end %>
<%# end %>
</ul>
</div>-->
</div>
</div>
</div>
</div>
<script id="t:sy-refer-list" type="text/html">
<li class="clearfix">
<span class="font-bd fl">参考资料</span>
<a href="javascript:void(0);" data-tip-down="增加" class="color-orange05 add_refer"><i class="fa fa-plus-circle font-16 ml10 fl mt5"></i></a>
<a href="javascript:void(0);" data-tip-down="删除" class="color-orange05 delete_refer"><i class="fa fa-times-circle font-16 ml10 fl mt5"></i></a>
<div class="cl"></div>
<div class="mb10 edu-form-border clearfix">
<label class="edu-form-label fl">书名:</label>
<input type="text" name="syllabus[book][]" class="task-form-90 task-height-40 panel-box-sizing fl edu-form-noborder" placeholder="请输入参考资料名称大学计算机第6版">
</div>
<div class="mb10 edu-form-border clearfix">
<label class="edu-form-label fl">编辑:</label>
<input type="text" name="syllabus[editor][]" class="task-form-90 task-height-40 panel-box-sizing fl edu-form-noborder" placeholder="请输入参考资料的主编等信息">
</div>
<div class="mb10 edu-form-border clearfix">
<label class="edu-form-label fl">出版社:</label>
<input type="text" name="syllabus[press][]" class="task-form-90 task-height-40 panel-box-sizing fl edu-form-noborder" placeholder="请输入参考资料的出版社和版本等信息">
</div>
</li>
</script>
<script type="text/javascript">
$(function() {
sd_create_editor_from_data(<%= @syllabus.id %>, null, "100%", "<%= @syllabus.class.to_s %>");
showNormalImage('syllabus_description_<%= @syllabus.id %>');
$("#syllabus_description_<%= @syllabus.id%> p,#syllabus_description_<%= @syllabus.id%> span,#syllabus_description_<%= @syllabus.id%> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent);
});
autoUrl('syllabus_description_<%= @syllabus.id %>');
});
function show_all_members(ele){
$(ele).siblings().show();
$(ele).hide();
}
$(".user_course_filtrate").live("click", function(ev){
$(this).parent().find(".user_filtrate_span1").removeClass("user_filtrate_span1_bg");
$(this).parent().find(".user_filtrate_span2").removeClass("user_filtrate_span2_bg");
$(this).find(".user_filtrate_span1").addClass("user_filtrate_span1_bg");
$(this).find(".user_filtrate_span2").addClass("user_filtrate_span2_bg");
var index=$(this).index();
$(".edu-class-list-style").hide();
$(".edu-class-list-style").eq(index).show();
/*$(this).find(".user_filtrate_span1").find(".course_filtrate_bg").removeClass("course_filtrate_bg");
$(ev.target).addClass("course_filtrate_bg");*/
})
</script>