Files
danbooru/app/views/artist_versions/_listing.html.erb
BrokenEagle 3ab2c4c3ea Use optional parameter to set column class
- Fixes the extremely long class name on the post versions view
- Can now use one value instead of having to set th and td
- Added missing column classes on all tables
2020-01-13 21:21:13 +00:00

41 lines
1.7 KiB
Plaintext

<div id="p-<%= artist_versions_listing_type %>-listing">
<%= table_for @artist_versions, {class: "striped autofit", width: "100%"} do |t| %>
<% t.column "Name" do |artist_version| %>
<% if artist_version.visible? %>
<%= link_to artist_version.name, artist_path(artist_version.artist_id) %>
<%= link_to "»", artist_versions_path(search: {artist_id: artist_version.artist_id}) %>
<% if !artist_version.is_active? %>
(deleted)
<% end %>
<% if artist_version.group_name.present? %>
<p>(group: <%= artist_version.group_name %>)</p>
<% end %>
<% end %>
<% end %>
<% t.column "Other Names" do |artist_version| %>
<% if artist_version.visible? %>
<%= artist_version_other_names_diff(artist_version) %>
<% end %>
<% end %>
<% t.column "URLs", td: {class: "col-expand"} do |artist_version| %>
<%= artist_version_urls_diff(artist_version) if artist_version.visible? %>
<% end %>
<% t.column "Updated" do |artist_version| %>
<%= link_to_user artist_version.updater %>
<%= link_to "»", artist_versions_path(search: { updater_name: artist_version.updater.name }) %>
<p>
<%= compact_time(artist_version.updated_at) %>
</p>
<% end %>
<% if artist_versions_listing_type == :revert %>
<% t.column column: "control" do |artist_version| %>
<%= link_to "Revert to", revert_artist_path(artist_version.artist_id, version_id: artist_version.id), method: :put, "data-confirm": "Are you sure you want to revert to this version?" %>
<% end %>
<% end %>
<% end %>
</div>