commit
c9c9f578b9
@ -1,2 +0,0 @@
|
||||
class PollAnswerController < ApplicationController
|
||||
end
|
File diff suppressed because it is too large
Load Diff
@ -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 } %>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue