Bulk actions

back edit
<div class="Box js-bulk-actions-container" data-bulk-actions-url="/bulk-actions">
  <div class="Box-header">
    <span class="float-right js-bulk-actions"></span>
    Issues
  </div>
  <label class="Box-row d-block">
    <input type="checkbox" class="js-bulk-actions-toggle" name="repo_ids[]" value="11">
    #11 This is broken
    <span class="Label bg-red">bug</span>
  </label>
  <label class="Box-row d-block">
    <input type="checkbox" class="js-bulk-actions-toggle" name="repo_ids[]" value="4">
    #4 Undefined is not a function
    <span class="Label bg-red">bug</span>
  </label>
  <label class="Box-row d-block">
    <input type="checkbox" class="js-bulk-actions-toggle" name="repo_ids[]" value="1">
    #1 Missing license
    <span class="Label bg-red">bug</span>
  </label>
</div>

Your bulk actions Rails partial might look like this:

<form action="/bulk_add_or_remove_label">
  <% selected_repos.each do |repo| %>
    <input name="repo_ids[]" value="<%= repo.id %>" type="hidden">
  <% end %>
  <% labels.each do |label| %>
    <button type="submit" value="<%= label %>" name="label">
      <% if repos_have_label(label) %><%= octicon "check" %><% end %>
      <%= label %>
    </button>
  <% end %>
</form>