Sha256: 4d2de8b14d8495f57fdda5d9fbb66dd01421ee9dc21787257fc4a1acc1e83902

Contents?: true

Size: 1.77 KB

Versions: 1

Compression:

Stored size: 1.77 KB

Contents

<%= simple_form_for [main_app, curation_concern],
                    html: { multipart: true },
                    wrapper_mappings: { multifile: :horizontal_file_input } do |f| %>
  <div class="row">
    <div class="col-md-6">
      <fieldset class="required">
        <legend>Your File&#8217;s Title</legend>
        <span class="control-label">
          <%= label_tag 'file_set[title][]', 'Title',  class: "string optional" %>
        </span>
        <%= text_field_tag 'file_set[title][]', curation_concern.title.first, class: 'form-control' %>
      </fieldset>
      <fieldset class="required">
        <legend>
          Attach Your File
        </legend>
          <% select_options = if params['type'] == 'metadata'
              MetadataFormatService.select_options
            elsif params['type'] == 'image-data'
              ImageFormatService.select_options
            elsif params['type'] == 'raster-data'
              RasterFormatService.select_options
            elsif params['type'] == 'vector-data'
              VectorFormatService.select_options
            end %>
          <% if select_options %>
           <%= f.input(:geo_mime_type, as: :select, collection: select_options,
                input_html: { class: 'form-control' }, label: 'Type') %>
          <% end %>
          <%= f.input :files, as: :multifile %>
      </fieldset>
    </div>

    <div class="col-md-6">
      <%= render "form_permission", f: f %>
    </div>
  </div>

  <div class="row">
    <div class="col-md-12 form-actions">
      <%= f.submit(
        (curation_concern.persisted? ? "Update Attached File" : %(Attach to #{parent.human_readable_type})),
        class: 'btn btn-primary'
      ) %>
      <%= link_to 'Cancel', parent_path(parent), class: 'btn btn-link' %>
    </div>
  </div>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
geo_concerns-0.0.4 app/views/curation_concerns/file_sets/_form.html.erb