%div
  - if @query.participant_id.present?
    関係者：
    = Author.find(@query.participant_id).name
    = link_to content_tag(:span, '', class: 'fa fa-remove'), @query.params(remove: [:participant_id])
  - else
    - @result_set.participants.each do |participant|
      %span
        = link_to participant.name, @query.params(add: {participant_id: participant._key})
        = "(#{participant.n_sub_records})"

%ol
  - @result_set.posts.each do |post|
    %li
      = link_to post.title, post_url(post.public_id)
      %span.score= "(#{post.score})"
      - if post.participants
        - post.participants.each do
          .participant= link_to participant.name, @query.params(add: {participant_id: post.participant.id})

- if @result_set.posts.total_pages > 1
  %nav.pagination
    = paginate @result_set.posts
    %p.pagination__entries= page_entries_info @result_set.posts

%div
  - if @query.participant_id.present?
    関係者：
    = Author.find(@query.participant_id).name
    = link_to content_tag(:span, '', class: 'fa fa-remove'), @query.params(remove: [:participant_id])
  - else
    - @result_set.participants.each do |participant|
      %span
        = link_to participant.name, @query.params(add: {participant_id: participant._key})
        = "(#{participant.n_sub_records})"

%ol
  - @result_set.posts.each do |post|
    %li
      = link_to post.title, post_url(post.public_id)
      %span.score= "(#{post.score})"
      - if post.participants
        - post.participants.each do |participant|
          .participant= link_to participant.name, @query.params(add: {participant_id: post.participant.id})

- if @result_set.posts.total_pages > 1
  %nav.pagination
    = paginate @result_set.posts
    %p.pagination__entries= page_entries_info @result_set.posts

Add missing block local variable
Add missing block local variable
