实训课程页面修改

This commit is contained in:
caishi 2017-08-25 14:35:37 +08:00
parent 3c0b9c49cb
commit d854c7aa5b
5 changed files with 52 additions and 28 deletions

View File

@ -2,7 +2,7 @@
<div class="subhead_content">
<p class="font-24 color_white subject-main-name"><%= @subject.name %>
<% if User.current.manager_of_subject?(@subject) %>
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil mt15 ml10 color-grey edit_subject_name font-18"></i></a>
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil mt15 ml10 color-grey-c edit_subject_name font-18" data-tip-down="编辑"></i></a>
<% end %>
</p>
<p class="color-light-grey-E font-16 mb30">

View File

@ -4,7 +4,7 @@
<div class="pb20 produce-content bor-bottom-greyE">
<p class="clearfix">
<% if User.current.manager_of_subject?(@subject) %>
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil fr mt10 mr5 color-grey-c edit-produce"></i></a>
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil fr mt10 mr5 color-grey-c edit-produce"data-tip-down="编辑"></i></a>
<% end %>
</p>
<div class="mt10 color-dark-grey <%= @subject.description.blank? ? 'color-light-grey' : '' %>">
@ -17,12 +17,12 @@
<% count = 0 %>
<% @stages.each_with_index do |stage, index| %>
<div class="lesson-saved-list-item pt10 pb10 bor-bottom-greyE" id="stage_div_<%= stage.id %>">
<p class="clearfix">
<p class="clearfix title-line">
<i class="fa fa-pause-circle color-light-green font-16 transform90"></i>
<span class="font-16 font-bd">第<%= index + 1 %>章&nbsp;&nbsp;<%= stage.name %></span>
<% if @subject.status == 0 && User.current.manager_of_subject?(@subject) %>
<a href="javascript:void(0);" class="fr" onclick="edit_stage(<%= stage.id %>)"><i class="fa fa-pencil mt8 color-grey-c delete"></i></a>
<a href="javascript:void(0);" class="fr" onclick="delete_confirm_box_2('<%= stage_path(stage) %>', '确定要删除该阶段吗?');"><i class="fa fa-trash mt8 mr10 color-grey-c edit"></i></a>
<a href="javascript:void(0);" class="fr" onclick="edit_stage(<%= stage.id %>)"><i class="fa fa-pencil mt8 color-grey-c edit" data-tip-down="编辑"></i></a>
<a href="javascript:void(0);" class="fr" onclick="delete_confirm_box_2('<%= stage_path(stage) %>', '确定要删除该阶段吗?');"><i class="fa fa-trash mt8 mr10 color-grey-c delete" data-tip-down="删除"></i></a>
<% else %>
<a href="javascript:void(0);" onclick="for_paragraph(this)" class="fr"><i class="fa fa-sort-down mt8 color-grey-c"></i></a>
<% end %>
@ -34,27 +34,27 @@
<div class="clearfix pt10 pb10 ml20 pl10 mb10 paragraph" id="stage_shixun_<%= shixun.id %>" style="cursor: pointer;" onclick="shixun_link('<%= shixun.identifier %>')">
<li class="fl li-width63">
<i class="fa fa-sort-up color-grey-c fl mt5 mr10 transform90 font-18"></i>
<span class="color-grey3"><%= shixun.name %></span>
<span class="color-grey3 paragraph_name">1-1&nbsp;&nbsp;<%= shixun.name %></span>
</li>
<li class="fr mr20">
<li class="fr mr20 status_li">
<% if @subject.status < 2 %>
<span class="color-grey"><%= shixun.shixun_status %></span>
<span class="color-grey paragraph_status"><%= shixun.shixun_status %></span>
<% else %>
<% case my_shixun_status(shixun, User.current) %>
<% when '已通关' %>
<span>已通关</span>&nbsp;&nbsp;<i class="fr fa fa-check-circle color-light-green font-18 mr5 mt5" title="已通关"></i>
<span class="status_sx">已通关</span>&nbsp;&nbsp;<i class="fr fa fa-check-circle color-light-green font-18 mr5 mt5" title="已通关"></i>
<% when '未通关' %>
<span>未通关</span>&nbsp;&nbsp;<i class="fr fa fa-pause-circle color-orange font-18 mr5 mt5" title="未通关"></i>
<span class="status_sx">未通关</span>&nbsp;&nbsp;<i class="fr fa fa-play-circle color-light-green font-18 mr5 mt5" title="未通关"></i>
<% when '未开启' %>
<span>未开启</span>&nbsp;&nbsp;<i class="fr fa fa-play-circle color-grey-c font-18 mr5 mt5" title="未开启"></i>
<span class="status_sx">未开启</span>&nbsp;&nbsp;<i class="fr fa fa-play-circle color-grey-c font-18 mr5 mt5" title="未开启"></i>
<% end %>
<% end %>
<% if shixun.status > 1 %>
<% myshixun = Myshixun.where(:user_id => User.current.id, :shixun_id => shixun.id).first %>
<% if myshixun.blank? %>
<%= link_to "开始实战", operation_shixun_path(shixun, :myshixun_id => myshixun.try(:id)), :class => "task-btn task-btn-orange", :id => "shixun_operation", :remote => true %>
<%= link_to "开始实战", operation_shixun_path(shixun, :myshixun_id => myshixun.try(:id)), :class => "task-btn task-btn-orange ", :style=>"display: none", :id => "shixun_operation", :remote => true %>
<% else %>
<%= link_to "继续实战", operation_shixun_path(shixun, :myshixun_id => myshixun.try(:id)), :class => "task-btn task-btn-orange", :id => "shixun_operation", :remote => true %>
<%= link_to "继续实战", operation_shixun_path(shixun, :myshixun_id => myshixun.try(:id)), :class => "task-btn task-btn-orange", :style=>"display: none", :id => "shixun_operation", :remote => true %>
<% end %>
<% end %>
</li>
@ -111,22 +111,20 @@
<div class="edu-class-right-box ml15 mb20 user_bg_shadow bor-grey-e pl15 pt15 pr15">
<p class="font-16">学习须知
<% if User.current.manager_of_subject?(@subject) %>
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil fr mt10 mr5 color-grey-c edit-produce font-12"></i></a>
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil fr mt10 mr5 color-grey-c edit-produce font-12"data-tip-down="编辑"></i></a>
<% end %>
</p>
<p class="mt10 mb10 color-dark-grey"><%= @subject.learning_notes.blank? ? "暂未填写" : @subject.learning_notes %></p>
</div>
<div class="edu-class-right-box ml15 user_bg_shadow bor-grey-e pl15 pt15 pr15">
<p class="font-16">教学名师<i class="fa fa-pencil fr mt10 mr5 color-grey-c edit-produce font-12"></i></p>
<div style="text-align: center" class="bor-bottom-greyE">
<p class="font-16">教学名师<i class="fa fa-pencil fr mt10 mr5 color-grey-c edit-produce font-12"data-tip-down="编辑" onclick="edit_produce();"></i></p>
<div style="text-align: center" class="bor-bottom-greyE mb10">
<p style="line-height: 15px"><%= image_tag(url_to_avatar(@subject.user), :width =>"40", :height => "40", :class => "bor-radius-all", :alt=>"头像") %></p>
<p style="line-height: 15px"><%= @subject.user.try(:show_name) %></p>
<p style="line-height: 27px" class="color-dark-grey font-12"><%= @subject.user.school_name + @subject.user.identity %></p>
</div>
<p class="mt10 mb10 color-dark-grey"><%= @subject.user.user_extensions.brief_introduction.blank? ? "暂未填写" : @subject.user.user_extensions.brief_introduction %></p>
<textarea class="undis with100 panel-box-sizing">
数据结构是计算机存储、组织数据的方式。数据结构是指相互之间存在一种或多种特定关系的数据元素的集合。通常情况下,精心选择的数据结构可以带来更高的运行或者存储效率。数据结构往往同高效的检索算法和索引技术有关。
</textarea>
<p class="mb10 color-dark-grey produce"><%= @subject.user.user_extensions.brief_introduction.blank? ? "暂未填写" : @subject.user.user_extensions.brief_introduction %></p>
<textarea class="mb10 with100 panel-box-sizing produce_text undis" style="min-height: 100px;"></textarea>
</div>
</div>
<script>
@ -153,7 +151,31 @@
$("#stage_name_notice").hide();
}
});
$(".paragraph").hover(function(){
if($(this).find(".status_li a").length>0){
$(this).find(".status_li a").show();
$(this).find(".status_li span").hide();
}
},function(){
$(this).find(".status_li a").hide();
$(this).find(".status_li span").show();
})
$(".produce_text").blur(function(){
$(this).siblings(".produce").show();
$(this).siblings(".produce").html($(".produce_text").val());
$(this).hide();
})
});
function edit_produce(){
$(".produce").hide();
$(".produce_text").show();
$(".produce_text").val($(".produce").html());
$(".produce_text").focus();
}
//编辑列表里右上角的删除icon删除单个实训
function deleidtstageitem(item){
$(item).parent(".task-index-list-box-all").remove();

View File

@ -117,7 +117,7 @@ a:hover.task-btn {background: #c3c3c3; color: #666;}
a.task-btn-green{background: #29bd8b; color: #fff!important;}
a:hover.task-btn-green{background: #19b17e;}
a.task-btn-orange{ background:#fc8675; color:#fff !important;}
a:hover.task-btn-orange{ background:#e27869;}
a:hover.task-btn-orange{ background:#fc8675;}
a.task-btn-blue{background: #3498db; color:#fff!important;}
a:hover.task-btn-blue{background: #5faee3;color:#fff;}
a.task-btn-grey{background-color: #d4d6d8; color: #4d555d!important;}

View File

@ -1,5 +1,6 @@
/*------课程实训首页---------*/
.header-color{padding: 30px;background: linear-gradient(to right, rgb(68, 190, 164) 0%, rgb(62, 158, 207) 100%);}
.header-color{padding: 30px;background:#FCA24B ;}
/*linear-gradient(to right, rgb(68, 190, 164) 0%, rgb(62, 158, 207) 100%)*/
.box_bg_shandow{box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);}
.active-class .content .pre_sub-con{width:23.87%;margin: 0 1.5% 2.55% 0px;height: 269px;}
@ -37,16 +38,16 @@
.subject-produce{outline: none;line-height: 1.5;width: 100%;border: none;background: none;height: 30px;}
.stage-info-line:hover{background-color:rgba(142,212,254,0.3)}
.lesson-saved-list-item{background-color: #FFFFFF}
.lesson-saved-list-item:hover .edit,.lesson-saved-list-item:hover .delete{color:#29bd8b!important;}
.lesson-saved-list-item .title-line:hover .edit,.lesson-saved-list-item .title-line:hover .delete{color:#29bd8b!important;}
li.li-width63{width: 63%;text-align: left}
li.li-width20{width: 20%;text-align: left}
li.li-width15{width: 15%;text-align: left}
li.li-width7{width: 7%;text-align: left}
.paragraph{background-color:#f3f5f7;}
.paragraph{background-color:#f3f5f7;height: 30px;}
.paragraph:hover{background-color:#a6aaab;}
.paragraph:hover span{color: #ffffff!important;}
.paragraph:hover .paragraph_status,.paragraph:hover .paragraph_name{color: #ffffff!important;}
.edu-class-right-box i:hover{color:#29bd8b!important;}
/*------课程实训首页---------*/

View File

@ -223,11 +223,12 @@ input.knowledge_frame{height:28px;line-height:28px;border:none;background:#f3f5f
.task-index{ width: 1200px; margin:0 auto;}
.task-index-head{ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15); }
/*.task-index-head-top{background-image: linear-gradient(to right, rgb(106, 177, 216) 0%, rgb(1, 74, 78) 100%);background-color: rgb(1, 70, 74); padding:30px;}*/
/*background: linear-gradient(to right, rgb(104, 177, 215) 0%, rgb(1,75,79) 100%);*/
/*background: linear-gradient(to right,#5DDAE4,#23ADC9);*/
.task-index-head-top{ padding:30px;background: -moz-linear-gradient(to right bottom, #5DDAE4, #9E87DA);}
.task-index-head-top-course{padding:30px;background: linear-gradient(to right, rgb(69, 191, 165) 0%, rgb(164, 175, 247) 100%);}
.task-index-head-top{ padding:30px;background:#FCA24B;}
.task-index-head-top-course{padding:30px;background:#FCA24B}
/*linear-gradient(to right, rgb(69, 191, 165) 0%, rgb(164, 175, 247) 100%);*/
.task-inde-head-title{ color:#fff; }
.task-index-head-info{ background:#fff; padding:10px 30px;}
.task-index-head-info li{ width:100px; float: left; text-align: center; color:#666;}