Add more info to ranking

This commit is contained in:
Petko Bordjukov 2016-10-15 20:28:09 +03:00
parent a9a538d08c
commit 06b9122499
2 changed files with 18 additions and 8 deletions

View File

@ -104,8 +104,8 @@
thead thead
tr tr
th.text-right = t('.rank') th.text-right = t('.rank')
th.text-right = t('.percent')
th = Event.model_name.human.mb_chars.capitalize th = Event.model_name.human.mb_chars.capitalize
th = Event.human_attribute_name :status
th th
tbody tbody
- if @conference.has_vote_results? - if @conference.has_vote_results?
@ -114,10 +114,9 @@
tr tr
- if index == 0 - if index == 0
- if event.ranked? - if event.ranked?
td.text-right rowspan="#{events.count}" td.text-center rowspan="#{events.count}"
.large .large
span.label.label-info = event.rank span.label.label-info = event.rank
td.text-right rowspan="#{events.count}"
span title="#{t('.vote_ratio', votes: event.number_of_votes, total_votes: @conference.number_of_ballots_cast)}" span title="#{t('.vote_ratio', votes: event.number_of_votes, total_votes: @conference.number_of_ballots_cast)}"
= number_to_percentage(event.per_cent_of_votes, strip_insignificant_zeros: true, precision: 2) = number_to_percentage(event.per_cent_of_votes, strip_insignificant_zeros: true, precision: 2)
- else - else
@ -126,7 +125,13 @@
span.label.label-danger × span.label.label-danger ×
td.text-right rowspan="#{events.count}" td.text-right rowspan="#{events.count}"
= t('.unranked') = t('.unranked')
td = event.title td
h4 = event.title
h5 = event.subtitle
= links_to_event_participants_for(event)
td
span class="label label-lg label-#{proposition_status_class(event.status)}"
= icon(proposition_status_glyph(event.status), t("activerecord.attributes.proposition.statuses.#{event.status}"))
td.actions = action_buttons(@conference, event, [:show]) td.actions = action_buttons(@conference, event, [:show])
- else - else
tr tr

View File

@ -17,8 +17,8 @@
thead thead
tr tr
th.text-right = t('.rank') th.text-right = t('.rank')
th.text-right = t('.percent')
th = Event.model_name.human.mb_chars.capitalize th = Event.model_name.human.mb_chars.capitalize
th = Event.human_attribute_name :status
th th
tbody tbody
- if @conference.has_vote_results? - if @conference.has_vote_results?
@ -27,10 +27,9 @@
tr tr
- if index == 0 - if index == 0
- if event.ranked? - if event.ranked?
td.text-right rowspan="#{events.count}" td.text-center rowspan="#{events.count}"
.large .large
span.label.label-info = event.rank span.label.label-info = event.rank
td.text-right rowspan="#{events.count}"
span title="#{t('.vote_ratio', votes: event.number_of_votes, total_votes: @conference.number_of_ballots_cast)}" span title="#{t('.vote_ratio', votes: event.number_of_votes, total_votes: @conference.number_of_ballots_cast)}"
= number_to_percentage(event.per_cent_of_votes, strip_insignificant_zeros: true, precision: 2) = number_to_percentage(event.per_cent_of_votes, strip_insignificant_zeros: true, precision: 2)
- else - else
@ -39,7 +38,13 @@
span.label.label-danger × span.label.label-danger ×
td.text-right rowspan="#{events.count}" td.text-right rowspan="#{events.count}"
= t('.unranked') = t('.unranked')
td = event.title td
h4 = event.title
h5 = event.subtitle
= links_to_event_participants_for(event)
td
span class="label label-lg label-#{proposition_status_class(event.status)}"
= icon(proposition_status_glyph(event.status), t("activerecord.attributes.proposition.statuses.#{event.status}"))
td.actions = action_buttons(@conference, event, [:show]) td.actions = action_buttons(@conference, event, [:show])
- else - else
tr tr