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

100 lines
5.3 KiB
Plaintext
Raw Normal View History

2016-01-20 16:03:28 +08:00
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<script type="text/javascript">
2016-12-02 14:53:20 +08:00
function republish_poll(poll_id, index)
2016-01-20 16:03:28 +08:00
{
$('#ajax-modal').html("<div id='popbox02'>" +
"<div class='upload_con'>" +
"<div class='upload_box'>" +
"<p class='polls_box_p'>取消发布后问卷统计结果将会被清空<br />是否确定取消发布该问卷?</p>" +
"<div class='polls_btn_box'>" +
2016-12-02 14:53:20 +08:00
"<a href='/poll/"+ poll_id +"/republish_poll?index=" + index +"' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
2016-01-20 16:03:28 +08:00
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取&nbsp;&nbsp;消</a>" +
"</div>" +
"<div class='cl'></div>" +
"</div>" +
"</div>" +
"</div>");
showModal('ajax-modal', '310px');
$('#ajax-modal').css('height','120px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().removeClass("alert_praise");
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
}
function clickCanel(){hideModal("#popbox02");}
2016-12-02 14:53:20 +08:00
function poll_submit(poll_id,poll_name,index)
2016-01-20 16:03:28 +08:00
{
if(poll_name == 0)
{
alert("问卷标题不能为空");
}
else
{
$('#ajax-modal').html("<div id='popbox02'>" +
"<div class='upload_con'>" +
"<div class='upload_box'>" +
"<p class='polls_box_p'>问卷发布后将不能对问卷进行修改,<br />是否确定发布该问卷?</p>" +
"<div class='polls_btn_box'>" +
2016-12-02 14:53:20 +08:00
"<a href='/poll/"+ poll_id +"/publish_poll?index=" + index + "' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
2016-01-20 16:03:28 +08:00
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取&nbsp;&nbsp;消</a>" +
"</div>" +
"<div class='cl'></div>" +
"</div>" +
"</div>" +
"</div>");
showModal('ajax-modal', '310px');
$('#ajax-modal').css('height','120px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().removeClass("alert_praise");
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
}
}
2016-12-02 14:53:20 +08:00
function close_poll(poll_id, index)
2016-01-20 16:03:28 +08:00
{
$('#ajax-modal').html("<div id='popbox02'>" +
"<div class='upload_con'>" +
"<div class='upload_box'>" +
"<p class='polls_box_p'>问卷关闭后学生将不能继续提交问卷,<br />是否确定关闭该问卷?</p>" +
"<div class='polls_btn_box'>" +
2016-12-02 14:53:20 +08:00
"<a href='/poll/"+ poll_id +"/close_poll?index=" + index +"' class='upload_btn' onclick='clickCanel();' data-remote='true'>确&nbsp;&nbsp;定</a>" +
2016-01-20 16:03:28 +08:00
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取&nbsp;&nbsp;消</a>" +
"</div>" +
"<div class='cl'></div>" +
"</div>" +
"</div>" +
"</div>");
showModal('ajax-modal', '310px');
$('#ajax-modal').css('height','120px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().removeClass("alert_praise");
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
}
2016-12-02 14:53:20 +08:00
function delete_exercise(id){
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">您是否确定删除</p><div class="cl"></div><a href="/poll/'+ id +'" class="fr sy_btn_blue mr90 mt10" data-method="delete" data-remote="true">确定</a>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取消</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
}
2016-01-20 16:03:28 +08:00
function closeModal()
{
hideModal($("#popbox_upload"));
}
</script>
2016-07-22 15:32:37 +08:00
<div class="courseRSide fl">
2016-12-02 14:53:20 +08:00
<div id="polls">
2016-01-20 16:03:28 +08:00
<%= render :partial => 'poll_list'%>
2016-07-22 15:32:37 +08:00
</div><!--问卷内容end-->
</div>