voting visual changes

This commit is contained in:
Stella 2014-02-23 14:56:09 +02:00
parent 4356616566
commit 52543589e4
7 changed files with 44 additions and 21 deletions

View file

@ -1,7 +1,29 @@
%table#myeventratings{:style=>"width: 20%"}
%table.table#myrating
%tr
%td{:style => "width:20%"}
%b Rating
%td
%b Your vote:
- if @event.average_rating.to_f > 0
#{@event.average_rating}/#{@conference.call_for_papers.rating}
- else
Rating: (0/#{@conference.call_for_papers.rating})
- @conference.call_for_papers.rating.times do |counter|
- if @event.average_rating.to_f.round == counter+1
= label_tag "label_rating", "", :class => "avgrating", :avgrate => true
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"
- else
= label_tag "label_rating", "", :class => "avgrating"
%tr
%td
%b Voters
%td
= @event.voters.length
(
= @ratings.map {|x| "#{x.first_name} #{x.last_name}"}.join ', '
)
%tr
%td Your vote
%td
- @conference.call_for_papers.rating.times do |counter|
- voted = @event.voted?(@event, current_user.person)