Skip to content

Commit

Permalink
Autoselect first if only one layout available (#1932)
Browse files Browse the repository at this point in the history
  • Loading branch information
mickenorlen authored Sep 7, 2020
1 parent 98ab5e4 commit 420d7f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/views/alchemy/admin/pages/_new_page_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
<%= f.input :page_layout,
collection: @page_layouts,
label: Alchemy.t(:page_type),
include_blank: Alchemy.t('Please choose'),
include_blank: @page_layouts.length == 1 ? nil : Alchemy.t('Please choose'),
required: true,
selected: @page_layouts.length == 1 ? @page_layouts.first : nil,
input_html: {class: 'alchemy_selectbox'} %>
<%= f.input :name %>
<%= f.submit Alchemy.t(:create) %>
Expand Down

0 comments on commit 420d7f4

Please sign in to comment.