2015-01-14 10:05:05 +08:00
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
|
<head>
|
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
|
<title>问卷调查_问卷编辑</title>
|
|
|
|
|
<%= stylesheet_link_tag 'polls', :media => 'all' %>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
function add_MC(){$("#poll_content").append("<%= escape_javascript(render :partial => 'edit_MC') %>");}
|
|
|
|
|
function add_MCQ(){$("#poll_content").append("<%= escape_javascript(render :partial => 'edit_MCQ') %>");}
|
|
|
|
|
function add_single(){$("#poll_content").append("<%= escape_javascript(render :partial => 'edit_single') %>");}
|
|
|
|
|
function add_mulit(){$("#poll_content").append("<%= escape_javascript(render :partial => 'edit_mulit') %>");}
|
2015-01-15 10:50:08 +08:00
|
|
|
|
//问卷头
|
2015-01-15 11:05:19 +08:00
|
|
|
|
function pollsCancel(){$("#polls_head").html("<%= escape_javascript(render :partial => 'show_head', :locals => {:poll => @poll}) %>");}
|
|
|
|
|
function pollsEdit(){$("#polls_head").html("<%= escape_javascript(render :partial => 'edit_head', :locals => {:poll => @poll}) %>");}
|
2015-01-14 14:23:41 +08:00
|
|
|
|
//单选题
|
|
|
|
|
function add_single_answer(doc)
|
|
|
|
|
{
|
2015-01-14 15:35:04 +08:00
|
|
|
|
doc.parent().after("<li class='ur_item'><label>选项<span class='ur_index'></span>:</label><input type='text' name='question_answer["+(doc.parent().siblings("li").length + 1)+"]' placeholder='新建选项'/>" +
|
|
|
|
|
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a><a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
|
|
|
|
|
"</li><div class='cl'></div>");
|
2015-01-14 14:23:41 +08:00
|
|
|
|
}
|
|
|
|
|
function remove_single_answer(doc)
|
|
|
|
|
{
|
|
|
|
|
if(doc.parent().siblings("li").length == 0)
|
|
|
|
|
{
|
|
|
|
|
doc.parent().parent().parent().parent().parent().parent().remove();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
doc.parent().remove();
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-01-14 10:05:05 +08:00
|
|
|
|
</script>
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
<div class=" polls_content polls_edit" id="polls">
|
|
|
|
|
|
|
|
|
|
<div class="tabs_1">
|
|
|
|
|
<ul class="tabs_list">
|
|
|
|
|
<li class="tab_item02 " >
|
|
|
|
|
<a title="<%= l(:label_MC) %>" class="tab_icon icon_radio" onclick="add_MC();">
|
|
|
|
|
<%= l(:label_MC) %>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="tab_item02 " >
|
|
|
|
|
<a title="<%= l(:label_MCQ) %>" class=" tab_icon icon_checkbox" onclick="add_MCQ();">
|
|
|
|
|
<%= l(:label_MCQ) %>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="tab_item02 " >
|
|
|
|
|
<a title="<%= l(:label_single) %>" class="tab_icon icon_text" onclick="add_single();">
|
|
|
|
|
<%= l(:label_single) %>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="tab_item02 " >
|
|
|
|
|
<a title="<%= l(:label_mulit)%>" class="tab_icon icon_textarea" onclick="add_mulit();">
|
|
|
|
|
<%= l(:label_mulit)%>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div><!--选项 end-->
|
|
|
|
|
|
2015-01-15 10:50:08 +08:00
|
|
|
|
<div id="polls_head">
|
2015-01-15 11:05:19 +08:00
|
|
|
|
<%= render :partial => 'show_head', :locals => {:poll => @poll}%>
|
2015-01-15 10:50:08 +08:00
|
|
|
|
</div>
|
2015-01-14 10:05:05 +08:00
|
|
|
|
|
2015-01-14 16:15:33 +08:00
|
|
|
|
<div>
|
|
|
|
|
<% @poll.poll_questions.each do |poll_question|%>
|
|
|
|
|
<%= render :partial => 'show_MC', :locals => {:poll_question => poll_question} %>
|
|
|
|
|
<% end%>
|
|
|
|
|
</div>
|
2015-01-14 10:05:05 +08:00
|
|
|
|
<div id="poll_content">
|
2015-01-14 14:23:41 +08:00
|
|
|
|
<%#= render :partial => 'edit_MC'%>
|
2015-01-14 10:05:05 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="ur_buttons">
|
|
|
|
|
<a href="#" class="ur_button_submit" >
|
|
|
|
|
<%= l(:label_memo_create)%>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
|
|
|
|
|
</div><!--编辑end-->
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|