Merge branch 'develop' into dev_cxt
This commit is contained in:
commit
a170bdf3f1
|
|
@ -42,6 +42,17 @@ class SubjectsController < ApplicationController
|
|||
redirect_to subject_path(subject)
|
||||
end
|
||||
|
||||
def edit
|
||||
render :layout => "base_edu"
|
||||
end
|
||||
|
||||
def update
|
||||
if params[:subject]
|
||||
subject = @subject.update_attributes(:name => params[:subject][:name], :description => params[:subject][:description])
|
||||
end
|
||||
redirect_to subject_path(@subject)
|
||||
end
|
||||
|
||||
def update_attr
|
||||
if params[:name]
|
||||
@subject.update_attributes(:name => params[:name])
|
||||
|
|
|
|||
|
|
@ -225,6 +225,10 @@ module ApplicationHelper
|
|||
myshixun = Myshixun.where(:shixun_id => shixun.id, :user_id => user.id).first
|
||||
if myshixun.nil?
|
||||
0
|
||||
elsif !myshixun.nil? && myshixun.games.select{|game| game.status == 2}.count == 0
|
||||
-1
|
||||
elsif myshixun.games.select{|game| game.status == 0}.count > 0
|
||||
[myshixun.games.select{|game| game.status == 0}.count + 1]
|
||||
else
|
||||
myshixun.games.select{|game| game.status == 2}.count
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,15 +5,20 @@
|
|||
<span class="btn-cir btn-cir-grey ml10 mt12 fl"><%= @challenges.count %></span>
|
||||
<% end %>
|
||||
<% if User.current.manager_of_shixun?(@shixun) && @shixun.status == 0 %>
|
||||
<a href="<%#= new_shixun_challenge_path(@shixun, :st => 2) %>" class="shixun-task-btn task-btn-green fr mt5">+单选任务</a>
|
||||
<!-- <a href="<%#= new_shixun_challenge_path(@shixun, :st => 2) %>" class="shixun-task-btn task-btn-green fr mt5">+单选任务</a>
|
||||
<a href="<%#= new_shixun_challenge_path(@shixun, :st => 1) %>" class="shixun-task-btn task-btn-green fr mr10 mt5">+多选任务</a>
|
||||
<a href="<%#= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr mr10 mt5">+编程任务</a>
|
||||
<!--<a href="<%= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr mr5" style="margin: 5px 0;">新建阶段</a>-->
|
||||
<a href="<%#= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr mr10 mt5">+编程任务</a>-->
|
||||
<a href="<%= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr mr5" style="margin: 5px 0;">新建阶段</a>
|
||||
<% end %> </div>
|
||||
<div class="panel-list shixun-panel-list">
|
||||
<% @challenges.each_with_index do |challenge, index| -%>
|
||||
<div class="clearfix shixun-panel-inner" id="shixun_index_<%= index %>">
|
||||
<h4 class="fl panel-inner-title"><i class="fa fa-dot-circle-o font-18 color-green mr10"></i><span class="color-black mr10">第<%= challenge.position %>关</span>
|
||||
<h4 class="fl panel-inner-title">
|
||||
<!--<span class="panel-inner-icon mr10 fl mt5"><i class="fa fa-code font-16 color_white"></i></span>
|
||||
<span class="panel-inner-icon mr10 fl mt5"><i class="fa fa-th-list color_white"></i></span>
|
||||
<span class="panel-inner-icon mr10 fl mt5"><img src="/images/bigdata/singel.png" style="margin-bottom: 3px"></span>-->
|
||||
<i class="fa fa-dot-circle-o font-18 color-green mr10"></i>
|
||||
<span class="color-black mr10">第<%= challenge.position %>关</span>
|
||||
<%#= link_to challenge.subject, shixun_challenge_path(@shixun.id, challenge), :target => "_blank" %>
|
||||
<% if User.current.manager_of_shixun?(@shixun) %>
|
||||
<%= link_to challenge.subject, shixun_challenge_path(@shixun, challenge), :target => "_blank" %>
|
||||
|
|
|
|||
|
|
@ -31,38 +31,41 @@
|
|||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<ul id="select_more">
|
||||
<li class="clearfix mb10">
|
||||
<label class="panel-form-label fl"><span class="mr10">A.</span></label>
|
||||
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">
|
||||
<input type="checkbox" name="select_more[]" value="" id="select_more_0" class="ml-3 mr5 magic-checkbox">
|
||||
<label for="select_more_0" style="top:0px">网络层</label>
|
||||
</div>
|
||||
</li>
|
||||
<li class="clearfix mb10">
|
||||
<label class="panel-form-label fl"><span class="mr10">B.</span></label>
|
||||
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">
|
||||
<input type="checkbox" name="select_more[]" value="" id="select_more_1" class="ml-3 mr5 magic-checkbox">
|
||||
<label for="select_more_1" style="top:0px">网络层</label>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<ul id="select_single">
|
||||
<li class="clearfix mb10">
|
||||
<label class="panel-form-label fl"><span class="mr10">A.</span></label>
|
||||
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">
|
||||
<input name="select_single[]" value="" type="radio" id="select_single_0" class="ml-3 mr5 magic-radio">
|
||||
<label for="select_single_0" style="top:0px">网络层</label>
|
||||
</div>
|
||||
</li>
|
||||
<li class="clearfix mb10">
|
||||
<label class="panel-form-label fl"><span class="mr10">B.</span></label>
|
||||
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">
|
||||
<input name="select_single[]" value="" type="radio" id="select_single_1" class="ml-3 mr5 magic-radio">
|
||||
<label for="select_single_1" style="top:0px">网络层</label>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<!--显示单项多项-->
|
||||
<!--<ul id="select_more">-->
|
||||
<!--<li class="clearfix mb10">-->
|
||||
<!--<label class="panel-form-label fl"><span class="mr10">A.</span></label>-->
|
||||
<!--<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">-->
|
||||
<!--<input type="checkbox" name="select_more[]" value="" id="select_more_0" class="ml-3 mr5 magic-checkbox">-->
|
||||
<!--<label for="select_more_0" style="top:0px">网络层</label>-->
|
||||
<!--</div>-->
|
||||
<!--</li>-->
|
||||
<!--<li class="clearfix mb10">-->
|
||||
<!--<label class="panel-form-label fl"><span class="mr10">B.</span></label>-->
|
||||
<!--<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">-->
|
||||
<!--<input type="checkbox" name="select_more[]" value="" id="select_more_1" class="ml-3 mr5 magic-checkbox">-->
|
||||
<!--<label for="select_more_1" style="top:0px">网络层</label>-->
|
||||
<!--</div>-->
|
||||
<!--</li>-->
|
||||
<!--</ul>-->
|
||||
<!--<ul id="select_single">-->
|
||||
<!--<li class="clearfix mb10">-->
|
||||
<!--<label class="panel-form-label fl"><span class="mr10">A.</span></label>-->
|
||||
<!--<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">-->
|
||||
<!--<input name="select_single[]" value="" type="radio" id="select_single_0" class="ml-3 mr5 magic-radio">-->
|
||||
<!--<label for="select_single_0" style="top:0px">网络层</label>-->
|
||||
<!--</div>-->
|
||||
<!--</li>-->
|
||||
<!--<li class="clearfix mb10">-->
|
||||
<!--<label class="panel-form-label fl"><span class="mr10">B.</span></label>-->
|
||||
<!--<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">-->
|
||||
<!--<input name="select_single[]" value="" type="radio" id="select_single_1" class="ml-3 mr5 magic-radio">-->
|
||||
<!--<label for="select_single_1" style="top:0px">网络层</label>-->
|
||||
<!--</div>-->
|
||||
<!--</li>-->
|
||||
<!--</ul>-->
|
||||
</div>
|
||||
<%# if @challenge.st == 1 %>
|
||||
|
||||
|
|
|
|||
|
|
@ -32,13 +32,13 @@
|
|||
<span style="display: none" class="c_red ml95" id="new_shixun_pass">过关任务不能为空</span>
|
||||
</li>
|
||||
|
||||
<ul>
|
||||
<!--<ul>
|
||||
<li class="clearfix mb10" >
|
||||
<label class="panel-form-label fl"><span class="add-option-item fr mr10 color-grey" name="option_span">A</span></label>
|
||||
<div class="fl panel-box-sizing add-option-input"><a title="新增" class="option_icon_add">新增选项</a></div>
|
||||
</li>
|
||||
<li class="clearfix" ><label class="fl" style="margin-left: 46px">温馨提示:点击选项,可以直接设置答案</label><label class="fr">标准答案:<span id="current-option" class="color-orange">请点击正确选项</span></label></li>
|
||||
</ul>
|
||||
</ul>-->
|
||||
<li class="clearfix">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="challenge_update()">保存</a>
|
||||
<% if params[:action] == "new" %>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="task-index-head mt20 mb20">
|
||||
<div class="task-index-head-top-course">
|
||||
<h2 class="fl task-inde-head-title">在线课堂</h2>
|
||||
<%= link_to "<span class='font-22'>+</span> 创建课堂".html_safe, new_course_path, :class => "fr color_white font-20" %>
|
||||
<%= link_to "+ 新建".html_safe, new_course_path, :class => "task-btn task-btn-green fr mt6" %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<ul class="task-index-head-info clearfix">
|
||||
|
|
|
|||
|
|
@ -86,11 +86,13 @@
|
|||
<div class="-flex -relative">
|
||||
<div class="split-panel -fit -vertical">
|
||||
<div class="-layout -stretch -fit -vertical centerH">
|
||||
<div class="-layout -vertical -flex -relative -bg-black -flex-basic60" id="games_repository_contents" style="overflow:hidden;">
|
||||
<div class="-layout -vertical -flex -relative -bg-black -flex-basic70" id="games_repository_contents" style="overflow:hidden;">
|
||||
<%= render :partial => 'games/repository' %>
|
||||
</div>
|
||||
<!--拖拽增加结构---------------------------------------->
|
||||
<div class="h-center"></div>
|
||||
<div class="h-center">
|
||||
<div class="-changebg -bg-black" id="-bg-change-color"></div>
|
||||
</div>
|
||||
<!------------------------------------------------------>
|
||||
<div class="split-panel--second -layout -vertical -flex -relative -bg-black -flex-basic40" id="games_valuation_contents">
|
||||
<%= render :partial => 'games/game_results' %>
|
||||
|
|
|
|||
|
|
@ -71,8 +71,13 @@
|
|||
g_l('codotab_con_'+i).className='undis';
|
||||
|
||||
}
|
||||
n == 2 ? $("#games_repository_contents").removeClass("-bg-black").addClass("-bg-weightblack")
|
||||
: $("#games_repository_contents").removeClass("-bg-weightblack").addClass("-bg-black");
|
||||
if(n==2){
|
||||
$("#games_repository_contents").removeClass("-bg-black -flex-basic70").addClass("-bg-weightblack -flex-basic60");
|
||||
$("#-bg-change-color").removeClass("-bg-black").addClass("-bg-weightblack");
|
||||
}else{
|
||||
$("#games_repository_contents").removeClass("-bg-weightblack -flex-basic60").addClass("-bg-black -flex-basic70");
|
||||
$("#-bg-change-color").removeClass("-bg-weightblack").addClass("-bg-black");
|
||||
}
|
||||
g_l('codotab_con_'+n).className='dis -relative';
|
||||
g_l('codetab_nav_'+n).className='blacktab_hover';
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<% else %>
|
||||
<% @discusses.each do |dis| %>
|
||||
<div class="comments_item_content comment_item_bottom clearfix mt5" onmouseover="$('#discuss_opr_<%= dis.id %>').show();$('#child_discuss_opr_<%= dis.id %>').show();" onmouseout="$('#discuss_opr_<%= dis.id %>').hide();$('#child_discuss_opr_<%= dis.id %>').hide();">
|
||||
<%= link_to image_tag(url_to_avatar(dis.user), :alt => "头像"), user_path(dis.user), :target => '_blank' %>
|
||||
<%= link_to image_tag(url_to_avatar(dis.user), :alt => "头像", :width => 60, :height => 60), user_path(dis.user), :target => '_blank' %>
|
||||
<div class="fr comment_item_one">
|
||||
<p class="clearfix pl8">
|
||||
<%= link_to dis.user.show_name, user_path(dis.user), :class => "fl link-color-grey" %>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
</div>
|
||||
<div class="sidebar-con">
|
||||
<div class="list">
|
||||
<i class="fa fa-plus-circle color-light-green font-20 pl20 pr10 pt5" aria-hidden="true"></i><span>教学</span>
|
||||
<i class="fa fa-plus-circle color-light-green font-20 pl15 pr10 pt5" aria-hidden="true"></i><span>教学</span>
|
||||
<ul class="color-grey">
|
||||
<li><a href="<%= syllabuses_path() %>" target="_blank" >我的课堂</a></li>
|
||||
<li><a href="<%= new_course_path(:host=> Setting.host_course) %>" target="_blank" >新建班级</a></li>
|
||||
|
|
@ -20,14 +20,14 @@
|
|||
</ul>
|
||||
</div>-->
|
||||
<div class="list">
|
||||
<i class="fa fa-map color-light-green font-20 pl20 pr10 pt5" aria-hidden="true"></i><span>题库</span>
|
||||
<i class="fa fa-map color-light-green font-20 pl15 pr10 pt5" aria-hidden="true"></i><span>题库</span>
|
||||
<ul class="color-grey">
|
||||
<li><%= link_to "我的题库", homework_bank_index_path(), :target => "_blank" %></li>
|
||||
<li><%= link_to "公共题库", homework_bank_index_path(:type => 2), :target => "_blank" %></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list">
|
||||
<i class="fa fa-gamepad color-light-green font-20 pl20 pr10 pt5" aria-hidden="true"></i><span>实训</span>
|
||||
<i class="fa fa-gamepad color-light-green font-20 pl15 pr10 pt5" aria-hidden="true"></i><span>实训</span>
|
||||
<ul class="color-grey">
|
||||
<li><%= link_to "我的实训", shixuns_user_path(User.current), :target => "_blank" %></li>
|
||||
<li><%= link_to "新建实训", new_shixun_path, :target => "_blank" %></li>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
$(function() {
|
||||
$(".sidebar").hover(function() {
|
||||
$(this).css({
|
||||
width:'60px'
|
||||
width:'50px'
|
||||
}).stop().animate({
|
||||
width:'120px'
|
||||
}, 400);
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
$(this).css({
|
||||
width:'120px'
|
||||
}).stop().animate({
|
||||
width:'60px'
|
||||
width:'50px'
|
||||
}, 400);
|
||||
$(".sidebar-con .list ul li").css({
|
||||
paddingTop:'15px'
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
//页面缩放时调整整个页面和左侧导航栏的距离
|
||||
$(window).resize(function() {
|
||||
if($(window).width()<1300){
|
||||
$(".newContainer").css("padding-left","60px");
|
||||
$(".newContainer").css("padding-left","50px");
|
||||
}else{
|
||||
$(".newContainer").css("padding-left","0px");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="task-index-head mt20 mb20 user_bg_shadow">
|
||||
<div class="task-index-head-top">
|
||||
<h2 class="fl task-inde-head-title">全部实训</h2>
|
||||
<%= link_to "<span class='font-22'>+</span> 创建实训".html_safe, new_shixun_path, :class => "fr color_white font-20" %>
|
||||
<%= link_to "+ 新建".html_safe, new_shixun_path, :class => "task-btn task-btn-green fr mt6" %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<ul class="task-index-head-info clearfix">
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
<span class="fl color-grey check_item">筛选条件</span>
|
||||
<div class="fl" style="margin-top:7px">
|
||||
<li class="edu-dropdown fl ml15 mr5" id="first_select" style="width: 70px">
|
||||
<a href="javascript:void(0);" class="edu-dropdown-toggle" id="all_status">所有状态<i class="fa fa-caret-down ml5"></i></a>
|
||||
<a href="javascript:void(0);" class="edu-dropdown-toggle color-grey3" id="all_status">所有状态<i class="fa fa-caret-down ml5"></i></a>
|
||||
<ul class="edu-dropdown-menu" id="all_status_list" style="display: none;">
|
||||
<li>
|
||||
<input type="radio" class="undis" name="shixun_status" id="status_0" value="0">
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@
|
|||
</p>
|
||||
<div class="clearfix">
|
||||
<p class="fl font-24 color_white subject-main-name"><%= @subject.name %></p>
|
||||
<% if User.current.manager_of_subject?(@subject) && @subject.status == 0 %>
|
||||
<i class="fa fa-pencil mt15 ml10 color_white edit_subject_name fl font-18"></i>
|
||||
<% end %>
|
||||
<%# if User.current.manager_of_subject?(@subject) && @subject.status == 0 %>
|
||||
<!--<i class="fa fa-pencil mt15 ml10 color_white edit_subject_name fl font-18"></i>-->
|
||||
<%# end %>
|
||||
<% if !User.current.manager_of_subject?(@subject) || @subject.status > 1 %>
|
||||
<ul class="last-all-count fr">
|
||||
<li class="fl mr30"><i class="fa fa-tasks color_white" title="实训"></i><span class="ml5 color_white"><%= @subject.stage_shixuns.count %></span></li>
|
||||
<li class="fl mr30"><i class="fa fa-users color_white" title="实训阶段"></i><span class="ml5 color_white"><%= @subject.subject_challenges %></span></li>
|
||||
<li class="fl mr30"><i class="fa fa-gamepad color_white" title="实训"></i><span class="ml5 color_white"><%= @subject.stage_shixuns.count %></span></li>
|
||||
<li class="fl mr30"><i class="fa fa-tasks color_white" title="实训阶段"></i><span class="ml5 color_white"><%= @subject.subject_challenges %></span></li>
|
||||
<li class="fl mr30"><i class="fa fa-viacoin color_white" title="实训总积分"></i><span class="ml5 color_white"><%= @subject.subject_score %></span></li>
|
||||
</ul>
|
||||
<% elsif @subject.status == 0 && @subject.stages.count > 0 && User.current.manager_of_subject?(@subject) %>
|
||||
|
|
@ -27,35 +27,39 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
//编辑套件名称
|
||||
$(".edit_subject_name").on("click",function(){
|
||||
$(".subject-main-name").attr("contenteditable","true");
|
||||
$(".subject-main-name").focus();
|
||||
getC($(".subject-main-name"));
|
||||
});
|
||||
$(".subject-main-name").on("keydown",function(ev){
|
||||
if(ev.keyCode==13 || ev.keyCode==108){
|
||||
$(".subject-main-name").attr("contenteditable","false");
|
||||
}
|
||||
});
|
||||
$(".subject-main-name").on("blur",function(){
|
||||
$(".subject-main-name").attr("contenteditable","false");
|
||||
$.post(
|
||||
'<%= update_attr_subject_path(@subject) %>',
|
||||
{ name: $(".subject-main-name").html().trim() },
|
||||
function (data) {
|
||||
}
|
||||
);
|
||||
})
|
||||
|
||||
function getC(that){
|
||||
if(document.all){
|
||||
that.range=document.selection.createRange();
|
||||
that.range.select();
|
||||
that.range.moveStart("character",-1);
|
||||
}else{
|
||||
that.range=window.getSelection().getRangeAt(0);
|
||||
that.range.setStart(that.range.startContainer,that.html().length);
|
||||
}
|
||||
}
|
||||
// //编辑套件名称
|
||||
// $(".edit_subject_name").on("click",function(){
|
||||
// $(".subject-main-name").attr("contenteditable","true");
|
||||
// $(".subject-main-name").focus();
|
||||
// getC($(".subject-main-name"));
|
||||
// });
|
||||
// $(".subject-main-name").on("keydown",function(ev){
|
||||
// if(ev.keyCode==13 || ev.keyCode==108){
|
||||
// $(".subject-main-name").attr("contenteditable","false");
|
||||
// }
|
||||
// });
|
||||
// $(".subject-main-name").on("blur",function(){
|
||||
// $(".subject-main-name").attr("contenteditable","false");
|
||||
// if($(".subject-main-name").html().trim() == ""){
|
||||
// $(".subject-main-name").html("<%= @subject.name %>");
|
||||
// } else{
|
||||
// $.post(
|
||||
// '<%= update_attr_subject_path(@subject) %>',
|
||||
// { name: $(".subject-main-name").html().trim() },
|
||||
// function (data) {
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// function getC(that){
|
||||
// if(document.all){
|
||||
// that.range=document.selection.createRange();
|
||||
// that.range.select();
|
||||
// that.range.moveStart("character",-1);
|
||||
// }else{
|
||||
// that.range=window.getSelection().getRangeAt(0);
|
||||
// that.range.setStart(that.range.startContainer,that.html().length);
|
||||
// }
|
||||
// }
|
||||
</script>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<div class="active-class ">
|
||||
<p style="line-height: 42px;">
|
||||
<i class="fa fa-map-marker mr5 color-grey"></i>
|
||||
<%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to "实训套件", subjects_path() %>
|
||||
> <span>编辑</span>
|
||||
</p>
|
||||
<div class="edu-con-top user_bg_shadow">
|
||||
<span class="ml15 color-grey font-16">编辑实训套件</span>
|
||||
</div>
|
||||
<div class="edu-bg createmain mb20 pt30 user_bg_shadow">
|
||||
<%= labelled_form_for @subject do |f| %>
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 名称</label>
|
||||
<input type="text" name="subject[name]" value="<%= @subject.name %>" id="new_subject_name" class="task task-height-40 panel-box-sizing task-form-70 fl color-grey ml20" maxlength="100" placeholder="例如:Python程序设计-从入门到精通">
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_name_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入名称</span>
|
||||
</li>
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl">简介</label>
|
||||
<textarea name="subject[description]" class="task task-height-220 panel-box-sizing task-form-70 fl color-grey ml20"><%= @subject.description %></textarea>
|
||||
</li>
|
||||
<li class="clearfix pt20 pb20">
|
||||
<label class="panel-form-label label fl"> </label>
|
||||
<%= link_to "取消", subject_path(@subject), :class => "task-btn fl mr10 ml20" %>
|
||||
<a href="javascript:void(0);" onclick="submit_edit_subject(<%= @subject.id %>);" class="task-btn task-btn-blue fl">保存</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
<div class="task-index-head mt20 mb20">
|
||||
<div class="header-color">
|
||||
<h2 class="fl task-inde-head-title">实训套件</h2>
|
||||
<%= link_to "<span class='font-22'>+</span> 创建套件".html_safe, new_subject_path(), :class => "fr color_white font-20" %>
|
||||
<%= link_to "+ 新建".html_safe, new_subject_path(), :class => "task-btn task-btn-green fr mt6" %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<ul class="task-index-head-info clearfix">
|
||||
|
|
|
|||
|
|
@ -4,82 +4,75 @@
|
|||
<p class="clearfix">
|
||||
<span class="fl font-bd font-18">简介</span>
|
||||
<% if User.current.manager_of_subject?(@subject) && @subject.status == 0 %>
|
||||
<i class="fa fa-pencil fr mt10 mr5 color-grey edit-produce"></i>
|
||||
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil fr mt10 mr5 color-grey edit-produce"></i></a>
|
||||
<% end %>
|
||||
</p>
|
||||
<p style="line-height: 1.5;" class="subject-produce <%= @subject.description.blank? ? 'color-light-grey' : '' %>" id="subject-produce"><%= @subject.description.blank? ? "暂未填写" : @subject.description %></p>
|
||||
<div class="mt15 color-grey <%= @subject.description.blank? ? 'color-light-grey' : '' %>">
|
||||
<%= @subject.description.blank? ? "暂未填写" : @subject.description %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<script>
|
||||
//编辑套件简介
|
||||
$(".edit-produce").on("click",function(){
|
||||
$(".subject-produce").attr("contenteditable","true");
|
||||
if($(".subject-produce").hasClass("color-light-grey")){
|
||||
$(".subject-produce").html("");
|
||||
};
|
||||
$("#subject-produce").focus();
|
||||
getC($("#subject-produce"));
|
||||
});
|
||||
$(".subject-produce").on("keydown",function(ev){
|
||||
if(ev.keyCode==13 || ev.keyCode==108){
|
||||
$(".subject-preduce").attr("contenteditable","false");
|
||||
}
|
||||
});
|
||||
$(".subject-produce").on("blur",function(){
|
||||
$(".subject-produce").attr("contenteditable","false");
|
||||
$.post(
|
||||
'<%= update_attr_subject_path(@subject) %>',
|
||||
{ description: $("#subject-produce").html().trim() },
|
||||
function (data) {
|
||||
}
|
||||
);
|
||||
if($("#subject-produce").html().trim() == ""){
|
||||
$("#subject-produce").html("暂未填写").addClass("color-light-grey");
|
||||
} else{
|
||||
$("#subject-produce").removeClass("color-light-grey");
|
||||
}
|
||||
})
|
||||
function getC(that){
|
||||
if(document.all){
|
||||
that.range=document.selection.createRange();
|
||||
that.range.select();
|
||||
that.range.moveStart("character",-1);
|
||||
}else{
|
||||
that.range=window.getSelection().getRangeAt(0);
|
||||
that.range.setStart(that.range.startContainer,that.html().length);
|
||||
}
|
||||
}
|
||||
// //编辑套件简介
|
||||
// $(".edit-produce").on("click",function(){
|
||||
// $(".subject-produce").removeAttr("disabled");
|
||||
// $("#subject-produce").focus();
|
||||
// });
|
||||
// $(".subject-produce").on("blur",function(){
|
||||
// $(".subject-produce").removeAttr("disabled");
|
||||
// $.post(
|
||||
// '<%#= update_attr_subject_path(@subject) %>',
|
||||
// { description: $("#subject-produce").val().trim() },
|
||||
// function (data) {
|
||||
// }
|
||||
// );
|
||||
// if($("#subject-produce").html().trim() == ""){
|
||||
// $("#subject-produce").addClass("color-light-grey");
|
||||
// } else{
|
||||
// $("#subject-produce").removeClass("color-light-grey");
|
||||
// }
|
||||
// })
|
||||
// function getC(that){
|
||||
// if(document.all){
|
||||
// that.range=document.selection.createRange();
|
||||
// that.range.select();
|
||||
// that.range.moveStart("character",-1);
|
||||
// }else{
|
||||
// that.range=window.getSelection().getRangeAt(0);
|
||||
// that.range.setStart(that.range.startContainer,that.html().length);
|
||||
// }
|
||||
// }
|
||||
</script>
|
||||
<!--新版阶段列表-->
|
||||
<div class="lesson-saved-list mb20">
|
||||
<% @stages.each do |stage| %>
|
||||
<div class="lesson-saved-list-item user_bg_shadow pt10 pb10 mb20" id="stage_div_<%= stage.id %>">
|
||||
<div class="lesson-saved-list-item user_bg_shadow pt20 mb20" id="stage_div_<%= stage.id %>">
|
||||
<p class="clearfix">
|
||||
<i class="font-20 fa fa-dot-circle-o ml15 mr15 color-orange"></i>
|
||||
<i class="font-20 fa fa-dot-circle-o ml20 color-orange"></i>
|
||||
<span class="font-16 font-bd"><%= stage.name %></span>
|
||||
<% if @subject.status == 0 && User.current.manager_of_subject?(@subject) %>
|
||||
<a href="javascript:void(0);" onclick="edit_stage(<%= stage.id %>)"><i class="fa fa-pencil fr mt10 mr10 color-grey delete"></i></a>
|
||||
<a href="javascript:void(0);" onclick="edit_stage(<%= stage.id %>)"><i class="fa fa-pencil fr mt10 mr20 color-grey delete"></i></a>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%= stage_path(stage) %>', '确定要删除该阶段吗?');"><i class="fa fa-trash fr mt10 mr10 color-grey edit"></i></a>
|
||||
<% end %>
|
||||
</p>
|
||||
<p class="ml50 color-grey pr20"><%= stage.description %></p>
|
||||
<p class="ml20 color-grey pr20 mt10 mb10"><%= stage.description %></p>
|
||||
<% stage.stage_shixuns.each_with_index do |stage_shixun, index| %>
|
||||
<% shixun = stage_shixun.shixun %>
|
||||
<div class="clearfix pt5 pb5 stage-info-line" id="stage_shixun_<%= shixun.id %>" style="cursor: pointer;" onclick="shixun_link('<%= shixun.identifier %>')">
|
||||
<li class="fl li-width50">
|
||||
<i class="fa fa-gamepad color-light-green mr20 font-20"></i>
|
||||
<div class="clearfix pt10 pb10 pl20 stage-info-line pr20" id="stage_shixun_<%= shixun.id %>" style="cursor: pointer;" onclick="shixun_link('<%= shixun.identifier %>')">
|
||||
<li class="fl li-width63">
|
||||
<i class="fa fa-gamepad color-light-green font-20"></i>
|
||||
<span class="font-bd color-dark-grey"><%= shixun.name %></span>
|
||||
</li>
|
||||
<li class="fl li-width10">
|
||||
<li class="fl li-width15">
|
||||
<i class="fa fa-tasks color-light-green font-16 mr5"></i>
|
||||
<span class="color-dark-grey"><%= shixun.challenges.count %></span>
|
||||
</li>
|
||||
<li class="fl li-width20 color-light-green">
|
||||
<span class="mr5"><%= shixun.shixun_score %></span>经验值</li>
|
||||
<li class="fl li-width20">
|
||||
<li class="fl li-width15">
|
||||
<i class="fa fa-viacoin color-light-green mr5"></i><span class="mr5"><%= shixun.shixun_score %></span></li>
|
||||
<li class="fl li-width7">
|
||||
<% if @subject.status == 0 && User.current.manager_of_subject?(@subject) %>
|
||||
<span class="fl <%= shixun.shixun_status == '编辑中' ? 'color-grey' : (shixun.shixun_status == '审核中' ? 'color-orange' : (shixun.shixun_status == '已发布' ? 'color-light-green' : 'color-light-grey')) %>"><%= shixun.shixun_status %></span>
|
||||
<span class="fl none ml10"><i class="fa fa-exclamation-circle color-red ml5 mr5"></i></span>
|
||||
<span class="<%= shixun.shixun_status == '编辑中' ? 'color-grey' : (shixun.shixun_status == '审核中' ? 'color-orange' : (shixun.shixun_status == '已发布' ? 'color-light-green' : 'color-light-grey')) %>"><%= shixun.shixun_status %></span>
|
||||
<span class="none ml10"><i class="fa fa-exclamation-circle color-red ml5 mr5"></i></span>
|
||||
<% else %>
|
||||
<% case my_shixun_status(shixun, User.current) %>
|
||||
<% when '已通关' %>
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@
|
|||
<div style="min-height: 350px">
|
||||
<% @courses.each do |course| %>
|
||||
<p class="clearfix pl10">
|
||||
<a href="<%= course_path(course) %>" target="_blank" class="font-16 first link-color-grey03"><i class="fa fa-circle-o color-orange02 font-12 ml5 mr5" aria-hidden="true"></i><%= course.name %></a>
|
||||
<span class="font-14 hasmargin"><a href="<%= syllabus_path(course.syllabus) %>" target="_blank" class="link-color-grey03"><%= course.syllabus.title %></a></span>
|
||||
<span class="font-14 hasmargin"><a href="<%= user_path(course.syllabus.user_id) %>" class="link-color-grey03" target="_blank"><%= User.where(:id => course.tea_id).first.show_name %></a></span>
|
||||
<span class="font-14 mr25 color-grey fr"><%= format_time course.updated_at %></span>
|
||||
<a href="<%= course_path(course) %>" target="_blank" class="font-16 first"><i class="fa fa-circle-o color-orange02 font-12 ml5 mr5" aria-hidden="true"></i><%= course.name %></a>
|
||||
<span class="font-14 hasmargin"><a href="<%= syllabus_path(course.syllabus) %>" class="color-grey" target="_blank"><%= course.syllabus.title %></a></span>
|
||||
<span class="font-14 hasmargin"><a href="<%= user_path(course.syllabus.user_id) %>" class="color-grey" target="_blank"><%= User.where(:id => course.tea_id).first.show_name %></a></span>
|
||||
<span class="font-14 mr25 color-grey fr"><%= time_from_now course.updated_at %>更新</span>
|
||||
<span class="font-14 last cl" style="display: none;">分享 <i class="fa fa-weixin font-14 blue" aria-hidden="true"></i></span>
|
||||
</p>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -10,9 +10,22 @@
|
|||
<% @shixuns.each do |shixun| %>
|
||||
<p class="clearfix pl10">
|
||||
<a href="<%= shixun_path(shixun) %>" target="_blank" class="font-16 first"><i class="fa fa-circle-o color-orange02 font-12 ml5 mr5" aria-hidden="true"></i><%= shixun.name.strip %></a>
|
||||
<span class="font-14 hasmargin"><a href="javascript:void(0);" style="cursor: default;">已解锁第<i><%= had_passed_changllenge_count(shixun, @user) %></i>关/共<i><%= shixun.challenges.count %></i>关</a></span>
|
||||
<span class="font-14 hasmargin"><a href="<%= user_path(shixun.user_id) %>" class="link-color-grey03" target="_blank"><%= User.where(:id => shixun.user_id).first.show_name %></a></span>
|
||||
<span class="font-14 fr mr25 color-grey"><%= format_time shixun.created_at %></span>
|
||||
|
||||
<span class="font-14 hasmargin">
|
||||
<a href="javascript:void(0);" class="color-grey" style="cursor: default;">
|
||||
<% if had_passed_changllenge_count(shixun, @user) == 0 %>
|
||||
尚未挑战
|
||||
<% elsif had_passed_changllenge_count(shixun, @user) == -1 %>
|
||||
已挑战至 第1关 / 共<i><%= shixun.challenges.count %></i>关
|
||||
<% elsif (had_passed_changllenge_count(shixun, @user).class == Array) %>
|
||||
已挑战至 第<%= had_passed_changllenge_count(shixun, @user)[0].to_i %>关 / 共<i><%= shixun.challenges.count %></i>关
|
||||
<% else %>
|
||||
已完成至 第<i><%= had_passed_changllenge_count(shixun, @user) %></i>关 / 共<i><%= shixun.challenges.count %></i>关
|
||||
<% end %>
|
||||
</a>
|
||||
</span>
|
||||
<span class="font-14 hasmargin"><a href="<%= user_path(shixun.user_id) %>" class="color-grey" target="_blank"><%= User.where(:id => shixun.user_id).first.show_name %></a></span>
|
||||
<span class="font-14 fr mr25 color-grey"><%= time_from_now shixun.updated_at %>更新</span>
|
||||
<span class="font-14 last cl" style="display: none;">分享 <i class="fa fa-weixin font-14 blue" aria-hidden="true"></i></span>
|
||||
</p>
|
||||
<% end %>
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 991 B |
|
|
@ -1000,4 +1000,13 @@ function submit_new_subject(){
|
|||
$("#new_subject_name_notice").hide();
|
||||
$("#new_subject").submit();
|
||||
}
|
||||
}
|
||||
|
||||
function submit_edit_subject(id){
|
||||
if($("#new_subject_name").val().trim() == ""){
|
||||
$("#new_subject_name_notice").show();
|
||||
} else{
|
||||
$("#new_subject_name_notice").hide();
|
||||
$("#edit_subject_"+id).submit();
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ html,body{ font-size:14px; line-height:2.0; height:100%;}
|
|||
.newContainer{ min-height:100%; height: auto !important; height: 100%; /*IE6不识别min-height*/position: relative;}
|
||||
.newMain{ margin: 0 auto; padding-bottom: 155px; }
|
||||
.newFooter{ position: absolute; bottom: 0; width: 100%; height: 155px;background: #323232; clear:both; min-width: 1200px}
|
||||
.newHeader{background: #46484c;width:100%; height: 50px; min-width: 1200px}
|
||||
.newHeader{background: #303133;width:100%; height: 50px; min-width: 1200px}
|
||||
/* 重置样式 */
|
||||
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td,span{ margin:0; padding:0;}
|
||||
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:14px;line-height:1.9; background:#f5f5f5;; color:#333;}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ input.header-search-input{ width:150px; height:30px; padding:0 5px; border-style
|
|||
.new-container-inner02{width:1200px; margin:0px auto; padding:50px 0;}
|
||||
.inner-nav-mes{ font-size:16px; color:#fff; margin-right:35px; margin-top:18px; }
|
||||
.inner-nav-cir{ background:#ff6530; color:#fff; border-radius:15px;padding:0 5px; display: inline-block; font-size:10px; height:17px; line-height:17px;}
|
||||
.inner-nav-user{ width: 75px; height: 45px; margin-top:5px; position: relative; padding-left: 20px;}
|
||||
.inner-nav-user{ width: 75px; height: 45px; margin-top:5px; position: relative; padding-left: 0px;}
|
||||
.inner-nav-user-img{ width: 40px; height: 40px; border-radius:50px;}
|
||||
select.header-search-select{ border:none; font-size:14px; padding:5px; background: none;}
|
||||
.edu-unlogin-nav a{ color:#fff!important; font-size:14px; line-height:50px;}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*------课程实训首页---------*/
|
||||
.header-color{background: linear-gradient(304.95deg, rgb(0, 158, 138) 0%, rgb(22, 212, 190) 100%) rgb(22, 212, 190);padding: 30px}
|
||||
.header-color{background: linear-gradient(to right, rgb(68, 190, 164) 0%, rgb(62, 158, 207) 100%);padding: 30px}
|
||||
.active-class .content .sub-con{width:23.7%;border:1px solid #eee;background:#fff;margin: 0 1.5% 1.5% 0px;box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);}
|
||||
.active-class .content .sub-con:nth-child(4n+0){margin:0 0 1.5% 0;}
|
||||
.active-class .content .sub-con:hover{box-shadow: 0 5px 15px 0 rgba(0, 0, 0, 0.15);cursor: pointer;-webkit-animation: bounce-down 1s linear 1;animation: bounce-down 1s linear 1;}
|
||||
|
|
@ -24,16 +24,17 @@
|
|||
|
||||
/*-----------新版新建实训------------*/
|
||||
.produce-content:hover i{color:#29bd8b!important;}
|
||||
.subject-main-name{outline: none}
|
||||
.subject-produce{outline: none;}
|
||||
.stage-info-line{padding-left: 50px}
|
||||
.subject-main-name{outline: none;background: none;border: none;width: auto;height: 45px}
|
||||
.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:hover{box-shadow: 0 0 8px 0 rgba(0,0,0,.2);}
|
||||
.lesson-saved-list-item{border:1px solid #EEEEEE}
|
||||
.lesson-saved-list-item:hover .edit{color:#29bd8b!important;}
|
||||
.lesson-saved-list-item:hover .delete{color:#29bd8b!important;}
|
||||
li.li-width50{width: 50%;text-align: left}
|
||||
li.li-width63{width: 63%;text-align: left}
|
||||
li.li-width20{width: 20%;text-align: left}
|
||||
li.li-width10{width: 10%;text-align: left}
|
||||
li.li-width15{width: 15%;text-align: left}
|
||||
li.li-width7{width: 7%;text-align: left}
|
||||
.lesson-saved-list-item{background-color: #FFFFFF}
|
||||
/*------课程实训首页---------*/
|
||||
|
||||
.course_tip_box{width: 460px;padding: 10px;background-color: #FFFFFF;}
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ input.new_loggin_input_test{ -webkit-box-shadow: 0 0 0px 1000px white inset; ou
|
|||
|
||||
|
||||
/*头部排版更改*/
|
||||
.lector{display: block;width: auto;padding: 0px 8px;background: cornflowerblue;color: #ffffff;font-size: 14px;margin-right: 15px;border-radius: 4px;margin-top: 3px;}
|
||||
.lector{display: block;width: auto;padding: 0px 8px;background: #5ECFBA;color: #ffffff;font-size: 14px;margin-right: 15px;border-radius: 4px;margin-top: 3px;}
|
||||
.u-color-light-red{color: #FF6666}
|
||||
.u-color-light-grey{color: #CCCCCC}
|
||||
.user-info-span{border-radius: 50%;float:left;background: #F3F5F7;text-align: center;width: 23px;height: 23px;line-height: 23px;margin-top: 3px;margin-right: 5px}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
25% {margin-top:-10px;}
|
||||
50%, 100% {margin-top: 0;}
|
||||
}
|
||||
.sidebar{width:60px;height:100%;box-shadow: 0 30px 30px 0 rgba(0, 0, 0, 0.15);position:fixed;left:0;top:0;background:#fff;}
|
||||
.sidebar-top{height:50px;line-height:50px;background:#46484c;text-align:center;}
|
||||
.sidebar{width:50px;height:100%;box-shadow: 0 30px 30px 0 rgba(0, 0, 0, 0.15);position:fixed;left:0;top:0;background:#fff;}
|
||||
.sidebar-top{height:50px;line-height:50px;background:#35373a;text-align:center;}
|
||||
.sidebar-top span{color:#fff;display:none;}
|
||||
.sidebar-con{padding-top:20px;white-space: nowrap;}
|
||||
.sidebar-con .list{min-height:45px;margin-top:15px;}
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ a.rightbar-pause{ color:#29bd8b; font-size: 18px; margin-right:15px; margin-top:
|
|||
.content-submitbox{ width:120px; margin: 15px auto; height:135px;}
|
||||
.panel-inner{ background:#EFF2F7; margin:15px; padding:15px;}
|
||||
.panel-inner-title{ font-size: 14px; color: #666; max-width:85%; line-height:30px;word-wrap: break-word; margin-bottom: 10px}
|
||||
.panel-inner-icon{width: 22px;height: 22px;line-height: 22px;border-radius: 50%;background: #29bd8b;display: block;text-align: center}
|
||||
.panel-footer{ min-width:1000px; height: 210px!important;}
|
||||
/* 弹框 */
|
||||
.task-popup-text-center{ text-align: center; color: #666;}
|
||||
|
|
@ -149,11 +150,13 @@ input.knowledge_frame{height:30px;line-height:30px;border:none;background:#f3f5f
|
|||
.-flex-basic40{flex-basis:auto;}
|
||||
.-flex-basic50{flex-basis:auto;}
|
||||
.b-label{width:4px;cursor:ew-resize;background:#2b2b2b;}
|
||||
.h-center{height:4px;cursor:ns-resize;background:#33485F;z-index:9999;}
|
||||
.h-center{height:4px;cursor:ns-resize;background:#33485F;}
|
||||
.-changebg{height:3px;}
|
||||
.-brother{width:100%;height:100%;position:absolute;left:0;top:0;z-index:999;}
|
||||
.-bg-weightblack{background:#000;}
|
||||
.-flex-basic70{flex:4 9 auto;}
|
||||
/*---------------------------------------------*/
|
||||
.-flex-basic60{flex:4 9 auto;}
|
||||
.-flex-basic60{flex:none;}
|
||||
.-flex-basic100{flex-basis: 100%!important;}
|
||||
.-header-title{ max-width:500px; font-weight: normal;}
|
||||
.-header-right{ background:#333;border-radius:25px; padding:5px 15px; height: 30px; position: absolute; right:10px;line-height: 30px;}
|
||||
|
|
@ -217,8 +220,8 @@ input.knowledge_frame{height:30px;line-height:30px;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;}*/
|
||||
.task-index-head-top{background: #1ECDCE linear-gradient(to top left, #48A7D1 0%, #1ECDCE 100%);background-color: rgb(1, 70, 74); padding:30px;}
|
||||
.task-index-head-top-course{background: linear-gradient(to right, rgb(162, 171, 234) 0%, rgb(114, 123, 177) 100%);background-color:rgb(160, 175, 247); padding:30px;}
|
||||
.task-index-head-top{background: linear-gradient(to right, rgb(104, 177, 215) 0%, rgb(1,75,79) 100%);background-color: rgb(1, 70, 74); padding:30px;}
|
||||
.task-index-head-top-course{background: linear-gradient(to right, rgb(69, 191, 165) 0%, rgb(164, 175, 247) 100%);background-color:rgb(160, 175, 247); padding:30px;}
|
||||
.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;}
|
||||
|
|
|
|||
Loading…
Reference in New Issue