educoder/app/views/syllabuses/index.html.erb

99 lines
3.7 KiB
Plaintext

<div class="more">
<p class="head font-16">
<span class="fl">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="<%= user_path(User.current) %>"><%= User.current.show_name %></a> &gt;
<a href="<%= courses_path() %>">智能课堂</a>&gt;
<a href="javascript:void(0);">我的课堂</a>
</span>
<!-- <span class="fr font-12" style="color:#ccc;">
<i class="fa fa-eye" aria-hidden="true" style="color:#ddd;"></i>
<em>2625</em> 次访问
</span>-->
</p>
<div class="play pl10 pr10">
<div class="nav clearfix">
<p class="fl font-14 bold task-tab" data-option="release" id="my_publish">
我的发布<span class="font-12 ml10"><%= @my_syllabuses.count %></span>
<i class="fa fa-caret-down font-12" aria-hidden="true"></i>
</p>
<p class="fl font-14 task-tab" data-option="partic" id="my_join">
我的参与<span class="font-12 ml10"><%= @join_syllabuses.count %></span>
<i class="fa fa-caret-down font-12" style="display:none;" aria-hidden="true"></i>
</p>
</div>
<!-- <p class="state">
<a href="javascript:void(0)" class="edu-filter-cir-grey mr5 active" id="syllabuses_processing">正在进行</a>
<a href="javascript:void(0)" class="edu-filter-cir-grey mr5" id="syllabuses_end">已结束</a>
</p>-->
<div class="con">
<div class="release">
<%= render :partial => "syllabuses/my_syllabuses" %>
</div>
<div class="partic" style="display:none;">
<%= render :partial => "syllabuses/join_syllabuses" %>
</div>
</div>
</div>
</div>
<script>
$(function() {
console.log($(".con .handle"));
$(".play .nav p").click(function() {
var $a = $(this).attr("data-option");
$(".play .nav p i").hide();
$(".play .nav p").removeClass("bold");
$(this).addClass("bold");
$(this).find("i").show();
$(".con").children().hide();
$(".con").find("." + $a + "").show();
});
$(".con .count").click(function() {
if($(this).find(".cut").css("display") == "none") {
$(this).find(".cut").show();
$(this).find(".add").hide();
$(this).parent().next().show();
} else {
$(this).find(".cut").hide();
$(this).find(".add").show();
$(this).parent().next().hide();
}
});
$(".con .operate").click(function() {
if($(this).parent().next().css("display") == "none") {
$(".con .handle").hide();
$(this).parent().next().show();
} else {
$(this).parent().next().hide();
}
});
$(document).bind("click", function(e) {
var target = $(e.target);
if(target.closest(".con .handle").length == 0 && target.closest(".con .operate").length == 0) {
$(".con .handle").hide();
}
});
/* // type: 1表示正在进行 2表示一结束
$("#syllabuses_processing").live("click", function(){
if($(".bold").attr("id") == "my_publish"){
var type = 1;
}else if($(".bold").attr("id") == "my_join"){
var type = 2;
}
console.log(type);
$(this).addClass("active");
$(this).next().removeClass("active");
$.ajax({
url: "<%#= syllabuses_path() %>",
dateType: "script",
data: { type: type }
})
});*/
});
</script>