posts: refactor hardcoded ratings.
Refactor ratings to not be hardcoded in various places. Make it so all ratings are defined in Post::RATINGS. Also make it so that you can search multiple ratings at once with `rating:q,e`.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<%= f.input :old_source, as: :hidden, input_html: { value: post.source } %>
|
||||
<%= f.input :old_rating, as: :hidden, input_html: { value: post.rating } %>
|
||||
|
||||
<%= f.input :rating, collection: [["Explicit", "e"], ["Questionable", "q"], ["Safe", "s"]], as: :radio_buttons, boolean_style: :inline %>
|
||||
<%= f.input :rating, collection: Post::RATINGS.invert.reverse_each.to_h, as: :radio_buttons, boolean_style: :inline %>
|
||||
|
||||
<fieldset class="inline-fieldset post_has_embedded_notes_fieldset">
|
||||
<label>Notes</label>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<%= hidden_field_tag :upload_media_asset_id, upload_media_asset.id %>
|
||||
|
||||
<%= f.input :source, as: :string, input_html: { value: post.source } %>
|
||||
<%= f.input :rating, collection: [["Explicit", "e"], ["Questionable", "q"], ["Safe", "s"]], as: :radio_buttons, selected: post.rating %>
|
||||
<%= f.input :rating, collection: Post::RATINGS.invert.reverse_each.to_h, as: :radio_buttons, selected: post.rating %>
|
||||
<%= f.input :parent_id, label: "Parent ID", as: :string, input_html: { value: post.parent_id } %>
|
||||
|
||||
<div class="input upload_artist_commentary_container">
|
||||
|
||||
Reference in New Issue
Block a user