Merge branch 'Poll' of http://repository.trustie.net/xianbo/trustie2 into Poll
commit
30a058133d
@ -1,21 +1,15 @@
|
|||||||
<script type="text/javascript">
|
<%= form_for @poll,:remote => true do |f|%>
|
||||||
function regexPollsTitle()
|
<div class="ur_editor ur_title_editor"> <!--编辑头部start-->
|
||||||
{
|
<div class="ur_title_editor_title">
|
||||||
var polls_title = $.trim($("#polls_title").val());
|
<input type="text" name="polls_name" id="polls_title" value="<%= @poll.polls_name %>" class="input_title" placeholder="问卷标题"/>
|
||||||
alert(polls_title);
|
</div>
|
||||||
}
|
<div class="ur_title_editor_prefix">
|
||||||
</script>
|
<textarea name="polls_description" id="polls_description" class="textarea_editor"><%= @poll.polls_description%></textarea>
|
||||||
<div class="ur_editor ur_title_editor"> <!--编辑头部start-->
|
</div>
|
||||||
<div class="ur_title_editor_title">
|
<div class="ur_editor_footer">
|
||||||
<input type="text" name="title" id="polls_title" class="input_title" placeholder="问卷标题" onkeyup="regexPollsTitle();"/>
|
<a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
|
||||||
</div>
|
<a class="btn_cancel" data-button="cancel" onclick="pollsCancel();">取消</a>
|
||||||
<div class="ur_title_editor_prefix">
|
</div>
|
||||||
<textarea name="prefix" class="textarea_editor" placeholder="问卷描述">
|
<div class="cl"></div>
|
||||||
</textarea>
|
</div><!--编辑头部 end-->
|
||||||
</div>
|
<% end%>
|
||||||
<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-->
|
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
<div class="ur_editor textarea"> <!--编辑多行文字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="poll_questions_title" placeholder="请输入多行文字标题"/>
|
||||||
|
<input type="checkbox" name="required" value="true" id="ur_question_require" checked=""/>
|
||||||
|
<label for="ur_question_require">必答</label>
|
||||||
|
</div>
|
||||||
|
<div class="ur_editor_toolbar">
|
||||||
|
<label>尺寸:</label>
|
||||||
|
<label>宽 <input name="cols" type="number" min="1" value="60"> 字</label>,
|
||||||
|
<label>高 <input name="rows" type="number" min="1" value="5"> 行</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-->
|
@ -0,0 +1,13 @@
|
|||||||
|
<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-->
|
@ -0,0 +1,10 @@
|
|||||||
|
<% poll.poll_questions.each do |poll_question|%>
|
||||||
|
<div id="poll_questions_<%= poll_question.id%>">
|
||||||
|
<div id="show_poll_questions_<%= poll_question.id %>">
|
||||||
|
<%= render :partial => 'show_MC', :locals => {:poll_question => poll_question} %>
|
||||||
|
</div>
|
||||||
|
<div id="edit_poll_questions_<%= poll_question.id %>" style="display: none;">
|
||||||
|
<%= render :partial => 'edit_MC', :locals => {:poll_question => poll_question} %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
@ -1,8 +1,10 @@
|
|||||||
<div class="ur_page_head ur_editor02" ><!--头部显示 start-->
|
<div class="ur_page_head ur_editor02"><!--头部显示 start-->
|
||||||
<h1 class="ur_page_title">标题标题标题标题标题标题标题</h1>
|
<a href="#" class="ur_icon_edit" title="编辑" onclick="pollsEdit();"></a>
|
||||||
<p class="ur_prefix_content">描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述
|
<h1 class="ur_page_title" id="polls_name_h">
|
||||||
描述描述描述描述描述描述描述描述描述描述描述描述
|
<%= poll.polls_name%>
|
||||||
|
</h1>
|
||||||
|
<p class="ur_prefix_content" id="polls_description_p">
|
||||||
|
<%= @poll.polls_description%>
|
||||||
</p>
|
</p>
|
||||||
<a href="#" class="ur_icon_edit" title="编辑"></a>
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div><!--头部显示 end-->
|
</div><!--头部显示 end-->
|
@ -0,0 +1,10 @@
|
|||||||
|
$("#new_poll_question").html("");
|
||||||
|
$("#poll_content").append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
|
||||||
|
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
|
||||||
|
"<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_questions}) %>" +
|
||||||
|
"</div>" +
|
||||||
|
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
|
||||||
|
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:poll_question => @poll_questions}) %>" +
|
||||||
|
"</div>" +
|
||||||
|
"</div>");
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
$("#poll_content").html("<%= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll}) %>");
|
@ -0,0 +1,6 @@
|
|||||||
|
$("#polls_title").val("<%= @poll.polls_name%>");
|
||||||
|
$("#polls_description").val("<%= @poll.polls_description %>");
|
||||||
|
$("#polls_name_h").html("<%= @poll.polls_name %>");
|
||||||
|
$("#polls_description_p").html("<%= @poll.polls_description %>");
|
||||||
|
$("#polls_head_edit").hide();
|
||||||
|
$("#polls_head_show").show();
|
Loading…
Reference in new issue