2015-01-16 14:39:40 +08:00
|
|
|
|
<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%><!--编辑多选start-->
|
2015-01-17 11:58:19 +08:00
|
|
|
|
<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' : ''%>/>");
|
|
|
|
|
$("#poll_answers_<%=poll_question.id%>").html("<% poll_question.poll_answers.reorder('answer_position').each do |poll_answer| %>" +
|
|
|
|
|
"<li class='ur_item'>" +
|
|
|
|
|
"<label>选项<span class='ur_index'></span>:</label>" +
|
|
|
|
|
"<input type='text' maxlength='200' name='question_answer[<%= poll_answer.id %>]' placeholder='新建选项' value='<%= poll_answer.answer_text%>'/>" +
|
|
|
|
|
"<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>" +
|
|
|
|
|
"<% end%>");
|
|
|
|
|
}
|
|
|
|
|
</script>
|
2015-01-13 18:21:46 +08:00
|
|
|
|
<div class="ur_editor checkbox">
|
|
|
|
|
<div class="ur_editor_title">
|
2015-01-16 14:39:40 +08:00
|
|
|
|
<input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
|
2015-01-21 11:50:33 +08:00
|
|
|
|
<input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title_<%=poll_question.id%>" placeholder="请输入多选题标题" value="<%= poll_question.question_title%>"/>
|
2015-01-17 11:58:19 +08:00
|
|
|
|
<input type="checkbox" name="is_necessary" id="is_necessary_<%=poll_question.id%>" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/>
|
2015-01-16 14:39:40 +08:00
|
|
|
|
<label>必答</label>
|
2015-01-13 18:21:46 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="ur_editor_content">
|
2015-01-17 11:58:19 +08:00
|
|
|
|
<ul id="poll_answers_<%=poll_question.id%>">
|
2015-01-16 14:39:40 +08:00
|
|
|
|
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
|
|
|
|
|
<li class='ur_item'>
|
|
|
|
|
<label>选项<span class='ur_index'></span>:</label>
|
2015-01-17 11:05:38 +08:00
|
|
|
|
<input maxlength="200" type='text' name='question_answer[<%= poll_answer.id %>]' placeholder='新建选项' value="<%= poll_answer.answer_text%>"/>
|
2015-01-16 14:39:40 +08:00
|
|
|
|
<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>
|
|
|
|
|
<% end%>
|
2015-01-13 18:21:46 +08:00
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ur_editor_footer">
|
2015-01-29 17:01:19 +08:00
|
|
|
|
<a class="btn btn_dark btn_submit" data-button="ok" onclick="edit_poll_question($(this),<%= poll_question.id %>);">
|
2015-01-27 10:14:05 +08:00
|
|
|
|
<%= l(:label_button_ok)%>
|
|
|
|
|
</a>
|
|
|
|
|
<a class="btn btn_light btn_cancel" data-button="cancel" onclick="resetQuestion<%=poll_question.id%>();pollQuestionCancel(<%= poll_question.id%>);">
|
|
|
|
|
<%= l(:button_cancel)%>
|
|
|
|
|
</a>
|
2015-01-13 18:21:46 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
2015-01-16 14:39:40 +08:00
|
|
|
|
</div><!--编辑多选 end-->
|
|
|
|
|
<% end%>
|