实现添加多行文字

This commit is contained in:
sw 2015-01-16 15:34:25 +08:00
parent 65a3ddce41
commit fe3a84c8db
3 changed files with 34 additions and 20 deletions

View File

@ -1,18 +1,21 @@
<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
<div class="ur_editor textarea"> <!--编辑多行文字start--> <div class="ur_editor textarea"> <!--编辑多行文字start-->
<div class="ur_editor_title"> <div class="ur_editor_title">
<label for="ur_question_title">问题:&nbsp;&nbsp;</label> <label for="ur_question_title">问题:&nbsp;&nbsp;</label>
<input id="ur_question_title" class="ur_question_title" contenteditable="true" type="text" name="title" placeholder="请输入多行文字标题"/> <input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
<input type="checkbox" name="required" value="true" id="ur_question_require" checked=""/> <input class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title_<%=poll_question.id%>" 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> <label for="ur_question_require">必答</label>
</div> </div>
<div class="ur_editor_toolbar"> <div class="ur_editor_toolbar">
<label>尺寸:</label> <!--<label>尺寸:</label>-->
<label>宽 <input name="cols" type="number" min="1" value="60"> 字</label>, <!--<label>宽 <input name="cols" type="number" min="1" value="60"> 字</label>,-->
<label>高 <input name="rows" type="number" min="1" value="5"> 行</label> <!--<label>高 <input name="rows" type="number" min="1" value="5"> 行</label>-->
</div> </div>
<div class="ur_editor_footer"> <div class="ur_editor_footer">
<a class="btn_submit" data-button="ok">确定</a> <a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
<a class="btn_cancel" data-button="cancel">取消</a> <a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">取消</a>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div><!--编辑多行文字end--> </div><!--编辑多行文字end-->
<% end%>

View File

@ -1,18 +1,21 @@
<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>
<div class="ur_editor textarea"> <!--编辑多行文字start--> <div class="ur_editor textarea"> <!--编辑多行文字start-->
<div class="ur_editor_title"> <div class="ur_editor_title">
<label for="ur_question_title">问题:&nbsp;&nbsp;</label> <label for="ur_question_title">问题:&nbsp;&nbsp;</label>
<input id="poll_questions_title" class="ur_question_title" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入多行文字标题"/> <input type="hidden" name="question_type" value="4"/>
<input type="checkbox" name="required" value="true" id="ur_question_require" checked=""/> <input id="poll_questions_title" class="ur_question_title" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入多行文字标题"/>
<label for="ur_question_require">必答</label> <input type="checkbox" name="is_necessary" value="true" checked/>
<label>必答</label>
</div> </div>
<div class="ur_editor_toolbar"> <div class="ur_editor_toolbar">
<label>尺寸:</label> <!--<label>尺寸:</label>-->
<label>宽 <input name="cols" type="number" min="1" value="60"> 字</label>, <!--<label>宽 <input name="cols" type="number" min="1" value="60"> 字</label>,-->
<label>高 <input name="rows" type="number" min="1" value="5"> 行</label> <!--<label>高 <input name="rows" type="number" min="1" value="5"> 行</label>-->
</div> </div>
<div class="ur_editor_footer"> <div class="ur_editor_footer">
<a class="btn_submit" data-button="ok">确定</a> <a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
<a class="btn_cancel" data-button="cancel">取消</a> <a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">取消</a>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div><!--编辑多行文字end--> </div><!--编辑多行文字end-->
<% end%>

View File

@ -1,10 +1,18 @@
<div class="ur_question_item textarea ur_editor02"> <div class="ur_question_item textarea ur_editor02">
<div class="ur_preview"> <div class="ur_preview">
<div class="ur_title"> <div class="ur_title">
<span class="title_index">第4题</span> 多行主观 <span class="title_index">
第<%= poll_question.question_number%>题:
</span>
<%= poll_question.question_title %>
<%if poll_question.is_necessary == 1%>
<span class="ur_required" title="必答">*</span>
<%end%>
(多行主观)
</div> </div>
<a href="#" class="ur_icon_de" title="删除"></a> <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
<a href="#" class="ur_icon_edit" title="编辑"></a> method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div> <div class="cl"></div>
<div class="ur_inputs"> <div class="ur_inputs">
<textarea class="ur_textbox" rows="5" cols="60"></textarea> <textarea class="ur_textbox" rows="5" cols="60"></textarea>