2013-12-19 15:59:10 +08:00
|
|
|
|
<%= render_flash_messages %>
|
2013-09-13 21:52:24 +08:00
|
|
|
|
<div id="put-bid-form" style="display: none">
|
2013-12-19 15:59:10 +08:00
|
|
|
|
<%= form_for HomeworkAttach.new, :url => {:controller => 'bids', :action => 'add_homework'}, :update => "bidding_project_list", :complete => '$("#put-bid-form").hide();', :html => {:multipart => true, :id => 'add_homework_form'} do |f| %>
|
2014-10-30 15:12:45 +08:00
|
|
|
|
<fieldset>
|
|
|
|
|
<legend>
|
|
|
|
|
<%= l(:label_attachment_plural) %>
|
|
|
|
|
</legend>
|
|
|
|
|
<p id="put-bid-form-partial">
|
|
|
|
|
<%= render :partial => 'attachments/form' %>
|
|
|
|
|
</p>
|
|
|
|
|
</fieldset>
|
|
|
|
|
<%= submit_tag l(:button_create), :onclick => "return true" %>
|
2013-11-16 11:09:10 +08:00
|
|
|
|
<% end %>
|
2013-12-19 15:59:10 +08:00
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
function j_submit () {
|
2014-06-04 09:55:38 +08:00
|
|
|
|
alert('start');
|
2013-12-19 15:59:10 +08:00
|
|
|
|
var submit_homework = function(){
|
|
|
|
|
$('#add_homework_form').clone().attr('action', '<%= url_for({:controller => "bids", :action => "add_homework"})+".js" %>').ajaxSubmit()
|
|
|
|
|
};
|
2014-06-04 09:55:38 +08:00
|
|
|
|
alert('stop');
|
2013-12-19 15:59:10 +08:00
|
|
|
|
$.globalEval(submit_homework());
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2014-06-20 10:52:34 +08:00
|
|
|
|
|
|
|
|
|
function show()
|
|
|
|
|
{
|
|
|
|
|
$("#what_is_project_div").slideToggle();
|
|
|
|
|
}
|
2014-11-02 11:35:37 +08:00
|
|
|
|
|
2014-11-06 10:58:07 +08:00
|
|
|
|
$(document).ready(
|
|
|
|
|
function()
|
|
|
|
|
{
|
|
|
|
|
<% if !@is_teacher && @homework_list.count > 0 && @bid.comment_status == 1%>
|
|
|
|
|
//登录者不是老师,且作业列表数目不为0,且作业处于开启匿评阶段
|
|
|
|
|
var alert_model = "'#ajax-modal'";
|
|
|
|
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_attach/praise_alert') %>');
|
|
|
|
|
showModal('ajax-modal', '480px');
|
|
|
|
|
$('#ajax-modal').css('height','240px');
|
2015-01-13 16:36:10 +08:00
|
|
|
|
$('#ajax-modal').siblings().remove();
|
2014-11-06 10:58:07 +08:00
|
|
|
|
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
2015-03-25 10:21:33 +08:00
|
|
|
|
"<a href='javascript:' onclick='hiddent_alert_model();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
2014-11-06 10:58:07 +08:00
|
|
|
|
$('#ajax-modal').parent().css("top","").css("left","").css("width","511");
|
|
|
|
|
$('#ajax-modal').parent().addClass("alert_praise");
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<% unless @is_teacher%>
|
2014-11-19 11:11:28 +08:00
|
|
|
|
<% if @bid.comment_status == 0 && @bid.open_anonymous_evaluation == 1%>
|
2014-11-06 10:58:07 +08:00
|
|
|
|
$("#my_homework").click();
|
2014-11-19 11:11:28 +08:00
|
|
|
|
<% elsif @bid.comment_status == 2 || @bid.open_anonymous_evaluation == 0%>
|
2014-11-06 10:58:07 +08:00
|
|
|
|
$("#all_homeworks").click();
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
}
|
|
|
|
|
);
|
2014-11-03 18:45:53 +08:00
|
|
|
|
|
2014-11-03 18:54:34 +08:00
|
|
|
|
function hiddent_alert_model(){hideModal($('#popbox02'));}
|
|
|
|
|
|
2014-11-04 10:41:34 +08:00
|
|
|
|
function hidden_homework_atert_form(cur_page,cur_type)
|
2014-11-03 19:27:30 +08:00
|
|
|
|
{
|
|
|
|
|
hideModal($("#popbox"));
|
|
|
|
|
// 评了分的则刷新列表
|
2014-12-02 16:21:36 +08:00
|
|
|
|
// switch (cur_type)
|
|
|
|
|
// {
|
|
|
|
|
// case 1:
|
|
|
|
|
// $.ajax({
|
|
|
|
|
// type: "GET",
|
|
|
|
|
// url: "<%#= get_not_batch_homework_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
|
|
|
|
|
// data: 'text',
|
|
|
|
|
// success: function (data) {
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// break;
|
|
|
|
|
// case 2:
|
|
|
|
|
// $.ajax({
|
|
|
|
|
// type: "GET",
|
|
|
|
|
// url: "<%#= get_batch_homeworks_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
|
|
|
|
|
// data: 'text',
|
|
|
|
|
// success: function (data) {
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// break;
|
|
|
|
|
// case 3:
|
|
|
|
|
// $.ajax({
|
|
|
|
|
// type: "GET",
|
|
|
|
|
// url: "<%#= get_homeworks_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
|
|
|
|
|
// data: 'text',
|
|
|
|
|
// success: function (data) {
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// break;
|
|
|
|
|
// case 4:
|
|
|
|
|
// $.ajax({
|
|
|
|
|
// type: "GET",
|
|
|
|
|
// url: "<%#= get_student_batch_homework_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
|
|
|
|
|
// data: 'text',
|
|
|
|
|
// success: function (data) {
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// break;
|
|
|
|
|
// case 5:
|
|
|
|
|
// break;
|
|
|
|
|
// default :
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
2014-11-03 19:27:30 +08:00
|
|
|
|
}
|
2013-12-19 15:59:10 +08:00
|
|
|
|
</script>
|
2013-09-13 21:52:24 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div id='bidding_project_list'>
|
2014-10-30 17:27:07 +08:00
|
|
|
|
<%= render :partial => 'homework_list' %>
|
2013-09-13 21:52:24 +08:00
|
|
|
|
</div>
|