ujh/fountainpencompanion

View on GitHub
app/views/inks/index.html.slim

Summary

Maintainability
Test Coverage
- if params[:q].present?
  - content_for :title, "Search results for '#{params[:q]}'"
- elsif params[:tag].present?
  - content_for :title, "Inks tagged with '#{params[:tag]}'"

= render partial: 'inks/search'

div class="fpc-table fpc-table--full-width fpc-inks-table fpc-scroll-shadow"
  table class="table table-striped"
    thead
      tr
        th Brand
        th Line
        th colspan="2" Ink
        th Tags
        th
        - if user_signed_in?
          th
    tbody
      - @clusters.each do |ink|
        tr
          td= ink.brand_name
          td= ink.line_name
          td
            div style="background-color:#{ink.color};width:45px;height:45px;"
          td= ink.ink_name
          td
            ul class="tags"
              - ink.tags.each do |tag|
                li class="tag badge text-bg-secondary"
                  a href="#{inks_path(tag: tag)}"= tag
          td
            - if ink.brand_cluster.present?
              = link_to "Details", brand_ink_path(ink.brand_cluster, ink)
          - if user_signed_in?
            td
              div class="fpc-add-ink-button" data={ "macro-cluster-id" => ink.id }