Files
nairobi/app/views/admin/progress_bars/_form.html.erb
Javi Martín fff5673ec0 Simplify hiding/showing progress bar type field
With a parent element for just input and label, there aren't conflicts
with the globalize tabs code anymore.
2019-01-18 14:17:48 +01:00

32 lines
1.1 KiB
Plaintext

<%= render "admin/shared/globalize_locales", resource: @progress_bar %>
<%= translatable_form_for [:admin, *resource_hierarchy_for(@progress_bar)] do |f| %>
<div class="small-12 medium-6">
<%= f.enum_select :kind %>
</div>
<%= f.translatable_fields do |translations_form| %>
<div class="small-12 medium-6">
<%= translations_form.text_field :title %>
</div>
<% end %>
<% progress_options = { min: ProgressBar::RANGE.min, max: ProgressBar::RANGE.max, step: 1 } %>
<div class="small-12 medium-6 large-2">
<%= f.text_field :percentage, { type: :range,
id: "percentage_range",
class: "column" }.merge(progress_options) %>
</div>
<div class="small-12 medium-6 large-2">
<div class="input-group">
<%= f.text_field :percentage, { type: :number,
label: false,
class: "input-group-field" }.merge(progress_options) %>
<span class="input-group-label">%</span>
</div>
</div>
<%= f.submit nil, class: "button success" %>
<% end %>