Sha256: cdc74e0428e2bac831ef8f01666d1b15f9453b43f6a331178e6ef4597181c939

Contents?: true

Size: 1.8 KB

Versions: 6

Compression:

Stored size: 1.8 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'
              GeoWorks::MetadataFormatService.select_options
            elsif params['type'] == 'image-data'
              GeoWorks::ImageFormatService.select_options
            elsif params['type'] == 'raster-data'
              GeoWorks::RasterFormatService.select_options
            elsif params['type'] == 'vector-data'
              GeoWorks::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

6 entries across 6 versions & 1 rubygems

Version Path
geo_works-0.2.0 app/views/geo_works/file_sets/_form.html.erb
geo_works-0.1.4 app/views/geo_works/file_sets/_form.html.erb
geo_works-0.1.3 app/views/geo_works/file_sets/_form.html.erb
geo_works-0.1.2 app/views/geo_works/file_sets/_form.html.erb
geo_works-0.1.1 app/views/geo_works/file_sets/_form.html.erb
geo_works-0.1.0 app/views/geo_works/file_sets/_form.html.erb