发布时弹出框js、css调整

This commit is contained in:
sw 2015-01-16 17:21:33 +08:00
parent 17b96bdb14
commit ae9856c01a
3 changed files with 83 additions and 4 deletions

View File

@ -1,8 +1,8 @@
class PollController < ApplicationController
before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer]
before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll]
before_filter :find_container, :only => [:new,:create, :index]
before_filter :is_member_of_course, :only => [:index,:show]
before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy]
before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll]
include PollHelper
def index
if @course
@ -180,7 +180,11 @@ class PollController < ApplicationController
#发布问卷
def publish_poll
@poll.polls_status = 2
@poll.published_at = Time.now
if @poll.save
redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id)
end
end
#提交答案

View File

@ -54,6 +54,18 @@
doc.parent().remove();
}
}
function poll_submit()
{
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { poll: @poll}) %>');
showModal('ajax-modal', '500px');
$('#ajax-modal').css('height','180px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='#' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("anonymos");
}
</script>
</head>
@ -104,7 +116,7 @@
</div>
<div class="ur_buttons">
<a href="#" class="ur_button_submit" >
<a class="ur_button_submit" onclick="poll_submit();">
<%= l(:label_memo_create)%>
</a>
</div>

View File

@ -0,0 +1,63 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>开启匿评功能</title>
<style>
#popbox02{ font-size:12px; font-family:"微软雅黑","宋体"; background:#fff; font-style:normal;}
#popbox02 div,img,tr,td,textarea{ border:0;}
#popbox02 table,tr,td{border:0; cellspacing:0; cellpadding:0;}
#popbox02 ul,li{ list-style-type:none}
#popbox02 .cl{ clear:both; overflow:hidden; }
#popbox02 a{ text-decoration:none; }
#popbox02 a:hover{ text-decoration:underline;}
/* 问卷发布弹框 */
.anonymos{width:480px;height:180px;position:fixed;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
.ni_con { width:425px; margin:25px 30px;}
.ni_con h2{ display:block; height:40px; width:425px; text-align:center; color:#3a3a3a;}
.ni_con p{ color:#808181; }
.ni_con a:hover{ text-decoration:none;}
.ni_btn{ width:190px; margin:15px auto; line-height:1.9;}
a.tijiao{ height:28px; display:block; width:80px; color:#fff; background:#15bccf; text-align:center; padding-top:4px; float:left; margin-right:15px;}
a:hover.tijiao{ background:#0f99a9;}
.c_blue{ color:#0195bd;}
.c_pink{ color:#e65d5e;}
</style>
<script type="text/javascript">
function clickPublishPoll()
{
hideModal("#popbox02");
$.ajax({
type: "GET",
url: "<%= publish_poll_poll_path(poll.id)%>",
data: 'text',
success: function (data) {
}
});
}
function clickCanel(){hideModal("#popbox02");}
</script>
</head>
<body>
<div id="popbox02">
<div class="ni_con">
<h2>问卷发布</h2>
<p style="text-align: center">
问卷发布后将无法
<span class="c_blue">修改</span>
<br/>
是否确定发布该问卷?
</p>
<div class="ni_btn">
<%= link_to "确 定",publish_poll_poll_path(poll.id), :class => "tijiao", :onclick => "clickCanel();" %>
<a href="#" class="tijiao" onclick="clickCanel();">
取&nbsp;&nbsp;消
</a>
</div>
</div>
</div>
</body>
</html>