Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: aec9623424
Fetching contributors…

Cannot retrieve contributors at this time

72 lines (62 sloc) 2.405 kB
<!-- Copyright 2011/2012 Dextra Sistemas
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. -->
<div id="rmipoll">
<%= error_messages_for @bet %>
<ul>
<li class="worktime">
<%= toggle_link t(:label_issue_votes), 'poll-members' %>
<span><%= @issue.bet_votes %></span>
<p>
<%= t(:label_issue_votes) %>
</p>
</li>
<li class="usertime">
<a href="#" title="<%= t(:label_user_votes) %>"><%= t(:label_user_votes) %></a><span><%= User.current.polls_votes_project(@project.id) || 0 %></span>
<p>
<%= t(:label_user_votes) %>
</p>
</li>
<li class="sharetime">
<% if User.current.can_bet?(@issue.project_id, 1) and @issue.can_receive_bet? %>
<% remote_form_for(
:bet, @bet,
:url => {:controller => 'polls', :action => 'bet', :issue_id => @issue.id, :project_id => @issue.project_id},
:method => :post,
:complete => "Form.Element.focus('relation_issue_to_id');",
:html => {:id => 'issues-polls-form'}) do |f| %>
<%= f.select :votes, 1..User.current.polls_votes_project(@project.id), {} %>
<%= submit_tag l(:button_bet) %>
<% end %>
<% end %>
<p>
<%= t(:label_bet_votes) %>
</p>
</li>
</ul>
<table class="list" id="poll-members" style="display: none">
<tbody>
<tr>
<th> <%= t(:label_user_name) %> </th>
<th> <%= t(:label_votes_bet) %> </th>
<th align="right"><%= link_to_function "x", "Element.toggle('poll-members');return false;"%></th>
</tr>
<% @issue.valid_bets.each do |bet| %>
<tr>
<td> <%= bet.author.name(:firstname_lastname) %> </td>
<td> <%= bet.sum_votes %> </td>
<td> <% if bet.user_id == User.current.id and @issue.can_receive_bet? %>
<%= link_to_remote t(:link_cancel_bet), :url => {:controller => 'polls', :action => 'cancel_bet', :issue_id => @issue.id, :project_id => @issue.project_id}, :confirm => t(:confirm_cancel_bet) %>
<% end %> </td>
</tr>
<% end %>
</tbody>
</table>
</div>
Jump to Line
Something went wrong with that request. Please try again.