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

92 lines
3.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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') %>");}
//问卷头
function pollsCancel()
{
$("#polls_head").html("<%= escape_javascript(render :partial => 'show_head', :locals => {:poll => @poll}) %>");
}
//单选题
function add_single_answer(doc)
{
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>");
}
function remove_single_answer(doc)
{
if(doc.parent().siblings("li").length == 0)
{
doc.parent().parent().parent().parent().parent().parent().remove();
}
else
{
doc.parent().remove();
}
}
</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-->
<div id="polls_head">
<%#= render :partial => 'show_head', :locals => {:poll => @poll} %>
<%= render :partial => 'edit_head', :locals => {:poll => @poll}%>
</div>
<div>
<% @poll.poll_questions.each do |poll_question|%>
<%= render :partial => 'show_MC', :locals => {:poll_question => poll_question} %>
<% end%>
</div>
<div id="poll_content">
<%#= render :partial => 'edit_MC'%>
</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>