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

55 lines
3.3 KiB
Plaintext
Raw Normal View History

2015-01-16 15:34:25 +08:00
<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
<script type="text/javascript">
function resetQuestion<%=poll_question.id%>()
{
// $("#poll_questions_title_<%#=poll_question.id%>").val("<%#= poll_question.question_title%>");
$("#is_necessary_<%=poll_question.id%>").replaceWith("<input type='checkbox' name='is_necessary' id='is_necessary_<%=poll_question.id%>' value='true' <%= poll_question.is_necessary == 1 ? 'checked' : ''%>/>");
2016-10-12 13:34:09 +08:00
$("#poll_answers_<%=poll_question.id%>").html("<% poll_question.poll_answers.reorder('answer_position').each do |poll_answer| %>" +
"<li class='ur_item new_answer'>" +
"<label class='ml50'>问题<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>" +
"<input type='text' maxlength='200' class='w520' name='question_answer[<%= poll_answer.id %>]' placeholder='请输入主观题分题的问题' value='<%= poll_answer.answer_text%>'/>" +
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
"</li>" +
"<div class='cl'></div>" +
"<% end%>");
}
</script>
2016-10-12 13:34:09 +08:00
<div class="questionEditContainer"> <!--编辑多行文字start-->
2015-01-13 18:21:46 +08:00
<div class="ur_editor_title">
<label for="ur_question_title" class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
2015-01-16 15:34:25 +08:00
<input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
<textarea maxlength="250" class="questionTitle w570" type="text" name="poll_questions_title" id="poll_questions_title_<%=poll_question.id%>" placeholder="请输入多行主观题的问题描述" onfocus="autoHeight('#poll_questions_title_<%=poll_question.id%>',30)"><%= poll_question.question_title%></textarea>
2016-10-12 13:34:09 +08:00
<label>
<input id="is_necessary_<%=poll_question.id%>" name="is_necessary" value="true" type="checkbox" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/>
必答
</label>
2015-01-13 18:21:46 +08:00
</div>
2016-10-12 13:34:09 +08:00
<div class="ur_editor_content">
<ul id="poll_answers_<%=poll_question.id%>">
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<li class='ur_item new_answer'>
<label class="ml50">问题<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input type='text' class="w520" maxlength="200" name='question_answer[<%= poll_answer.id %>]' placeholder='请输入主观题分题的问题' value="<%= poll_answer.answer_text%>"/>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li>
<div class='cl'></div>
<% end%>
</ul>
<ul>
<li class="ur_item">
<div class="dash-block new-subjective w520" onclick="add_multi_question($(this))">新建选项</div>
</li>
<div class="cl"></div>
</ul>
2015-01-13 18:21:46 +08:00
</div>
<div class="ur_editor_footer">
2016-10-12 13:34:09 +08:00
<a class="grey_btn fr borderRadius" data-button="cancel" onclick="resetQuestion<%=poll_question.id%>();pollQuestionCancel(<%= poll_question.id%>);">
2015-01-27 10:14:05 +08:00
<%= l(:button_cancel)%>
</a>
2016-10-12 13:34:09 +08:00
<a class="blue_btn fr borderRadius mr5" data-button="ok" onclick="edit_poll_question($(this),<%= poll_question.id %>);">
<%= l(:label_button_ok)%>
</a>
2015-01-13 18:21:46 +08:00
</div>
<div class="cl"></div>
2015-01-16 15:34:25 +08:00
</div><!--编辑多行文字end-->
<% end%>