parent
f46c8e8adc
commit
65a3ddce41
@ -1,13 +1,17 @@
|
||||
<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
|
||||
<div class="ur_editor text "> <!--编辑单行文字start-->
|
||||
<div class="ur_editor_title">
|
||||
<label for="ur_question_title">问题: </label>
|
||||
<input id="ur_question_title_1" class="ur_question_title" contenteditable="true" type="text" name="title" placeholder="请输入单行文字标题"/>
|
||||
<input type="checkbox" name="required" value="true" id="ur_question_require_2" checked=""/>
|
||||
<input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
|
||||
<input id="poll_questions_title_<%=poll_question.id%>" class="ur_question_title" contenteditable="true" type="text"
|
||||
name="poll_questions_title" placeholder="请输入单行文字标题" value="<%= poll_question.question_title%>"/>
|
||||
<input type="checkbox" name="is_necessary" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/>
|
||||
<label for="ur_question_require">必答</label>
|
||||
</div>
|
||||
<div class="ur_editor_footer">
|
||||
<a class="btn_submit" data-button="ok">确定</a>
|
||||
<a class="btn_cancel" data-button="cancel">取消</a>
|
||||
<a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
|
||||
<a class="btn_cancel" data-button="cancel" onclick="pollQuestionCancel(<%= poll_question.id%>);">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--编辑单行文字end-->
|
||||
</div><!--编辑单行文字end-->
|
||||
<% end%>
|
@ -1,13 +1,16 @@
|
||||
<div class="ur_editor text "> <!--编辑单行文字start-->
|
||||
<div class="ur_editor_title">
|
||||
<label for="ur_question_title">问题: </label>
|
||||
<input id="poll_questions_title" class="ur_question_title" contenteditable="true" type="text" name="title" placeholder="请输入单行文字标题"/>
|
||||
<input type="checkbox" name="required" value="true" id="ur_question_require_2" checked=""/>
|
||||
<label for="ur_question_require">必答</label>
|
||||
</div>
|
||||
<div class="ur_editor_footer">
|
||||
<a class="btn_submit" data-button="ok">确定</a>
|
||||
<a class="btn_cancel" data-button="cancel">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--编辑单行文字end-->
|
||||
<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>
|
||||
<div class="ur_editor text "> <!--编辑单行文字start-->
|
||||
<div class="ur_editor_title">
|
||||
<label for="ur_question_title">问题: </label>
|
||||
<input type="hidden" name="question_type" value="3"/>
|
||||
<input id="poll_questions_title" class="ur_question_title" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入单行文字标题"/>
|
||||
<input type="checkbox" name="is_necessary" value="true" checked/>
|
||||
<label for="ur_question_require">必答</label>
|
||||
</div>
|
||||
<div class="ur_editor_footer">
|
||||
<a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
|
||||
<a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--编辑单行文字end-->
|
||||
<% end%>
|
@ -1,6 +1,22 @@
|
||||
$("#poll_questions_<%= @poll_question.id%>").html("<div id='show_poll_questions_<%= @poll_question.id %>'>" +
|
||||
"<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_question}) %>" +
|
||||
"<% if @poll_question.question_type == 1%>" +
|
||||
"<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_question}) %>" +
|
||||
"<% elsif @poll_question.question_type == 2%>" +
|
||||
"<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_question}) %>" +
|
||||
"<% elsif @poll_question.question_type == 3%>" +
|
||||
"<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_question}) %>" +
|
||||
"<% elsif @poll_question.question_type == 4%>" +
|
||||
"<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_question}) %>" +
|
||||
"<% end%>" +
|
||||
"</div>" +
|
||||
"<div id='edit_poll_questions_<%= @poll_question.id %>' style='display: none;'>" +
|
||||
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:poll_question => @poll_question}) %>" +
|
||||
"<% if @poll_question.question_type == 1%>" +
|
||||
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:poll_question => @poll_question}) %>" +
|
||||
"<% elsif @poll_question.question_type == 2%>" +
|
||||
"<%= escape_javascript(render :partial => 'edit_MCQ', :locals => {:poll_question => @poll_question}) %>" +
|
||||
"<% elsif @poll_question.question_type == 3%>" +
|
||||
"<%= escape_javascript(render :partial => 'edit_single', :locals => {:poll_question => @poll_question}) %>" +
|
||||
"<% elsif @poll_question.question_type == 4%>" +
|
||||
"<%= escape_javascript(render :partial => 'edit_mulit', :locals => {:poll_question => @poll_question}) %>" +
|
||||
"<% end%>" +
|
||||
"</div>");
|
||||
|
Loading…
Reference in new issue