openaustralia/publicwhip

View on GitHub
app/views/people_distances/_summary_vote_numbers.html.haml

Summary

Maintainability
Test Coverage
%p
  - if person_distance.nvotesdiffer > person_distance.nvotessame
    = succeed "." do
      In divisions they have voted differently
      = number_of_times(person_distance.nvotesdiffer)
    = succeed "." do
      - if person_distance.nvotessame.zero?
        They have
        %strong never voted the same
      - else
        They have only voted
        %strong= "the same #{number_of_times(person_distance.nvotessame)}"
  - else
    = succeed "." do
      In divisions they have voted the same
      = number_of_times(person_distance.nvotessame)
    = succeed "." do
      - if person_distance.nvotesdiffer.zero?
        They have
        %strong never voted differently
      - else
        They have only voted
        %strong= "differently #{number_of_times(person_distance.nvotesdiffer)}"