Sha256: 841aa92bb32280784952e211330b687b50d7ae185f6cc628bd39d0fd502bbc0d

Contents?: true

Size: 1.94 KB

Versions: 21

Compression:

Stored size: 1.94 KB

Contents

<%# Form UI behavior code and details;
Code:
  app/assets/javascripts/hyrax/relationships
CSS:
  [data-behavior="remove-relationship"] : Button to remove its parent TR from the table
  [data-behavior="add-relationship"] : Button to clone its parent TR and inject a new row into the table
  .message.has-warning : Used to display UI errors related to input values and server errors
HTML Properties:
  table:
    [data-behavior="child-relationships"] : allows the javascript to be initialized
    data-param-key : the parameter key value for this model type
%>
<div class="form-group multi_value optional managed">
  <%= link_to "Attach New Work", polymorphic_path([main_app, :new, :hyrax, :parent, curation_concern.model_name.singular], parent_id: curation_concern.id), target: "_blank", class: 'btn btn-primary' %>

  <table class="table table-striped related-files" data-behavior="child-relationships" data-param-key="<%= f.object.model_name.param_key %>">
    <thead>
    <tr>
      <th>Child Work</th>
      <th>Actions</th>
    </tr>
    </thead>
    <tbody>

    <%= f.fields_for :work_members do |row| %>
        <tr>
          <td>
            <%= link_to row.object.title.first, [main_app, row.object] %>
          </td>
          <td>
            <a class="btn btn-danger" data-behavior="remove-relationship" data-index="<%= row.index %>">Remove</a>
          </td>
        </tr>
    <% end %>
    <tr>
      <td>
        <%= render "find_work_widget", f: f,
                                       name: 'child_work',
                                       id: f.object.model.id %>
        <div class="message has-warning hidden"></div>
      </td>
      <td>
        <a class="btn btn-primary" data-behavior="add-relationship">Add</a>
      </td>
    </tr>
    </tbody>
  </table>
</div>

<script type="text/x-tmpl" id="tmpl-child-work">
<tr>
  <td>{%= o.title %}</td>
  <td><button class="btn btn-danger" data-behavior="remove-relationship">Remove</button></td>
</tr>
</script>

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
hyrax-1.1.1 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-2.0.3 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-1.1.0 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-2.0.2 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-2.0.1 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-2.0.0 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-2.0.0.rc3 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-2.0.0.rc2 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-2.0.0.rc1 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-1.0.5 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-2.0.0.beta5 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-2.0.0.beta4 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-2.0.0.beta3 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-2.0.0.beta2 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-2.0.0.beta1 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-1.0.4 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-1.0.3 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-1.0.2 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-1.0.1 app/views/hyrax/base/_form_child_work_relationships.html.erb
hyrax-1.0.0.rc2 app/views/hyrax/base/_form_child_work_relationships.html.erb