Fix indentation in events#show view that caused a condition to be skipped

This commit is contained in:
Petko Bordjukov 2019-06-17 14:23:56 +03:00
parent f724e58800
commit cbd69fab5a
1 changed files with 51 additions and 50 deletions

View File

@ -94,58 +94,59 @@
- if @conference.has_vote_results? or @conference.has_voting_endpoint? - if @conference.has_vote_results? or @conference.has_voting_endpoint?
.row .row
.col-xs-12 .col-xs-12
h2 h2
- if @conference.start_date.future? - if @conference.start_date.future?
= t '.conflicts' = t '.conflicts'
- else - else
= t '.top_conflicts' = t '.top_conflicts'
small< = t '.between_approved_events' small< = t '.between_approved_events'
.panel.panel-default .panel.panel-default
table.table.table-striped.table-hover.record-table table.table.table-striped.table-hover.record-table
- if @conference.has_vote_results? and @conference.approved_events.count > 2 - if @conference.has_vote_results? and @conference.approved_events.count > 2
thead thead
tr tr
th.text-right th.text-right
= t '.percent' = t '.percent'
th.main th.main
= Event.model_name.human.mb_chars.capitalize = Event.model_name.human.mb_chars.capitalize
th th
tbody tbody
- if @conference.has_vote_results? - if @conference.has_vote_results?
- if @conference.approved_events.count > 2 - if @conference.approved_events.count > 2
- if @conference.start_date.future? - if @conference.start_date.future?
- conflict_counts = @event.conflict_counts.where(right_id: @conference.approved_events.pluck(:id)).includes(:right) - conflict_counts = @event.conflict_counts.where(right_id: @conference.approved_events.pluck(:id)).includes(:right)
- else - else
- conflict_counts = @event.conflict_counts.where(right_id: @conference.approved_events.pluck(:id)).includes(:right).limit(5) - conflict_counts = @event.conflict_counts.where(right_id: @conference.approved_events.pluck(:id)).includes(:right).limit(5)
- conflict_counts.each do |conflict_count| - conflict_counts.each do |conflict_count|
- conflict_percent = Rational(conflict_count.number_of_conflicts, @conference.number_of_ballots_cast) - conflict_percent = Rational(conflict_count.number_of_conflicts, @conference.number_of_ballots_cast)
tr tr
td.text-right td.text-right
.large .large
span.label.label-success data-conflicts="#{conflict_count.number_of_conflicts}" data-most-conflicts="#{@conference.most_conflicts_between_approved_events}" data-least-conflicts="#{@conference.least_conflicts_between_approved_events}" span.label.label-success data-conflicts="#{conflict_count.number_of_conflicts}" data-most-conflicts="#{@conference.most_conflicts_between_approved_events}" data-least-conflicts="#{@conference.least_conflicts_between_approved_events}"
= number_to_percentage(conflict_percent * 100, strip_insignificant_zeros: true, precision: 2) = number_to_percentage(conflict_percent * 100, strip_insignificant_zeros: true, precision: 2)
td td
h4 = conflict_count.right.title h4 = conflict_count.right.title
h5 = conflict_count.right.subtitle h5 = conflict_count.right.subtitle
= links_to_event_participants_for(conflict_count.right) = links_to_event_participants_for(conflict_count.right)
td.actions td.actions
= action_buttons @conference, conflict_count.right, [:show] = action_buttons @conference, conflict_count.right, [:show]
- else
tr
td colspan="20"
= t '.no_approved_events'
- else - else
tr tr
td colspan="20" td colspan="20"
= t '.no_approved_events' = t 'management.conferences.vote_results.vote_data_never_updated'
- else = link_to update_vote_data_management_conference_path(@conference), method: :patch, class: ['btn', 'btn-primary'] do
tr = icon :refresh, t('management.conferences.vote_results.fetch_vote_results')
td colspan="20" - if @conference.has_vote_results?
= t 'management.conferences.vote_results.vote_data_never_updated' .panel-footer.text-right
.btn-group
= link_to conflicts_management_conference_event_path(@event, conference_id: @conference.id), class: ['btn', 'btn-info'] do
= icon :percent, t('.conflicts')
= link_to update_vote_data_management_conference_path(@conference), method: :patch, class: ['btn', 'btn-primary'] do
= icon :refresh, t('management.conferences.vote_results.fetch_vote_results') = icon :refresh, t('management.conferences.vote_results.fetch_vote_results')
- if @conference.has_vote_results?
.panel-footer.text-right
.btn-group
= link_to conflicts_management_conference_event_path(@event, conference_id: @conference.id), class: ['btn', 'btn-info'] do
= icon :percent, t('.conflicts')
= link_to update_vote_data_management_conference_path(@conference), method: :patch, class: ['btn', 'btn-primary'] do
= icon :refresh, t('management.conferences.vote_results.fetch_vote_results')