Files
danbooru/app/views/artist_urls/index.html.erb
evazion 1743f3797f views: factor out search_form_for helper.
Refactor search forms to use `search_form_for` so that we can set common
options on all search forms, such as autocomplete="off" (#4162).
2019-09-10 14:31:19 -05:00

46 lines
1.8 KiB
Plaintext

<div id="c-artist-urls">
<div id="a-index">
<%= search_form_for(artist_urls_path) do |f| %>
<%= f.simple_fields_for :artist do |fa| %>
<%= fa.input :name, label: "Artist Name", input_html: { value: params.dig(:search, :artist, :name), "data-autocomplete": "artist" } %>
<% end %>
<%= f.input :url_matches, label: "URL", input_html: { value: params[:search][:url_matches] } %>
<%= f.input :normalized_url_matches, label: "Normalized URL", input_html: { value: params[:search][:normalized_url_matches] } %>
<%= f.input :is_active, label: "Active?", collection: [["Yes", true], ["No", false]], include_blank: true, selected: params[:search][:is_active] %>
<%= f.input :order, collection: [["ID", "id"], ["Created", "created_at"], ["Updated", "updated_at"]], selected: params[:search][:order] %>
<%= f.submit "Search" %>
<% end %>
<table class="striped" width="100%">
<thead>
<tr>
<th>ID</th>
<th>Artist Name</th>
<th>URL</th>
<th>Normalized URL</th>
<th>Active?</th>
<th>Created</th>
<th>Updated</th>
</tr>
</thead>
<tbody>
<% @artist_urls.each do |artist_url| %>
<tr>
<%= tag.td artist_url.id %>
<%= tag.td link_to(artist_url.artist.name, artist_url.artist) %>
<%= tag.td external_link_to(artist_url.url.to_s) %>
<%= tag.td external_link_to(artist_url.normalized_url) %>
<%= tag.td artist_url.is_active.to_s %>
<%= tag.td compact_time(artist_url.created_at) %>
<%= tag.td compact_time(artist_url.updated_at) %>
</tr>
<% end %>
</tbody>
</table>
<%= numbered_paginator(@artist_urls) %>
</div>
</div>
<%= render "artists/secondary_links" %>