Merge branch 'szzh' of http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git into szzh
commit
092265d53c
@ -1,2 +0,0 @@
|
||||
class PollAnswerController < ApplicationController
|
||||
end
|
@ -1,2 +0,0 @@
|
||||
class PollQuestionController < ApplicationController
|
||||
end
|
@ -1,2 +0,0 @@
|
||||
class PollUserController < ApplicationController
|
||||
end
|
@ -1,2 +0,0 @@
|
||||
class PollVoteController < ApplicationController
|
||||
end
|
@ -0,0 +1,77 @@
|
||||
# encoding: utf-8
|
||||
#
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
module PollHelper
|
||||
#判断选项是否被选中
|
||||
def answer_be_selected?(answer,user)
|
||||
pv = answer.poll_votes.where("#{PollVote.table_name}.user_id = #{user.id} ")
|
||||
if !pv.nil? && pv.count > 0
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
#获取文本题答案
|
||||
def get_anwser_vote_text(question_id,user_id)
|
||||
pv = PollVote.find_by_poll_question_id_and_user_id(question_id,user_id)
|
||||
if pv.nil?
|
||||
''
|
||||
else
|
||||
pv.vote_text
|
||||
end
|
||||
end
|
||||
|
||||
#判断用户是否已经提交了问卷
|
||||
def has_commit_poll?(poll_id,user_id)
|
||||
pu = PollUser.find_by_poll_id_and_user_id(poll_id,user_id)
|
||||
if pu.nil?
|
||||
false
|
||||
else
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
#统计答题百分比,统计结果保留两位小数
|
||||
def statistics_result_percentage(e, t)
|
||||
e = e.to_f
|
||||
t = t.to_f
|
||||
t == 0 ? 0 : format("%.2f", e*100/t)
|
||||
end
|
||||
|
||||
#多选的时候查询去重
|
||||
def total_answer id
|
||||
total = PollVote.find_by_sql("SELECT distinct(user_id) FROM `poll_votes` where poll_question_id = #{id}").count
|
||||
end
|
||||
|
||||
#页面体型显示
|
||||
def options_show pq
|
||||
case pq
|
||||
when 1
|
||||
"单选题"
|
||||
when 2
|
||||
"多选题"
|
||||
when 3
|
||||
"单行主观题"
|
||||
else
|
||||
"多行主观题"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -1,15 +1,42 @@
|
||||
<h1><%= link_to(h("#{issue.tracker.name} ##{issue.project_index}: #{issue.subject}"), issue_url) %></h1>
|
||||
|
||||
<!-- <h1><%#= link_to(h("#{issue.tracker.name} ##{issue.project_index}: #{issue.subject}"), issue_url) %></h1> -->
|
||||
<p>
|
||||
<span class="c_blue">
|
||||
<%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %>
|
||||
</span>在
|
||||
<span class="c_blue"><%= link_to(h("#{@issue.project.name}"),@project_url) %></span>中有了一个与您相关的最新活动,请您关注!</p>
|
||||
<div class="mail_box">
|
||||
<ul>
|
||||
<li><%=l(:field_author)%>: <%=h issue.author %></li>
|
||||
<li><%=l(:field_status)%>: <%=h issue.status %></li>
|
||||
<li><%=l(:field_priority)%>: <%=h issue.priority %></li>
|
||||
<li><%=l(:field_assigned_to)%>: <%=h issue.assigned_to %></li>
|
||||
<li><%=l(:field_category)%>: <%=h issue.category %></li>
|
||||
<li><%=l(:field_fixed_version)%>: <%=h issue.fixed_version %></li>
|
||||
<% issue.custom_field_values.each do |c| %>
|
||||
<li><%=h c.custom_field.name %>: <%=h show_value(c) %></li>
|
||||
<% end %>
|
||||
<li style="list-style-type:none"><span style="float: left"><strong>标题:</strong></span><span style="float: left; width: 500px"><%= link_to(issue.subject, issue_url) %></span></li>
|
||||
<li style="list-style-type:none"><span style="float: left"> <strong>来源:</strong></span><span style="float: left; width: 500px"><%= issue.project.name %><b>| </b>项目<%= issue.tracker.name%></span></li>
|
||||
<li style="list-style-type:none"><span style="float: left"> <strong >内容:</strong></span><span style="float: left; width: 500px">
|
||||
<%= issue.description %></span>
|
||||
</li>
|
||||
<li style="list-style-type:none">
|
||||
|
||||
<% unless @issue.attachments.nil? %>
|
||||
<span style="float: left"> <strong>附件:</strong>
|
||||
</span><span style="float: left; width: 500px">
|
||||
<% @issue.attachments.each do |attach| %>
|
||||
<p><%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %></p>
|
||||
<% end %></span>
|
||||
<% end %>
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<label class="mail_reply"><%= link_to( "我要回复", issue_url, :class => "mail_reply") %></label>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!-- <li><%#=l(:field_author)%>: <%#=h issue.author %></li>
|
||||
|
||||
<%= textilizable(issue, :description, :only_path => false) %>
|
||||
<li><%#=l(:field_status)%>: <%#=h issue.status %></li>
|
||||
<li><%#=l(:field_priority)%>: <%#=h issue.priority %></li>
|
||||
<li><%#=l(:field_assigned_to)%>: <%#=h issue.assigned_to %></li>
|
||||
<li><%#=l(:field_category)%>: <%#=h issue.category %></li>
|
||||
<li><%#=l(:field_fixed_version)%>: <%#=h issue.fixed_version %></li>
|
||||
-->
|
||||
<%# issue.custom_field_values.each do |c| %>
|
||||
<!-- <li><%#=h c.custom_field.name %>: <%#=h show_value(c) %></li>
|
||||
<%#end %>
|
||||
-->
|
||||
|
@ -1,13 +1,19 @@
|
||||
<%= "#{issue.tracker.name} ##{issue.project_index}: #{issue.subject}" %>
|
||||
<%= issue_url %>
|
||||
|
||||
* <%=l(:field_author)%>: <%= issue.author %>
|
||||
* <%=l(:field_status)%>: <%= issue.status %>
|
||||
* <%=l(:field_priority)%>: <%= issue.priority %>
|
||||
* <%=l(:field_assigned_to)%>: <%= issue.assigned_to %>
|
||||
* <%=l(:field_category)%>: <%= issue.category %>
|
||||
* <%=l(:field_fixed_version)%>: <%= issue.fixed_version %>
|
||||
<% issue.custom_field_values.each do |c| %>* <%= c.custom_field.name %>: <%= show_value(c) %>
|
||||
<% end -%>
|
||||
----------------------------------------
|
||||
<%= issue.description %>
|
||||
|
||||
<%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %>
|
||||
在
|
||||
<%= link_to(h("#{@issue.project.name}"),@project_url) %>中有了一个与您相关的最新活动,请您关注!
|
||||
标题:<%= link_to(issue.subject, issue_url) %>
|
||||
来源:<%= issue.project.name %>| 项目缺陷<
|
||||
内容:
|
||||
<%= issue.description %>
|
||||
<% unless @issue.attachments.nil? %>
|
||||
附件:
|
||||
|
||||
|
||||
<% @issue.attachments.each do |attach| %>
|
||||
<%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %><%= l(:label_added) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<%= link_to( "我要回复", issue_url) %>
|
||||
|
@ -1,15 +1,8 @@
|
||||
<div class="mail_content">
|
||||
|
||||
|
||||
<%= l(:text_issue_added, :id => "##{@issue.project_index}", :author => h(@issue.author)) %>
|
||||
<ul>
|
||||
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
|
||||
|
||||
<% unless @issue.attachments.nil? %>
|
||||
<% @issue.attachments.each do |attach| %>
|
||||
<li> <%= l(:label_attachment) %><%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %><%= l(:label_added) %></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</ul>
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
|
@ -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, total_answer(poll_question.id)) %>%;" id="choice_percentage_<%= poll_answer.id %>"></span>
|
||||
</div>
|
||||
<%= statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)) %>%</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr class="table_bluebg">
|
||||
<td class="td327"><%= l(:label_poll_valid_commit) %> </td>
|
||||
<td class="td42"><%= total_answer(poll_question.id) %></td>
|
||||
<td class="td287"> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -0,0 +1,12 @@
|
||||
<div id="popbox" style="text-align: center;margin-top: 25px">
|
||||
<% if status == 0 %>
|
||||
<h3 style="font-weight: normal;color: green">提交成功!</h3>
|
||||
<%= link_to "确定", poll_index_path(:polls_group_id => @course.id,:polls_type => 'Course'),:class => 'commit'%>
|
||||
<% elsif status == 1 %>
|
||||
<h3 style="font-weight: normal;color: red">您还有尚未作答的必答题目请完成后再提交!</h3>
|
||||
<%= link_to "确定", "javascript:void(0)",:onclick => 'hidden_atert_form();',:class => 'commit'%>
|
||||
<% else %>
|
||||
<h3 style="font-weight: normal;color: red">发生未知错误,请检查您的网络。</h3>
|
||||
<%= link_to "确定", "javascript:void(0)",:onclick => 'hidden_atert_form();',:class => 'commit'%>
|
||||
<% end %>
|
||||
</div>
|
@ -0,0 +1,15 @@
|
||||
<%= form_for @poll,:remote => true do |f|%>
|
||||
<div class="ur_editor ur_title_editor"> <!--编辑头部start-->
|
||||
<div class="ur_title_editor_title">
|
||||
<input type="text" maxlength="100" name="polls_name" id="polls_title" value="<%= @poll.polls_name %>" class="input_title" placeholder="问卷标题"/>
|
||||
</div>
|
||||
<div class="ur_title_editor_prefix">
|
||||
<textarea name="polls_description" maxlength="300" id="polls_description" class="textarea_editor"><%= @poll.polls_description%></textarea>
|
||||
</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="pollsCancel();">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--编辑头部 end-->
|
||||
<% end%>
|
@ -0,0 +1,28 @@
|
||||
<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
|
||||
<script type="text/javascript">
|
||||
function resetQuestion<%=poll_question.id%>()
|
||||
{
|
||||
$("#poll_questions_title_<%=poll_question.id%>").val("<%= poll_question.question_title%>")
|
||||
$("#is_necessary_<%=poll_question.id%>").replaceWith("<input type='checkbox' name='is_necessary' id='is_necessary_<%=poll_question.id%>' value='true' <%= poll_question.is_necessary == 1 ? 'checked' : ''%>/>");
|
||||
}
|
||||
</script>
|
||||
<div class="ur_editor textarea"> <!--编辑多行文字start-->
|
||||
<div class="ur_editor_title">
|
||||
<label for="ur_question_title">问题: </label>
|
||||
<input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
|
||||
<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" id="is_necessary_<%=poll_question.id%>" 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>-->
|
||||
</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="resetQuestion<%=poll_question.id%>();pollQuestionCancel(<%= poll_question.id%>);">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--编辑多行文字end-->
|
||||
<% end%>
|
@ -0,0 +1,24 @@
|
||||
<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
|
||||
<script type="text/javascript">
|
||||
function resetQuestion<%=poll_question.id%>()
|
||||
{
|
||||
$("#poll_questions_title_<%=poll_question.id%>").val("<%= poll_question.question_title%>")
|
||||
$("#is_necessary_<%=poll_question.id%>").replaceWith("<input type='checkbox' name='is_necessary' id='is_necessary_<%=poll_question.id%>' value='true' <%= poll_question.is_necessary == 1 ? 'checked' : ''%>/>");
|
||||
}
|
||||
</script>
|
||||
<div class="ur_editor text "> <!--编辑单行文字start-->
|
||||
<div class="ur_editor_title">
|
||||
<label for="ur_question_title">问题: </label>
|
||||
<input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
|
||||
<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%>"/>
|
||||
<input type="checkbox" id="is_necessary_<%=poll_question.id%>" 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" onclick="$(this).parent().parent().parent().submit();">确定</a>
|
||||
<a class="btn_cancel" data-button="cancel" onclick="resetQuestion<%=poll_question.id%>();pollQuestionCancel(<%= poll_question.id%>);">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--编辑单行文字end-->
|
||||
<% end%>
|
@ -0,0 +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 type="hidden" name="question_type" value="4"/>
|
||||
<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/>
|
||||
<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>-->
|
||||
</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%>
|
@ -0,0 +1,16 @@
|
||||
<%= 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 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/>
|
||||
<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%>
|
@ -0,0 +1,26 @@
|
||||
<% poll.poll_questions.each do |poll_question|%>
|
||||
<div id="poll_questions_<%= poll_question.id%>">
|
||||
<div id="show_poll_questions_<%= poll_question.id %>">
|
||||
<% 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;">
|
||||
<% 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 %>
|
@ -0,0 +1,12 @@
|
||||
<tbody>
|
||||
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input class="ur_radio" type="radio" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
|
||||
<%= poll_answer.answer_text%>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
@ -0,0 +1,43 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<script type="text/javascript">
|
||||
function clickPublishPoll()
|
||||
{
|
||||
hideModal("#popbox02");
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "<%= publish_poll_poll_path(poll.id)%>",
|
||||
data: 'text',
|
||||
success: function (data) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
function clickCanel(){hideModal("#popbox02");}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="popbox02">
|
||||
<div class="upload_con">
|
||||
<div class="upload_box">
|
||||
<p class="polls_box_p">问卷发布后将不能对问卷进行修改,
|
||||
<br />
|
||||
是否确定发布该问卷?
|
||||
</p>
|
||||
<div class="polls_btn_box">
|
||||
<%= link_to "确 定",publish_poll_poll_path(poll.id), :class => "upload_btn", :onclick => "clickCanel();" %>
|
||||
<a class="upload_btn upload_btn_grey" onclick="clickCanel();">
|
||||
取 消
|
||||
</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,18 @@
|
||||
<div class="ur_table_result">
|
||||
<table border="0" cellspacing="0" cellpadding="0" >
|
||||
<tbody>
|
||||
<tr class="table_bluebg">
|
||||
<td class="td327" ><%= l(:label_answer) %> </td>
|
||||
</tr>
|
||||
<% poll_question.poll_votes.each do |poll_vote| %>
|
||||
<tr>
|
||||
<td class="td111"><%= poll_vote.vote_text.html_safe %> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr class="table_bluebg">
|
||||
<td class="td327"><%= l(:label_poll_answer_valid_result) %> <%= l(:label_answer_total) %><%= poll_question.poll_votes.count %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -0,0 +1,32 @@
|
||||
<div class="ur_question_item radio ur_editor02">
|
||||
<div class="ur_title">
|
||||
<span class="title_index">
|
||||
第<%= poll_question.question_number%>题:
|
||||
</span>
|
||||
<%= poll_question.question_title %>
|
||||
<span class="title_index">[单选题]</span>
|
||||
<%if poll_question.is_necessary == 1%>
|
||||
<span class="ur_required" title="必答">*</span>
|
||||
<%end%>
|
||||
</div>
|
||||
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
|
||||
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="ur_inputs">
|
||||
<table class="ur_table" >
|
||||
<tbody>
|
||||
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input class="ur_radio" type="radio" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
|
||||
<%= poll_answer.answer_text%>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div><!--单选题显示 end-->
|
@ -0,0 +1,32 @@
|
||||
<div class="ur_question_item checkbox ur_editor02">
|
||||
<div class="ur_title">
|
||||
<span class="title_index">
|
||||
第<%= poll_question.question_number%>题:
|
||||
</span>
|
||||
<%= poll_question.question_title %>
|
||||
<span class="title_index">[多选题]</span>
|
||||
<%if poll_question.is_necessary == 1%>
|
||||
<span class="ur_required" title="必答">*</span>
|
||||
<%end%>
|
||||
</div>
|
||||
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
|
||||
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="ur_inputs">
|
||||
<table class="ur_table">
|
||||
<tbody>
|
||||
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input class="ur_radio" type="checkbox" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
|
||||
<%= poll_answer.answer_text%>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div><!--多选题显示 end-->
|
@ -0,0 +1,10 @@
|
||||
<div class="ur_page_head ur_editor02"><!--头部显示 start-->
|
||||
<a href="#" class="ur_icon_edit" title="编辑" onclick="pollsEdit();"></a>
|
||||
<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>
|
||||
<div class="cl"></div>
|
||||
</div><!--头部显示 end-->
|
@ -0,0 +1,21 @@
|
||||
<div class="ur_question_item textarea ur_editor02">
|
||||
<div class="ur_preview">
|
||||
<div class="ur_title">
|
||||
<span class="title_index">
|
||||
第<%= poll_question.question_number%>题:
|
||||
</span>
|
||||
<%= poll_question.question_title %>
|
||||
<span class="title_index">[多行主观]</span>
|
||||
<%if poll_question.is_necessary == 1%>
|
||||
<span class="ur_required" title="必答">*</span>
|
||||
<%end%>
|
||||
</div>
|
||||
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
|
||||
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="ur_inputs">
|
||||
<textarea class="ur_textbox" rows="5" cols="60"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--多行展示 end-->
|
@ -0,0 +1,19 @@
|
||||
<div class="ur_question_item text ur_editor02 ">
|
||||
<div class="ur_title">
|
||||
<span class="title_index">
|
||||
第<%= poll_question.question_number%>题:
|
||||
</span>
|
||||
<%= poll_question.question_title %>
|
||||
<span class="title_index">[单行主观]</span>
|
||||
<%if poll_question.is_necessary == 1%>
|
||||
<span class="ur_required" title="必答">*</span>
|
||||
<%end%>
|
||||
</div>
|
||||
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
|
||||
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="ur_inputs">
|
||||
<input class="ur_text ur_textbox" type="text" size="" maxlength=""value="">
|
||||
</div>
|
||||
</div><!--单行文字展示 end-->
|
@ -0,0 +1,3 @@
|
||||
<% if @pv_saved %>
|
||||
$('#poll_vote_poll_answer_id_<%= @pv.poll_answer_id %>').checked = true;
|
||||
<% end %>
|
@ -0,0 +1,9 @@
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status}) %>');
|
||||
showModal('ajax-modal', '400px');
|
||||
$('#ajax-modal').css('height','100px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='#' onclick='hidden_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
@ -0,0 +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>");
|
||||
|
@ -0,0 +1 @@
|
||||
$("#poll_content").html("<%= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll}) %>");
|
@ -0,0 +1,4 @@
|
||||
<% if @poll%>
|
||||
$("#polls_<%= @poll.id%>").remove();
|
||||
<%else%>
|
||||
<% end %>
|
@ -0,0 +1,2 @@
|
||||
<%= render :partial => 'poll_form'%>
|
||||
|
@ -0,0 +1 @@
|
||||
<%= render :partial => 'poll_form'%>
|
@ -0,0 +1,256 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title><%= l(:label_poll_title) %></title>
|
||||
<%= stylesheet_link_tag 'polls', :media => 'all' %>
|
||||
<style type="text/css">
|
||||
.alert_box{width:480px;height:180px;position:fixed;z-index:100;left:55%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
|
||||
.commit{
|
||||
height: 28px;
|
||||
display: block;
|
||||
width: 80px;
|
||||
color: #fff !important;
|
||||
background: #15bccf;
|
||||
text-align: center;
|
||||
padding-top: 4px;
|
||||
margin-left: 130px;
|
||||
margin-top: 4px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function hidden_atert_form(cur_page,cur_type)
|
||||
{
|
||||
hideModal($("#popbox"));
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="polls_content polls_box" id="polls">
|
||||
<div class="ur_page_head" >
|
||||
<h1 class="ur_page_title">
|
||||
<%= @poll.polls_name%>
|
||||
</h1>
|
||||
<p class="ur_prefix_content">
|
||||
<%= @poll.polls_description %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ur_card">
|
||||
<ol class="ur_questions">
|
||||
<% @poll_questions.each do |pq| %>
|
||||
<% if pq.question_type == 1 %>
|
||||
<!-- 单选题 -->
|
||||
<li class="ur_question_item radio">
|
||||
<div class="ur_title">
|
||||
<span class="title_index"><%= l(:label_question_number,:question_number => pq.question_number) %></span>
|
||||
<%= pq.question_title %>
|
||||
<span class="title_index">[单选题]</span>
|
||||
<% if pq.is_necessary == 1 %>
|
||||
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="ur_inputs">
|
||||
<form>
|
||||
<table class="ur_table" >
|
||||
<tbody>
|
||||
<% pq.poll_answers.each do |pa| %>
|
||||
<tr>
|
||||
<td>
|
||||
<label >
|
||||
<script>
|
||||
function click_<%= pa.id %>(obj)
|
||||
{
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<%= commit_answer_poll_path(@poll) %>",
|
||||
data: {
|
||||
poll_answer_id: <%= pa.id %>,
|
||||
poll_question_id: <%= pq.id %>
|
||||
},
|
||||
success: function (data) {
|
||||
var dataObj = eval(data);
|
||||
obj.checked = true;
|
||||
var span = $('#percent');
|
||||
span.html(dataObj.percent);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<%= radio_button "poll_vote","poll_answer_id",pa.id,:class=>"ur_radio",:onclick =>"click_#{pa.id}(this);return false;",:checked => answer_be_selected?(pa,User.current),:disabled => !@can_edit_poll %>
|
||||
<%= pa.answer_text %>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
<% elsif pq.question_type == 2 %>
|
||||
<!-- 多选题 -->
|
||||
<li class="ur_question_item checkbox">
|
||||
<div class="ur_title">
|
||||
<span class="title_index"><%= l(:label_question_number,:question_number => pq.question_number) %></span>
|
||||
<%= pq.question_title %>
|
||||
<span class="title_index">[多选题]</span>
|
||||
<% if pq.is_necessary == 1 %>
|
||||
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="ur_inputs">
|
||||
<form>
|
||||
<table class="ur_table" >
|
||||
<tbody>
|
||||
<% pq.poll_answers.each do |pa| %>
|
||||
<tr>
|
||||
<td>
|
||||
<label >
|
||||
<script>
|
||||
function click_<%= pa.id %>(obj)
|
||||
{
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<%= commit_answer_poll_path(@poll) %>",
|
||||
data: {
|
||||
poll_answer_id: <%= pa.id %>,
|
||||
poll_question_id: <%= pq.id %>
|
||||
},
|
||||
success: function (data) {
|
||||
var dataObj = eval(data);
|
||||
if(dataObj.text == "true")
|
||||
{
|
||||
obj.checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.checked = false;
|
||||
}
|
||||
var span = $('#percent');
|
||||
span.html(dataObj.percent);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<input class="ur_checkbox" type="checkbox" onclick="click_<%= pa.id %>(this);return false;" <%= answer_be_selected?(pa,User.current) ? "checked":"" %> <%= @can_edit_poll?"":"disabled=disabled" %> >
|
||||
<%= pa.answer_text %>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
<% elsif pq.question_type == 3 %>
|
||||
<!-- 单行文字-->
|
||||
<li class="ur_question_item text">
|
||||
<div class="ur_title">
|
||||
<span class="title_index"><%= l(:label_question_number,:question_number => pq.question_number) %></span>
|
||||
<%= pq.question_title %>
|
||||
<span class="title_index">[单行主观]</span>
|
||||
<% if pq.is_necessary == 1 %>
|
||||
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="ur_inputs">
|
||||
<script>
|
||||
function onblur_<%= pq.id %>(obj)
|
||||
{
|
||||
$(window).unbind('beforeunload');
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<%= commit_answer_poll_path(@poll) %>",
|
||||
data: {
|
||||
poll_question_id: <%= pq.id %> ,
|
||||
vote_text: obj.value
|
||||
},
|
||||
success: function (data) {
|
||||
var dataObj = eval(data);
|
||||
var span = $('#percent');
|
||||
span.html(dataObj.percent);
|
||||
// obj.value = data;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
<input class="ur_text ur_textbox" type="text" size="" maxlength="" style="width: 100%" value="<%= get_anwser_vote_text(pq.id,User.current.id).html_safe %>" onblur="onblur_<%= pq.id %>(this);" <%= @can_edit_poll?"":"disabled=disabled" %>>
|
||||
</div>
|
||||
</li><!--单行输入 end-->
|
||||
<% elsif pq.question_type == 4 %>
|
||||
<!-- 多行文字-->
|
||||
<li class="ur_question_item textarea">
|
||||
<div class="ur_preview">
|
||||
<div class="ur_title">
|
||||
<span class="title_index"><%= l(:label_question_number,:question_number => pq.question_number) %></span>
|
||||
<%= pq.question_title %>
|
||||
<span class="title_index">[多行主观]</span>
|
||||
<% if pq.is_necessary == 1 %>
|
||||
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="ur_inputs">
|
||||
<script>
|
||||
function onblur_<%= pq.id %>(obj)
|
||||
{
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<%= commit_answer_poll_path(@poll) %>",
|
||||
data: {
|
||||
poll_question_id: <%= pq.id %> ,
|
||||
vote_text: obj.innerHTML
|
||||
},
|
||||
success: function (data) {
|
||||
var dataObj = eval(data);
|
||||
if(dataObj.text != 'failure')
|
||||
{
|
||||
var span = $('#percent');
|
||||
span.html(dataObj.percent);
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("error");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
</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).html_safe %></div>
|
||||
</div>
|
||||
</div>
|
||||
</li><!--多行输入 end-->
|
||||
<% else %>
|
||||
<!-- 未知题型 -->
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ol>
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<div class="ur_buttons" style="width: 100px;">
|
||||
<% if @poll.polls_status == 2 %>
|
||||
<%= link_to l(:button_submit),commit_poll_poll_path(@poll), :method => :post,:class => "ur_button",:format => 'js',:remote=>true %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="ur_progress_text"><%= l(:label_complete_question) %> <strong class="ur_progress_number"><span id="percent"><%= format "%.2f" ,@percent %></span>%</strong> </div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div><!--问卷内容end-->
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title><%= l(:label_poll_result) %></title>
|
||||
<%= stylesheet_link_tag 'polls', :media => 'all' %>
|
||||
</head>
|
||||
<body>
|
||||
<div class="polls_content polls_box" id="polls">
|
||||
<div class="ur_page_head" >
|
||||
<h1 class="ur_page_title"><%= @poll.polls_name %> <%= l(:label_poll) %></h1>
|
||||
</div>
|
||||
<div class="">
|
||||
<% @poll_questions.each do |poll_question| %>
|
||||
<ol>
|
||||
<li class="ur_question_item">
|
||||
<div class="ur_title_result">
|
||||
<span class="title_index">第<%= poll_question.question_number %>题:</span><%= poll_question.question_title %> <span class="title_index">[<%= options_show(poll_question.question_type) %>]</span>
|
||||
</div>
|
||||
<% if poll_question.question_type == 1 || poll_question.question_type == 2 %>
|
||||
<%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %>
|
||||
<% else %>
|
||||
<%= render :partial =>'quiz_answers', :locals =>{ :poll_question => poll_question } %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ol>
|
||||
<% end %>
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<div class="ur_buttons"></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -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();
|
@ -0,0 +1,22 @@
|
||||
$("#poll_questions_<%= @poll_question.id%>").html("<div id='show_poll_questions_<%= @poll_question.id %>'>" +
|
||||
"<% 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;'>" +
|
||||
"<% 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>");
|
@ -0,0 +1,9 @@
|
||||
class AddDescriptionToPolls < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :polls, :polls_description, :text
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :polls,:polls_description
|
||||
end
|
||||
end
|
@ -0,0 +1,9 @@
|
||||
class AddQuestionNumberToPollQuestions < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :poll_questions, :question_number, :integer
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :poll_questions, :question_number
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,136 @@
|
||||
/* CSS Document */
|
||||
#polls{ font-size:12px; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;}
|
||||
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
|
||||
#polls div,img,tr,td{ border:0;}
|
||||
#polls table,tr,td{border:0; cellspacing:0; cellpadding:0;}
|
||||
#polls ul,li{ list-style-type:none}
|
||||
#polls .cl{ clear:both; overflow:hidden; }
|
||||
#polls a{ text-decoration:none; }
|
||||
#polls a:hover{ text-decoration:underline; }
|
||||
#polls .ml10{ margin-left:10px;}
|
||||
#polls .ml20{ margin-left:20px;}
|
||||
#polls .mr10{ margin-right:10px;}
|
||||
#polls .fl{ float: left;}
|
||||
#polls .fr{ float:right;}
|
||||
|
||||
/*问卷按钮*/
|
||||
.polls_btn{ height:33px;border-top:1px solid #15bed1; border-bottom:1px solid #15bed1;border-right:1px solid #cee6e6; width:225px; padding:7px 0 0 15px; }
|
||||
.polls_btn a{font-size:14px; color:#444444;font-weight:bold;}
|
||||
.polls_btn span{ color:#15bed1; font-size:12px; font-weight:normal;}
|
||||
|
||||
/*问卷列表*/
|
||||
.polls_content{ width:615px;}
|
||||
.polls_head{ width:677px; height:48px; background:#eaeaea;}
|
||||
.polls_head h2{ float:left; font-size:14px; color:#585858; margin:11px 0 0 10px;}
|
||||
.polls_head span{ font-weight:normal; color:#15bccf;}
|
||||
a.newbtn{ float:right; display:block; width:80px; height:30px; background:#64bdd9; color:#fff; font-size:14px; margin:10px; text-align:center;}
|
||||
a:hover.newbtn{ background:#55a1b9; text-decoration:none;}
|
||||
.polls_list ul{ padding-left:10px; border-bottom:1px dashed #c9c9c9; height:32px; padding-top:8px;}
|
||||
a.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 350px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
|
||||
.polls_title{ font-weight:bold; color:#3e6d8e;}
|
||||
a.pollsbtn{ display:block; width:66px; height:22px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;}
|
||||
a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;}
|
||||
.polls_date{ color:#666666;}
|
||||
.polls_de{ color:#6883b6;}
|
||||
/****翻页***/
|
||||
ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
|
||||
ul.wlist li{float: left;}
|
||||
ul.wlist li a{ border:1px solid #15bccf; padding:4px; margin-left:3px;}
|
||||
ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
|
||||
.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}
|
||||
|
||||
|
||||
/*问卷页面*/
|
||||
.polls_box{ border:1px solid #dcdcdc; padding:15px 30px;}
|
||||
.ur_page_title{ font-size:16px; text-align:center; color:#353535; word-break:break-all; word-wrap:break-word;}
|
||||
.ur_prefix_content{ color:#656565; text-indent:30px; margin-top:10px; }
|
||||
.ur_card{border-top:1px solid #dcdcdc;margin-top:20px; color:#3a3a3a;}
|
||||
.ur_title{ padding:20px 0px ; float:left; width:604px; word-break: break-all; word-wrap: break-word;}
|
||||
.ur_required{ font-weight: bold; color:red;}
|
||||
.ur_inputs{ color:#666;}
|
||||
.ur_table{border-top:1px solid #dcdcdc;}
|
||||
.ur_inputs tr td{ height:40px;border-bottom:1px solid #dcdcdc; width:617px;word-break: break-all; word-wrap: break-word;}
|
||||
.ur_inputs label{ padding-left:10px;word-break: break-all; word-wrap: break-word;}
|
||||
.ur_inputs input{ margin-right:5px;}
|
||||
.ur_text{ height:30px;}
|
||||
.ur_textbox{ border:1px solid #dcdcdc !important; color:#676765;}
|
||||
.ur_buttons{ width:250px; margin:20px auto 10px;}
|
||||
a.ur_button{ display:block; width:106px; height:37px; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:3px; float:left; margin-right:15px;}
|
||||
a:hover.ur_button{ background:#0fa9bb; text-decoration:none;}
|
||||
.ur_progress_text{ text-align:center; font-size:14px;}
|
||||
|
||||
/*问卷结果*/
|
||||
.title_index{ color:#62bcd7; }
|
||||
.ur_title_result{ padding-top:20px; word-break:break-all; word-wrap:break-word;}
|
||||
.ur_table_result{ color:#5d5d5d;border-right:1px solid #cbcbcb;border-bottom:1px solid #cbcbcb;}
|
||||
.ur_table_result tr td{ border-left:1px solid #cbcbcb;border-top:1px solid #cbcbcb; height:20px;}
|
||||
.table_bluebg{ background:#d7e5ee; color:#2f3a40; height:24px;}
|
||||
.td327{ width:601px; padding-left:5px; word-break:break-all; word-wrap:break-word; }
|
||||
.td42{ width:42px; text-align:center;}
|
||||
.td287{ width:259px;padding-left:5px; text-align:center; }
|
||||
.td111{ width:601px;padding-left:5px; word-break:break-all; word-wrap:break-word; }
|
||||
.Bar{ position: relative; width: 120px; border: 1px solid #cbcbcb; float:left; height:10px; margin-top:5px; margin-right:3px; }
|
||||
.Bar span{ display: block; position: relative;background:#64badb;/* 进度条背景颜色 */ color: #333333;height: 10px; /* 高度 */ line-height: 20px; }
|
||||
.ur_progress_text{ color:#3a3a3a;}
|
||||
|
||||
/*问卷编辑*/
|
||||
.polls_edit{ color:#767676;}
|
||||
a:hover{ text-decoration:none; cursor:pointer;}
|
||||
.tabs_1{ width:665px; height: auto; border:1px solid #cbcbcb; padding:10px 0 0 10px; margin-bottom:10px;}
|
||||
.tab_item { float:left; height:30px; background:#eeeeee; margin-right:4px; padding:0 8px; margin-bottom:10px;}
|
||||
.icon_delete{ font-size:16px;}
|
||||
a:hover.icon_delete{ font-weight: bold;}
|
||||
.current{ color:#4f4f4d; background:#c4c4c4;}
|
||||
.tab_add{float:left; width:22px; height:22px; border:1px solid #cbcbcb; margin-top:6px; }
|
||||
.icon_page_add{ background:url(images/icons.png) 4px -314px no-repeat; width:22px; height:27px; display:block;}
|
||||
a:hover.icon_page_add{ background:url(images/icons.png) -16px -314px no-repeat;}
|
||||
.tab_item02{ float:left; width:141px; height:30px;background:#eeeeee; margin-right:10px; padding:0 10px; margin-bottom:10px; padding:10px 0 0 15px;}
|
||||
.tab_item02:hover{ background:#c9c9c9;}
|
||||
.tab_icon{padding-left:25px;}
|
||||
a:hover.tab_item02{ background:#fff;}
|
||||
.icon_radio{background:url(images/icons.png) 0px 0px no-repeat;color: gray; padding-bottom: 5px;}
|
||||
.icon_checkbox{background:url(images/icons.png) 0px -40px no-repeat;color: gray; padding-bottom: 5px;}
|
||||
.icon_text{background:url(images/icons.png) 0px -80px no-repeat;color: gray; padding-bottom: 5px;}
|
||||
.icon_textarea{background:url(images/icons.png) 0px -120px no-repeat; color: gray;padding-bottom: 5px;}
|
||||
|
||||
.ur_editor {width:655px; border:1px solid #cbcbcb;background:#eeeeee; padding:10px; margin-bottom:10px;}
|
||||
.ur_title_editor_title{ margin-bottom:10px;}
|
||||
.input_title{ width:630px; height:40px; padding:0 10px; text-align:center; font-size:16px; font-weight:bold;border: 1px solid #DCDCDC !important;}
|
||||
.textarea_editor{ width:632px; height:120px; padding:10px; margin-bottom:10px;border: 1px solid #DCDCDC !important;}
|
||||
.btn_submit{ width:56px; height:24px; padding-top:4px;background:#15bccf; color:#fff; text-align:center; display:block; float:left; margin-right:10px;}
|
||||
a:hover.btn_submit{background:#0fa9bb;}
|
||||
.btn_cancel{width:54px; height:22px; padding-top:4px;background:#fff; color:#999; border:1px solid #999; text-align:center; display:block; float:left; }
|
||||
a:hover.btn_cancel{ color:#666;}
|
||||
.ur_question_title{ width:534px; height:30px; border:1px solid #cbcbcb; padding:0 5px !important; margin-right:10px;border: 1px solid #DCDCDC !important;}
|
||||
.ur_editor_title{ margin-bottom:10px;}
|
||||
.ur_editor_content{ }
|
||||
.ur_item{ margin-bottom:5px; height:32px; }
|
||||
.ur_item input{ width:324px; height:30px;border:1px solid #cbcbcb; padding:0 5px; float:left; margin-right:10px; }
|
||||
.ur_item label{ float:left;}
|
||||
.icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;}
|
||||
a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;}
|
||||
.icon_remove{background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:left;}
|
||||
a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;}
|
||||
.ur_editor_toolbar{ margin-bottom:10px;}
|
||||
.ur_editor_toolbar input{ width:40px; height:20px;}
|
||||
.ur_editor02{width:655px; border:1px solid #cbcbcb; padding:10px; margin-bottom:10px;}
|
||||
a.ur_button_submit{ display:block; width:106px; height:37px; margin:0 auto; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:3px; margin-bottom:10px; }
|
||||
a:hover.ur_button_submit{ background:#0fa9bb; text-decoration:none;}
|
||||
a.ur_icon_de{ background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px;}
|
||||
a:hover.ur_icon_de{ background:url(images/icons.png) -20px -338px no-repeat;}
|
||||
.ur_icon_edit{ background:url(images/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px; margin-right:10px;}
|
||||
a:hover.ur_icon_edit{ background:url(images/icons.png) -21px -272px no-repeat;}
|
||||
|
||||
/***弹框***/
|
||||
.popbox_polls{width:300px;height:100px;position:fixed;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
|
||||
.alert .close02{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-310px;background:url(/images/bid/close.png) no-repeat;cursor:pointer;}
|
||||
.upload_box{ width:270px; margin:15px auto;}
|
||||
.polls_box_p{ font-size:14px; text-align:center;}
|
||||
a.upload_btn{ display:block; float:left; margin:15px 0 5px; width:60px; padding: 7px 0; text-align: center; color:#fff; font-size:14px; background:#15bccf; margin-right:10px;}
|
||||
a:hover.upload_btn{ background:#06a9bc;}
|
||||
a.upload_btn_grey{background:#a3a3a3;}
|
||||
a:hover.upload_btn_grey{background:#8a8a8a;}
|
||||
.upload_con p{ color:#808181;}
|
||||
.upload_con a:hover{ text-decoration:none;}
|
||||
.polls_btn_box{ width:145px; margin:0 auto; padding-left:10px;}
|
||||
.polls_btn_box02{ width:80px; margin:0 auto; padding-left:10px;}
|
Loading…
Reference in new issue