impress/app/views/alt_styles/edit.html.haml
Emi Matchu 3cd02baa09 Add thumbnail_input method to support form builder
Just to clean up this relatively common input type!
2024-11-30 11:34:02 -08:00

43 lines
1.4 KiB
Text

- title @alt_style.full_name
- use_responsive_design
%ol.breadcrumbs
%li= link_to "Alt Styles", alt_styles_path
%li
= link_to @alt_style.color.human_name,
alt_styles_path(color: @alt_style.color.human_name)
%li{"data-relation-to-prev": "sibling"}
= link_to @alt_style.species.human_name,
alt_styles_path(species: @alt_style.species.human_name)
%li= @alt_style.series_name
= image_tag @alt_style.preview_image_url, class: "alt-style-preview"
= support_form_with model: @alt_style, class: "support-form" do |f|
- if @alt_style.errors.any?
%p
Could not save:
%ul.errors
- @alt_style.errors.each do |error|
%li= error.full_message
= f.fields do
= f.field do
= f.label :real_series_name, "Series"
= f.text_field :real_series_name, autofocus: !@alt_style.real_series_name?,
placeholder: AltStyle.placeholder_name
= f.field do
= f.label :thumbnail_url, "Thumbnail"
= f.thumbnail_input :thumbnail_url
.actions
= f.submit "Save changes"
%label{title: "If checked, takes you to the next unlabeled pet style, if any. Useful for labeling in bulk!"}
= check_box_tag "next", "unlabeled-style",
checked: params[:next] == "unlabeled-style"
Then: Go to unlabeled style
- content_for :stylesheets do
= stylesheet_link_tag "application/breadcrumbs", "application/support-form"
= page_stylesheet_link_tag "alt_styles/edit"