Skip to content

Commit

Permalink
add bootstrap classes to forms (#736)
Browse files Browse the repository at this point in the history
  • Loading branch information
labradford authored Feb 10, 2023
1 parent 5ba218c commit 3d3cf7d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 22 deletions.
45 changes: 29 additions & 16 deletions app/views/bulkrax/exporters/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,30 @@
</div>
<% end %>
<%= form.input :name, label: t('bulkrax.exporter.labels.name') %>
<%= form.input :name, label: t('bulkrax.exporter.labels.name'), input_html: { class: 'form-control' } %>
<%= form.hidden_field :user_id, value: current_user.id %>
<%= form.input :export_type,
collection: form.object.export_type_list,
label: t('bulkrax.exporter.labels.export_type'),
required: true,
prompt: 'Please select an export type' %>
prompt: 'Please select an export type',
input_html: { class: 'form-control' } %>
<%= form.input :export_from,
collection: form.object.export_from_list,
label: t('bulkrax.exporter.labels.export_from'),
required: true,
prompt: 'Please select an export source' %>
prompt: 'Please select an export source',
input_html: { class: 'form-control' } %>
<%= form.input :export_source_importer,
label: t('bulkrax.exporter.labels.importer'),
required: true,
prompt: 'Select from the list',
label_html: { class: 'importer export-source-option hidden' },
input_html: { class: 'importer export-source-option hidden' },
input_html: { class: 'importer export-source-option hidden form-control' },
collection: form.object.importers_list.sort %>
<%= form.input :export_source_collection,
Expand All @@ -42,7 +44,7 @@
placeholder: @collection&.title&.first,
label_html: { class: 'collection export-source-option hidden' },
input_html: {
class: 'collection export-source-option hidden',
class: 'collection export-source-option hidden form-control',
data: {
'autocomplete-url' => '/authorities/search/collections',
'autocomplete' => 'collection'
Expand All @@ -55,13 +57,14 @@
required: true,
prompt: 'Select from the list',
label_html: { class: 'worktype export-source-option hidden' },
input_html: { class: 'worktype export-source-option hidden' },
input_html: { class: 'worktype export-source-option hidden form-control' },
collection: Hyrax.config.curation_concerns.map {|cc| [cc.to_s, cc.to_s] } %>
<%= form.input :limit,
as: :integer,
hint: 'leave blank or 0 for all records',
label: t('bulkrax.exporter.labels.limit') %>
label: t('bulkrax.exporter.labels.limit'),
input_html: { class: 'form-control' } %>
<%= form.input :generated_metadata?,
as: :boolean,
Expand All @@ -76,26 +79,36 @@
<%= form.input :date_filter,
as: :boolean,
label: t('bulkrax.exporter.labels.filter_by_date') %>

<div id="date_filter_picker" class="hidden">
<%= form.input :start_date,
as: :date,
label: t('bulkrax.exporter.labels.start_date') %>
label: t('bulkrax.exporter.labels.start_date'),
input_html: { class: 'form-control' } %>
<%= form.input :finish_date,
as: :date,
label: t('bulkrax.exporter.labels.finish_date') %>
label: t('bulkrax.exporter.labels.finish_date'),
input_html: { class: 'form-control' } %>
</div>
<%= form.input :work_visibility,
collection: form.object.work_visibility_list,
label: t('bulkrax.exporter.labels.visibility') %>
<% if defined?(::Hyrax) %>
<%= form.input :work_visibility,
collection: form.object.work_visibility_list,
label: t('bulkrax.exporter.labels.visibility'),
input_html: { class: 'form-control' } %>
<% end %>
<%= form.input :workflow_status,
collection: form.object.workflow_status_list,
label: t('bulkrax.exporter.labels.status') %>
<% if defined?(::Hyrax) %>
<%= form.input :workflow_status,
collection: form.object.workflow_status_list,
label: t('bulkrax.exporter.labels.status'),
input_html: { class: 'form-control' } %>
<% end %>
<%= form.input :parser_klass,
collection: Bulkrax.parsers.map {|p| [p[:name], p[:class_name], {'data-partial' => p[:partial]}] if p[:class_name].constantize.export_supported? }.compact,
label: t('bulkrax.exporter.labels.export_format') %>
label: t('bulkrax.exporter.labels.export_format'),
input_html: { class: 'form-control' } %>
</div>

<%# Find definitions for the functions called in this script in
Expand Down
2 changes: 1 addition & 1 deletion app/views/bulkrax/exporters/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="row">
<div class="col-md-12">
<div class="panel panel-default tabs">
<div class="panel panel-default tabs exporter-form">
<%= simple_form_for @exporter do |form| %>
<%= render 'form', exporter: @exporter, form: form %>
<div class="panel-footer">
Expand Down
2 changes: 1 addition & 1 deletion app/views/bulkrax/exporters/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="row">
<div class="col-md-12">
<div class="panel panel-default tabs">
<div class="panel panel-default tabs exporter-form">
<%= simple_form_for @exporter do |form| %>
<%= render 'form', exporter: @exporter, form: form %>
<div class="panel-footer">
Expand Down
8 changes: 4 additions & 4 deletions app/views/bulkrax/importers/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
</div>
<% end %>
<%= form.input :name %>
<%= form.input :name, input_html: { class: 'form-control' } %>
<%= form.input :admin_set_id, collection: available_admin_sets %>
<%= form.hidden_field :user_id, value: current_user.id %>
<%= form.input :frequency, collection: form.object.class.frequency_enums %>
<%= form.input :frequency, collection: form.object.class.frequency_enums, input_html: { class: 'form-control' } %>
<%= form.input :limit, as: :integer, hint: 'leave blank or 0 for all records' %>
<%= form.input :limit, as: :integer, hint: 'leave blank or 0 for all records', input_html: { class: 'form-control'} %>
<%= form.input :parser_klass, collection: Bulkrax.parsers.map {|p| [p[:name], p[:class_name], {'data-partial' => p[:partial]}]}, label: "Parser" %>
<%= form.input :parser_klass, collection: Bulkrax.parsers.map {|p| [p[:name], p[:class_name], {'data-partial' => p[:partial]}]}, label: "Parser", input_html: { class: 'form-control' } %>
<%= form.fields_for :parser_fields do |fi| %>
<div class='parser_fields'>
Expand Down

0 comments on commit 3d3cf7d

Please sign in to comment.