socialforge/app/views/bids/_homework.html.erb

67 lines
2.5 KiB
Plaintext
Raw Normal View History

<%= render_flash_messages %>
2013-09-13 21:52:24 +08:00
<div id="put-bid-form" style="display: none">
<script type="text/javascript">
function j_submit () {
alert('start');
var submit_homework = function(){
$('#add_homework_form').clone().attr('action', '<%= url_for({:controller => "bids", :action => "add_homework"})+".js" %>').ajaxSubmit()
};
alert('stop');
$.globalEval(submit_homework());
return false;
}
function show()
{
$("#what_is_project_div").slideToggle();
}
$(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');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='hiddent_alert_model();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","").css("left","").css("width","511");
$('#ajax-modal').parent().addClass("alert_praise");
<% end %>
<% unless @is_teacher%>
<% if @bid.comment_status == 0 && @bid.open_anonymous_evaluation == 1%>
$("#my_homework").click();
<% elsif @bid.comment_status == 2 || @bid.open_anonymous_evaluation == 0%>
$("#all_homeworks").click();
<% end %>
<% end %>
}
);
2014-11-03 18:45:53 +08:00
function hiddent_alert_model(){hideModal($('#popbox02'));}
function hidden_homework_atert_form(cur_page,cur_type)
{
hideModal($("#popbox"));
}
function search_homework_member(url)
{
$.get(
url,
{ name: $.trim($("#homework_member_search").val()) },
function (data) {
}
);
}
</script>
2013-09-13 21:52:24 +08:00
</div>
<div id='bidding_project_list'>
<%= render :partial => 'homework_list' %>
2013-09-13 21:52:24 +08:00
</div>