%h5 Legalities
%ul.legalities
  - legality = card.legality_information
  - if legality.legal_everywhere?
    %li
      #{card.name} is legal in every format.
  - elsif legality.legal_nowhere?
    %li
      #{card.name} is not legal in any format.
  - else
    - card.legality_information.to_h.sort.each do |format_name, status|
      %li
        - if status.start_with? "restricted-"
          - points = status.split("-")[1].to_i
          %i{class: "legality-restricted"}= "#{points} point#{points == 1 ? "" : "s"}"
        - elsif status.start_with? "banned-"
          - votes = status.split("-")[1].to_i
          = link_to class: "legality-banned", {controller: "exh", action: "vote", name: card.name} do
            %i{class: (signed_in? && exh_card(card).voters.include?(current_user)) ? "voted" : ""}
              = "#{votes} point#{votes == 1 ? "" : "s"}"
        - else
          %i{class: "legality-#{status}"}= status
        = link_to format_name, controller: "format", action: "show", id: format_name.parameterize

%h5 Legalities
%ul.legalities
  - legality = card.legality_information
  - if legality.legal_everywhere?
    %li
      #{card.name} is legal in every format.
  - elsif legality.legal_nowhere?
    %li
      #{card.name} is not legal in any format.
  - else
    - card.legality_information.to_h.sort.each do |format_name, status|
      %li
        - if status.start_with? "restricted-"
          - points = status.split("-")[1].to_i
          %i{class: "legality-restricted"}= "#{points} point#{points == 1 ? "" : "s"}"
        - elsif status.start_with? "banned-"
          - votes = status.split("-")[1].to_i
          = link_to({controller: "exh", action: "vote", name: card.name}, class: "legality-banned") do
            %i{class: (signed_in? && exh_card(card).voters.include?(current_user)) ? "voted" : ""}
              = "#{votes} point#{votes == 1 ? "" : "s"}"
        - else
          %i{class: "legality-#{status}"}= status
        = link_to format_name, controller: "format", action: "show", id: format_name.parameterize

Fix syntax errors in _legality.haml
Fix syntax errors in _legality.haml
