-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2398 from tvdeyen/update-headline-ingredient-editor
Add Headline size and level selects as input addons
- Loading branch information
Showing
8 changed files
with
155 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,26 @@ | ||
<% has_level_select = headline_editor.level_options.many? %> | ||
<% has_size_select = headline_editor.size_options.many? %> | ||
|
||
<%= content_tag :div, | ||
class: headline_editor.css_classes, | ||
data: headline_editor.data_attributes do %> | ||
<%= element_form.fields_for(:ingredients, headline_editor.ingredient) do |f| %> | ||
<%= ingredient_label(headline_editor) %> | ||
<%= f.text_field :value, id: nil %> | ||
|
||
<div class="input-row"> | ||
<% if headline_editor.level_options.length > 1 %> | ||
<div class="input-column"> | ||
<%= f.label :level %> | ||
<%= f.select :level, | ||
options_for_select(headline_editor.level_options, headline_editor.level), | ||
{}, | ||
{ class: "alchemy_selectbox full_width" } %> | ||
</div> | ||
<% end %> | ||
|
||
<% if headline_editor.size_options.length > 1 %> | ||
<div class="input-column"> | ||
<%= f.label :size %> | ||
<%= f.select :size, | ||
options_for_select(headline_editor.size_options, headline_editor.size), | ||
{}, | ||
{ class: "alchemy_selectbox full_width" } %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% if has_level_select %> | ||
<div class="input-addon right<%= " second" if has_size_select %>"> | ||
<%= f.select :level, | ||
options_for_select(headline_editor.level_options, headline_editor.level), | ||
{}, | ||
{ class: "custom-select", title: f.object.class.human_attribute_name(:level) } %> | ||
</div> | ||
<% end %> | ||
<% if has_size_select %> | ||
<div class="input-addon right"> | ||
<%= f.select :size, options_for_select(headline_editor.size_options, headline_editor.size), | ||
{}, | ||
{ class: "custom-select", title: f.object.class.human_attribute_name(:size) } %> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters