scinote-web/app/views/steps/_form_checklists.html.erb

53 lines
2.2 KiB
Text
Raw Normal View History

2016-02-12 23:52:43 +08:00
<div class="panel panel-default panel-step-attachment">
<div class="panel-heading">
<span class="glyphicon glyphicon-list"></span>
2016-07-21 19:11:15 +08:00
<%= t("protocols.steps.new.checklist_panel_title") %>
2016-02-12 23:52:43 +08:00
<div class="pull-right">
<%= ff.remove_nested_fields_link do %>
<span class="glyphicon glyphicon-remove"></span>
<% end %>
</div>
</div>
<div class="panel-body">
<%= ff.smart_text_area :name,
label: t('protocols.steps.new.checklist_name'),
class: 'checklist_name',
autofocus: true,
placeholder: t('protocols.steps.new.checklist_name_placeholder'),
data: { 'atwho-edit' => '' } %>
2016-07-21 19:11:15 +08:00
<%= ff.label t("protocols.steps.new.checklist_items") %>
2016-02-12 23:52:43 +08:00
<ul>
<%= ff.nested_fields_for :checklist_items, ordered_checklist_items(ff.object) do |chkItems| %>
<li>
<div class="row">
<span class="glyphicon glyphicon-chevron-right handle-move pull-left"></span>
<div class="row">
<div class="col-xs-6">
<%= chkItems.smart_text_area :text,
autofocus: true,
placeholder: t('protocols.steps.new.checklist_item_placeholder'),
hide_label: true,
class: 'checklist-item-text form-control',
single_line: true,
data: { 'atwho-edit' => '' } %>
2016-02-12 23:52:43 +08:00
<%= chkItems.hidden_field :position, class: "checklist-item-pos" %>
</div>
<div class="col-xs-1">
<div class="btn btn-link">
<%= chkItems.remove_nested_fields_link do %>
<span class="glyphicon glyphicon-remove"></span>
<% end %>
</div>
</div>
</div>
</div>
</li>
<% end %>
</ul>
<%= ff.add_nested_fields_link :checklist_items do %>
<span class="glyphicon glyphicon-plus"></span>
2016-07-21 19:11:15 +08:00
<%= t("protocols.steps.new.checklist_add_item") %>
2016-02-12 23:52:43 +08:00
<% end %>
</div>
</div>