Fix ordering for event.average_voting in events#index
This commit is contained in:
parent
a73ca335a9
commit
2a6ca7b0ff
2 changed files with 2 additions and 2 deletions
|
|
@ -77,7 +77,7 @@ class Event < ActiveRecord::Base
|
||||||
@total_rating = @total_rating + vote.rating
|
@total_rating = @total_rating + vote.rating
|
||||||
end
|
end
|
||||||
@total = votes.size
|
@total = votes.size
|
||||||
number_with_precision(@total_rating / @total.to_f, precision: 2, strip_insignificant_zeros: true)
|
@total_rating > 0 ? number_with_precision(@total_rating / @total.to_f, precision: 2, strip_insignificant_zeros: true) : 0
|
||||||
end
|
end
|
||||||
|
|
||||||
def submitter
|
def submitter
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
=link_to event.title, admin_conference_event_path(@conference.short_title, event)
|
=link_to event.title, admin_conference_event_path(@conference.short_title, event)
|
||||||
|
|
||||||
- if @conference.call_for_paper && @conference.call_for_paper.rating && @conference.call_for_paper.rating > 0
|
- if @conference.call_for_paper && @conference.call_for_paper.rating && @conference.call_for_paper.rating > 0
|
||||||
%td.col-md-1
|
%td.col-md-1{'data-order' => "#{event.average_rating}"}
|
||||||
- if event.average_rating.to_f > 0
|
- if event.average_rating.to_f > 0
|
||||||
#{event.average_rating}/#{@conference.call_for_paper.rating}
|
#{event.average_rating}/#{@conference.call_for_paper.rating}
|
||||||
%br
|
%br
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue