Merge branch 'Poll' of http://repository.trustie.net/xianbo/trustie2 into Poll
commit
e49dfefefb
@ -0,0 +1,28 @@
|
||||
<div class="ur_table_result">
|
||||
<table border="0" cellspacing="0" cellpadding="0" >
|
||||
<tbody>
|
||||
<tr class="table_bluebg">
|
||||
<td class="td327"><%= l(:label_poll_options) %> </td>
|
||||
<td class="td42"><%= l(:label_poll_subtotal) %> </td>
|
||||
<td class="td287"><%= l(:label_poll_proportion) %> </td>
|
||||
</tr>
|
||||
<% poll_question.poll_answers.each do |poll_answer| %>
|
||||
<tr>
|
||||
<td class="td327"><%= poll_answer.answer_text %> </td>
|
||||
<td class="td42"><%= poll_answer.poll_votes.count %> </td>
|
||||
<td class="td287">
|
||||
<div class="Bar">
|
||||
<span style="width:<%= statistics_result_percentage(poll_answer.poll_votes.count, @poll.users.count) %>%;" id="choice_percentage_<%= poll_answer.id %>"></span>
|
||||
</div>
|
||||
<%= statistics_result_percentage(poll_answer.poll_votes.count, @poll.users.count) %>%</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr class="table_bluebg">
|
||||
<td class="td327"><%= l(:label_poll_valid_commit) %> </td>
|
||||
<td class="td42"><%= poll_question.poll_votes.count %></td>
|
||||
<td class="td287"> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -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_title">
|
||||
<label for="ur_question_title">问题: </label>
|
||||
<input id="ur_question_title" class="ur_question_title" contenteditable="true" type="text" name="title" placeholder="请输入多行文字标题"/>
|
||||
<input type="checkbox" name="required" value="true" id="ur_question_require" checked=""/>
|
||||
<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 type="checkbox" name="is_necessary" value="true" <%= poll_question.is_necessary == 1 ? "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>
|
||||
<!--<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>
|
||||
<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-->
|
||||
</div><!--编辑多行文字end-->
|
||||
<% end%>
|
@ -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,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_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>
|
||||
<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 type="checkbox" name="is_necessary" value="true" checked/>
|
||||
<label>必答</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>
|
||||
<!--<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>
|
||||
<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-->
|
||||
</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,10 +1,26 @@
|
||||
<% 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} %>
|
||||
<% if poll_question.question_type == 1%>
|
||||
<%= render :partial => 'show_MC', :locals => {:poll_question => poll_question} %>
|
||||
<% elsif poll_question.question_type == 2%>
|
||||
<%= render :partial => 'show_MCQ', :locals => {:poll_question => poll_question} %>
|
||||
<% elsif poll_question.question_type == 3%>
|
||||
<%= render :partial => 'show_single', :locals => {:poll_question => poll_question} %>
|
||||
<% elsif poll_question.question_type == 4%>
|
||||
<%= render :partial => 'show_mulit', :locals => {:poll_question => poll_question} %>
|
||||
<% end%>
|
||||
</div>
|
||||
<div id="edit_poll_questions_<%= poll_question.id %>" style="display: none;">
|
||||
<%= render :partial => 'edit_MC', :locals => {:poll_question => poll_question} %>
|
||||
<% if poll_question.question_type == 1%>
|
||||
<%= render :partial => 'edit_MC', :locals => {:poll_question => poll_question} %>
|
||||
<% elsif poll_question.question_type == 2%>
|
||||
<%= render :partial => 'edit_MCQ', :locals => {:poll_question => poll_question} %>
|
||||
<% elsif poll_question.question_type == 3%>
|
||||
<%= render :partial => 'edit_single', :locals => {:poll_question => poll_question} %>
|
||||
<% elsif poll_question.question_type == 4%>
|
||||
<%= render :partial => 'edit_mulit', :locals => {:poll_question => poll_question} %>
|
||||
<% end%>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
@ -1,10 +1,26 @@
|
||||
$("#new_poll_question").html("");
|
||||
$("#poll_content").append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
|
||||
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
|
||||
"<% if @poll_questions.question_type == 1%>" +
|
||||
"<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_questions}) %>" +
|
||||
"<% elsif @poll_questions.question_type == 2%>" +
|
||||
"<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_questions}) %>" +
|
||||
"<% elsif @poll_questions.question_type == 3%>" +
|
||||
"<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_questions}) %>" +
|
||||
"<% elsif @poll_questions.question_type == 4%>" +
|
||||
"<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_questions}) %>" +
|
||||
"<% end%>" +
|
||||
"</div>" +
|
||||
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
|
||||
"<% if @poll_questions.question_type == 1%>" +
|
||||
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:poll_question => @poll_questions}) %>" +
|
||||
"<% elsif @poll_questions.question_type == 2%>" +
|
||||
"<%= escape_javascript(render :partial => 'edit_MCQ', :locals => {:poll_question => @poll_questions}) %>" +
|
||||
"<% elsif @poll_questions.question_type == 3%>" +
|
||||
"<%= escape_javascript(render :partial => 'edit_single', :locals => {:poll_question => @poll_questions}) %>" +
|
||||
"<% elsif @poll_questions.question_type == 4%>" +
|
||||
"<%= escape_javascript(render :partial => 'edit_mulit', :locals => {:poll_question => @poll_questions}) %>" +
|
||||
"<% end%>" +
|
||||
"</div>" +
|
||||
"</div>");
|
||||
|
||||
|
@ -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