Sha256: 02d2f7a021aeffa50905228c423dfed6e0c53909a5922169f09c6a171a54dcfa

Contents?: true

Size: 916 Bytes

Versions: 2

Compression:

Stored size: 916 Bytes

Contents

<div data-behavior="batch-add-button">
  <% if can? :edit, document.id %>

    <%-   
      # pass in local :document with a SolrDocument
      if item_in_batch?(document.id)
        method = "delete"
        label = 'remove from batch'
        cssClass = "deleteBatch"
      else
        method = "put"
        label = 'add to batch'
        cssClass = "addBatch"
      end
    -%>

    <%= form_tag(batch_edit_path(document), :method => method, :class=> "batch_toggle #{cssClass}", "data-doc-id" => document.id, "data-behavior" => 'batch-add-form', :title=>h(document[document_show_link_field])) do -%>  
      <%= hidden_field(:bookmark, :title, :value => document[document_show_link_field]) %>
      <%= submit_tag(label, :class=>"batch_submit", :id => "batch_submit_#{document.id}") %>
    <% end %>

  <% else %>
    <br><span class="label label-warning">You don't have edit access</label>
  <% end %>
</div>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hydra-batch-edit-0.0.6 app/views/batch_edits/_add_button.html.erb
hydra-batch-edit-0.0.5 app/views/batch_edits/_add_button.html.erb