Sha256: 627e5d63b997b208aaf369a867acde9a0ec8bcd39faf7dfd495667484e34966a

Contents?: true

Size: 1008 Bytes

Versions: 5

Compression:

Stored size: 1008 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"
        action = "destroy"
      else
        method = :put
        label = 'add to batch'
        cssClass = "addBatch"
        action = "add"
      end
    -%>

    <%= form_tag({:controller => "batch_edits", :action => action, :id => document.id}, :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

5 entries across 5 versions & 1 rubygems

Version Path
hydra-batch-edit-0.3.1 app/views/batch_edits/_add_button.html.erb
hydra-batch-edit-0.3.0 app/views/batch_edits/_add_button.html.erb
hydra-batch-edit-0.2.0 app/views/batch_edits/_add_button.html.erb
hydra-batch-edit-0.1.0 app/views/batch_edits/_add_button.html.erb
hydra-batch-edit-0.0.7 app/views/batch_edits/_add_button.html.erb