_result.rhtml 1.93 KB
<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>