socialforge/app/views/works/index.html.erb

85 lines
3.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script type="text/javascript">
function reset_homework(){
$("#homework_name").val("");
$("#homework_publish_time").val("");
$("#homework_end_time").val("");
$("#course_id").val($("#option_select").val());
$("#homeworkSetting").addClass("undis");
$("#homeworkSetting").html("");
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'attachments/form_course', :locals => {:container => @new_homework, :isReply => false})%>");
//work_description_editor.html("");
$("#homework_name_span").text("");
$("#homework_end_time_span").text("");
$("#homework_course_id_span").text("");
$("#homework_editor").toggle();
//$("#select_type_nitice").show();
document.getElementById("homework_type_option").options[0].selected = true;
}
$(function(){
$("#RSide").removeAttr("id");
$("#Container").css("width","1000px");
});
<% if @is_new%>
$(function(){
$("#homework_name").focus();
});
<%end%>
</script>
<style>
/*日历选择图*/
img.ui-datepicker-trigger {display:block;background:url(../images/public_icon.png) -31px 0 no-repeat;cursor: pointer;vertical-align: middle;width:16px;height:15px;float:left;margin: 7px;}
.description{display: none !important;}
.ispublic-label{display: none !important;}
.is_public_checkbox{display: none !important;}
.is_public{display: none !important;}
.link_file{ background:url(../images/pic_file.png) 0 5px no-repeat !important;}
#attachments_fields input.filename{ background:url(../images/pic_file.png) 0 5px no-repeat !important;padding-left:20px !important; color:#64bdd9 !important;}
.link_file_a{background:url(../images/pic_file.png) 0 5px no-repeat !important;padding-left:20px !important; color:#64bdd9 !important;}
</style>
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner">
<div id="menu_r" class="NewsBannerName" style="margin-bottom: -10px;">
<ul class="menu_r b_w" style="padding-left: 0px; margin-top: -5px;">
<li>
<a href="javascript:void(0);" class="menu_arrow" style="font-size:16px; color:#4b4b4b; font-weight: normal; padding-left: 0px;">提交</a>
<ul style="max-height:240px; overflow-y:auto; overflow-x:hidden;">
<% if @homework_commons.empty? %>
<li class="pr10" style="font-weight: normal; color: #888888; width: 120px; padding-left: 15px; padding-bottom: 5px;">目前尚未发布提交</li>
<% else %>
<% @homework_commons.each_with_index do |homework_common,index|%>
<li class="pr10">
<%= link_to "提交#{@homework_commons.count - index}#{homework_common.name}",contestant_works_path(:work => homework_common.id),:target=>"_blank"%>
</li>
<% end%>
<% end %>
</ul>
</li>
</ul>
</div>
<div id="search_div" class="fr mr10">
<%= render :partial => 'work_search_form',:locals => {:contest=>@contest} %>
</div>
</div>
<div class="cl"></div>
<% if @is_teacher%>
<!-- 老师身份才可以发布作业 -->
<div class="HomeWork mt10" nhname='homework_common_form'>
<%= labelled_form_for @new_homework,:method => "post" do |f| %>
<div id="HomeWorkCon">
<%= render :partial => 'contest_work_form', :locals => { :homework => @new_homework,:f => f,:edit_mode => false,:select_course => false } %>
<input type="hidden" name="is_in_course" value="1"/>
</div>
<% end%>
</div><!----HomeWork end-->
<% end%>
<div id="homework_index_list">
<%= render :partial => 'work_index_list', :locals => {:homework_commons => @homeworks,:contest_id => @contest.id} %>
</div>
</div>
<div class="cl"></div>