_result.rhtml
1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<div id="pairwise_<%= pairwise_content.id %>">
<div id="pairwise_main" class="pairwise_main">
<%
@question = @page.question
%>
<% extend PairwisePlugin::Helpers::ViewerHelper %>
<% unless @page.errors[:base].nil? %>
<h3><%= _('Pairwise Integration Error') %></h3>
<p> <%= _('Please contact the administrator') %></p>
<pre>
<%= @page.errors[:base] %>
</pre>
<% else %>
<%= render :partial => 'content_viewer/menu', :locals => {:embeded => embeded, :pairwise_content => pairwise_content, :active_tab => :results} %>
<% cache_timeout("pairwise-result-#{pairwise_content.id}", 1.hours) do %>
<div class="pairwise_content">
<%= pairwise_spinner(pairwise_content) %>
<div class="total_votes">
<span class="label"><%= _('Total votes:') %></span>
<span class="value"><%= @page.question.votes_count %></span>
</div>
<table>
<thead>
<tr>
<th><%= _('Choice Text') %></th>
<th title="<%= _('The ideia is better than the other ideas') %>" ><%= _('Choice Wins') %></th>
<th title="<%= _('The other ideas were chosen') %>" ><%= _('Choice Losses') %></th>
<th title="<%= _('Rank of the ideias') %>" ><%= _('Choice Score') %></th>
</tr>
</thead>
<tbody>
<% @page.question.get_choices.each do |choice| %>
<tr>
<td><%= choice.data %></td>
<td><%= choice.wins %></td>
<td><%= choice.losses %></td>
<td><%= choice.score.round.to_s %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% if @page.allow_edit?(user) %>
<div class="embeded_code">
<span class="embeded_code_link"><a href="javascript:;"><%= _("Show/Hide Embeded Code") %></a></span>
<div id="pairwise_embeded_box" style="display:none">
<%= pairwise_embeded_code(@page) %>
</div>
</div>
<% end %>
<%#= link_to _('Vote'), @page.url, :class=>"button with-text icon-edit" %>
<% end %>
<% end %>
</div>
</div>