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

25 lines
1.8 KiB
Plaintext
Raw Normal View History

<%= 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' : ''%>/>");
}
</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>
<input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
<textarea maxlength="250" id="poll_questions_title_<%=poll_question.id%>" class="questionTitle w570" contenteditable="true" type="text"
name="poll_questions_title" 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 name="is_necessary" id="is_necessary_<%=poll_question.id%>" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%> type="checkbox">
必答</label>
2015-01-13 18:21:46 +08:00
</div>
<div class="ur_editor_footer">
2016-10-12 13:34:09 +08:00
<a data-button="cancel" onclick="resetQuestion<%=poll_question.id%>();pollQuestionCancel(<%= poll_question.id%>);" class="grey_btn fr borderRadius" ><%= l(:button_cancel)%></a>
<a data-button="ok" onclick="edit_poll_question($(this),<%= poll_question.id %>);" class="blue_btn fr borderRadius mr5" ><%= l(:label_button_ok)%></a>
2015-01-13 18:21:46 +08:00
</div>
<div class="cl"></div>
</div><!--编辑单行文字end-->
<% end%>