This commit is contained in:
huang 2015-01-17 11:47:02 +08:00
commit e75193e35a
11 changed files with 21 additions and 21 deletions

View File

@ -4,7 +4,7 @@
<div class="ur_editor_title"> <div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label> <label>问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/> <input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
<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 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%>"/>
<input type="checkbox" name="is_necessary" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/> <input type="checkbox" name="is_necessary" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/>
<label>必答</label> <label>必答</label>
</div> </div>
@ -13,7 +13,7 @@
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %> <% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<li class='ur_item'> <li class='ur_item'>
<label>选项<span class='ur_index'></span></label> <label>选项<span class='ur_index'></span></label>
<input type='text' name='question_answer[<%= poll_answer.id %>]' placeholder='新建选项' value="<%= poll_answer.answer_text%>"/> <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_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a> <a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li> </li>

View File

@ -2,7 +2,7 @@
<div class="ur_editor checkbox"> <div class="ur_editor checkbox">
<div class="ur_editor_title"> <div class="ur_editor_title">
<input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/> <input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
<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 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%>"/>
<input type="checkbox" name="is_necessary" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/> <input type="checkbox" name="is_necessary" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/>
<label>必答</label> <label>必答</label>
</div> </div>
@ -11,7 +11,7 @@
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %> <% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<li class='ur_item'> <li class='ur_item'>
<label>选项<span class='ur_index'></span></label> <label>选项<span class='ur_index'></span></label>
<input type='text' name='question_answer[<%= poll_answer.id %>]' placeholder='新建选项' value="<%= poll_answer.answer_text%>"/> <input maxlength="200" type='text' 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_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a> <a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li> </li>

View File

@ -1,10 +1,10 @@
<%= form_for @poll,:remote => true do |f|%> <%= form_for @poll,:remote => true do |f|%>
<div class="ur_editor ur_title_editor"> <!--编辑头部start--> <div class="ur_editor ur_title_editor"> <!--编辑头部start-->
<div class="ur_title_editor_title"> <div class="ur_title_editor_title">
<input type="text" name="polls_name" id="polls_title" value="<%= @poll.polls_name %>" class="input_title" placeholder="问卷标题"/> <input type="text" maxlength="100" name="polls_name" id="polls_title" value="<%= @poll.polls_name %>" class="input_title" placeholder="问卷标题"/>
</div> </div>
<div class="ur_title_editor_prefix"> <div class="ur_title_editor_prefix">
<textarea name="polls_description" id="polls_description" class="textarea_editor"><%= @poll.polls_description%></textarea> <textarea name="polls_description" maxlength="300" id="polls_description" class="textarea_editor"><%= @poll.polls_description%></textarea>
</div> </div>
<div class="ur_editor_footer"> <div class="ur_editor_footer">
<a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a> <a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>

View File

@ -3,7 +3,7 @@
<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 type="hidden" name="question_type" value="<%= poll_question.question_type%>"/> <input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
<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 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%>"/>
<input type="checkbox" name="is_necessary" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/> <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>

View File

@ -3,7 +3,7 @@
<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 type="hidden" name="question_type" value="<%= poll_question.question_type%>"/> <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" <input maxlength="250" 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%>"/> name="poll_questions_title" placeholder="请输入单行主观标题" value="<%= poll_question.question_title%>"/>
<input type="checkbox" name="is_necessary" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/> <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>

View File

@ -4,7 +4,7 @@
<div class="ur_editor_title"> <div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label> <label>问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="1"/> <input type="hidden" name="question_type" value="1"/>
<input class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入单选题标题"/> <input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入单选题标题"/>
<input type="checkbox" name="is_necessary" value="true" checked/> <input type="checkbox" name="is_necessary" value="true" checked/>
<label>必答</label> <label>必答</label>
</div> </div>
@ -12,21 +12,21 @@
<ul> <ul>
<li class='ur_item'> <li class='ur_item'>
<label>选项<span class='ur_index'></span></label> <label>选项<span class='ur_index'></span></label>
<input type='text' name='question_answer[0]' placeholder='新建选项'/> <input maxlength="200" type='text' name='question_answer[0]' placeholder='新建选项'/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a> <a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a> <a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li> </li>
<div class='cl'></div> <div class='cl'></div>
<li class='ur_item'> <li class='ur_item'>
<label>选项<span class='ur_index'></span></label> <label>选项<span class='ur_index'></span></label>
<input type='text' name='question_answer[1]' placeholder='新建选项'/> <input maxlength="200" type='text' name='question_answer[1]' placeholder='新建选项'/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a> <a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a> <a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li> </li>
<div class='cl'></div> <div class='cl'></div>
<li class='ur_item'> <li class='ur_item'>
<label>选项<span class='ur_index'></span></label> <label>选项<span class='ur_index'></span></label>
<input type='text' name='question_answer[2]' placeholder='新建选项'/> <input maxlength="200" type='text' name='question_answer[2]' placeholder='新建选项'/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a> <a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a> <a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li> </li>

View File

@ -3,7 +3,7 @@
<div class="ur_editor_title"> <div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label> <label>问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="2"/> <input type="hidden" name="question_type" value="2"/>
<input class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入多选题题标题"/> <input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入多选题题标题"/>
<input type="checkbox" name="is_necessary" value="true" checked/> <input type="checkbox" name="is_necessary" value="true" checked/>
<label>必答</label> <label>必答</label>
</div> </div>
@ -11,21 +11,21 @@
<ul> <ul>
<li class='ur_item'> <li class='ur_item'>
<label>选项<span class='ur_index'></span></label> <label>选项<span class='ur_index'></span></label>
<input type='text' name='question_answer[0]' placeholder='新建选项'/> <input maxlength="200" type='text' name='question_answer[0]' placeholder='新建选项'/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a> <a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a> <a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li> </li>
<div class='cl'></div> <div class='cl'></div>
<li class='ur_item'> <li class='ur_item'>
<label>选项<span class='ur_index'></span></label> <label>选项<span class='ur_index'></span></label>
<input type='text' name='question_answer[1]' placeholder='新建选项'/> <input maxlength="200" type='text' name='question_answer[1]' placeholder='新建选项'/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a> <a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a> <a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li> </li>
<div class='cl'></div> <div class='cl'></div>
<li class='ur_item'> <li class='ur_item'>
<label>选项<span class='ur_index'></span></label> <label>选项<span class='ur_index'></span></label>
<input type='text' name='question_answer[2]' placeholder='新建选项'/> <input maxlength="200" type='text' name='question_answer[2]' placeholder='新建选项'/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a> <a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a> <a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li> </li>

View File

@ -3,7 +3,7 @@
<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 type="hidden" name="question_type" value="4"/> <input type="hidden" name="question_type" value="4"/>
<input id="poll_questions_title" class="ur_question_title" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入多行主观标题"/> <input maxlength="250" 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/> <input type="checkbox" name="is_necessary" value="true" checked/>
<label>必答</label> <label>必答</label>
</div> </div>

View File

@ -3,7 +3,7 @@
<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 type="hidden" name="question_type" value="3"/> <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 maxlength="250" 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/> <input type="checkbox" name="is_necessary" value="true" checked/>
<label for="ur_question_require">必答</label> <label for="ur_question_require">必答</label>
</div> </div>

View File

@ -39,7 +39,7 @@
//单选题 //单选题
function add_single_answer(doc) function add_single_answer(doc)
{ {
doc.parent().after("<li class='ur_item'><label>选项<span class='ur_index'></span></label><input type='text' name='question_answer["+new Date().getTime()+"]' placeholder='新建选项'/>" + doc.parent().after("<li class='ur_item'><label>选项<span class='ur_index'></span></label><input maxlength='200' type='text' name='question_answer["+new Date().getTime()+"]' placeholder='新建选项'/>" +
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a><a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+ "<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>"); "</li><div class='cl'></div>");
} }

View File

@ -180,7 +180,7 @@
} }
</script> </script>
<input class="ur_text ur_textbox" type="text" size="" maxlength="" value="<%= get_anwser_vote_text(pq.id,User.current.id) %>" onblur="onblur_<%= pq.id %>(this);" <%= @can_edit_poll?"":"disabled=disabled" %>> <input class="ur_text ur_textbox" type="text" size="" maxlength="" value="<%= get_anwser_vote_text(pq.id,User.current.id).html_safe %>" onblur="onblur_<%= pq.id %>(this);" <%= @can_edit_poll?"":"disabled=disabled" %>>
</div> </div>
</li><!--单行输入 end--> </li><!--单行输入 end-->
<% elsif pq.question_type == 4 %> <% elsif pq.question_type == 4 %>
@ -222,7 +222,7 @@
}); });
} }
</script> </script>
<div contenteditable='<%= @can_edit_poll %>' class="ur_textbox" style="min-height: 150px;width: 100%;<%= @can_edit_poll?"":"background-color:#DCDCDC;" %>" onblur="onblur_<%= pq.id %>(this);"><%= get_anwser_vote_text(pq.id,User.current.id) %></div> <div contenteditable='<%= @can_edit_poll %>' class="ur_textbox" style="min-height: 150px;width: 100%;<%= @can_edit_poll?"":"background-color:#DCDCDC;" %>" onblur="onblur_<%= pq.id %>(this);"><%= get_anwser_vote_text(pq.id,User.current.id).html_safe %></div>
</div> </div>
</div> </div>
</li><!--多行输入 end--> </li><!--多行输入 end-->