ujh/fountainpencompanion

View on GitHub
app/views/collected_pens_archive/_table.html.slim

Summary

Maintainability
Test Coverage
div class="pen-collection"
  div class="fpc-table fpc-table--full-width fpc-scroll-shadow"
    table class="table table-striped"
      thead
        tr
          th Brand
          th Model
          th Nib
          th Color
          th Comment
          th
            span data-bs-toggle="tooltip" title="Displays how often this pen was used via the currently inked feature"
              span Usage
          th Actions
      tbody
        - pen_collection.each do |cp|
          tr id="#{cp.id}" data-name="entry"
            td data-name="brand"= cp.brand
            td data-name="model"= cp.model
            td data-name="nib"= cp.nib
            td data-name="color"= cp.color
            td data-name="comment"= cp.comment
            td data-name="usage"= cp.currently_inkeds.length
            td class="actions"
              = link_to edit_collected_pens_archive_path(cp), class: "btn btn-secondary", title: "Edit #{cp.name}" do
                = fa_icon("pencil")
              = link_to unarchive_collected_pens_archive_path(cp), class: "btn btn-secondary", method: :post, title: "Unarchive #{cp.name}" do
                = fa_icon("folder-open")
              = link_to collected_pens_archive_path(cp), class: "btn btn-danger", method: :delete, data: { confirm: "Really delete entry?"} do
                = fa_icon("trash")
      tfoot
        tr
          th
          th= "#{pen_collection.count} pens"
          th
          th
          th
          th
          th