<div id="p-<%= listing_type(:wiki_page_id, member_check: false, types: [:page, :global]) %>-listing">
  <%= form_tag(diff_wiki_page_versions_path, :method => :get) do %>
    <%= table_for @wiki_page_versions.includes(:updater, :tag), width: "100%" do |t| %>
      <% t.column column: "diff", width: "3%" do |wiki_page_version, i| %>
        <%= link_to_if wiki_version_show_diff(wiki_page_version, params[:type]), "diff", diff_wiki_page_versions_path(thispage: wiki_page_version.id, type: params[:type]) %>
      <% end %>

      <% if listing_type(:wiki_page_id, member_check: false, types: [:page, :global]) == :page %>
        <% t.column column: "this-page", width: "2%" do |wiki_page_version, i| %>
          <%= radio_button_tag "thispage", wiki_page_version.id, (i == 1) %>
        <% end %>
        <% t.column column: "other-page", width: "2%" do |wiki_page_version, i| %>
          <%= radio_button_tag "otherpage", wiki_page_version.id, (i == 0) %>
        <% end %>
      <% end %>

      <% t.column "Title", td: {class: "diff-body"} do |wiki_page_version| %>
        <span class="<%= tag_class(wiki_page_version.tag) %>">
          <%= link_to "?", wiki_page_path(wiki_page_version.wiki_page_id) %>
          <%= link_to wiki_page_version.title, wiki_page_version %>
          <%= link_to "»", wiki_page_versions_path(search: { wiki_page_id: wiki_page_version.wiki_page_id }) %>
        </span>
        <%= wiki_version_title_diff(wiki_page_version, params[:type]) %>
      <% end %>
      <% t.column "Changes", width: "5%" do |wiki_page_version| %>
        <%= status_diff_html(wiki_page_version, params[:type]) %>
      <% end %>
      <% t.column "Updated", width: "26%" do |wiki_page_version| %>
        <%= compact_time(wiki_page_version.updated_at) %>
        by
        <%= link_to_user wiki_page_version.updater %>
        <%= link_to "»", wiki_page_versions_path(search: { updater_id: wiki_page_version.updater.id }) %>
      <% end %>
    <% end %>

    <% if listing_type(:wiki_page_id, member_check: false, types: [:page, :global]) == :page %>
      <%= submit_tag "Diff", class: "mt-4" %>
    <% end %>
  <% end %>
</div>
