{{define "itemsAll:list_rows"}}
{{ $rowCount := 0 }}

  {{ range .items }}
  
  <tr
    {{ $rowCount = incr $rowCount}}
    {{ if eq $rowCount 10 }}
    {{ $offset := addI $.offset $rowCount}}
    hx-get="/items?offset={{ $offset }}&out=rows&criteriaName={{ $.criteriaName }}"
    hx-trigger="revealed"
    hx-swap="afterend"
    {{ end }}
    >
    <td class="title no-label">
      <a class="hide-xsmall" href="/item/view/{{.Id}}" hx-get="/item/view/{{.Id}}" hx-target="body" hx-swap="beforeend">{{.Title}}</a>
      <a class="hide-medium hide-large" href="/item/read/{{.Id}}" hx-get="/item/read/{{.Id}}" hx-target="#page-content" hx-push-url="true"><i title="{{.TypeTitle}}" class="{{.TypeIcon}}"></i> {{.Title}}</a>
    </td>
    <td data-label="Type" class="hide-xsmall" nowrap="nowrap"><i class="{{.TypeIcon}}"></i> {{.TypeTitle}}</td>
    <td data-label="Categories" class="no-label links-list">
      {{ if gt (len .Categories) 0 }}
      <i class="hide-medium hide-large bi bi-tags-fill"></i>
      {{ range (stringToArray .Categories "|")}}
        {{ $categoryId := index $.categoriesMap .}}
        <a hx-post="/items" hx-target="#page-content" hx-push-url="true" href="#" hx-vals="{&quot;category_id&quot; : &quot;{{ . }}&quot;}">{{ $categoryId }}</a>
      {{ end }}
      {{ end }}
    </td>
    <td data-label="Tags" class="no-label links-list">
      {{ if gt (len .Tags) 0 }}
      <i class="hide-medium hide-large bi bi-tags"></i>
      {{ range (stringToArray .Tags ",")}}
      <a hx-post="/items" hx-target="#page-content" hx-push-url="true" href="#" hx-vals="{&quot;Tags&quot; : &quot;{{.}}&quot;}">{{ . }}</a>
      {{ end }}
      {{ end }}
    </td>
    <td data-label="" class="operations" nowrap="nowrap">
      
      {{ if eq .OnDashboard 1}}
        {{ template "item:remove_from_dashboard" .Id }}
      {{ else }}
        {{ template "item:add_to_dashboard" .Id }}
      {{ end }}

      <button href="#" hx-target="body" hx-swap="beforeend" hx-get="/item/share/{{.Id}}" title="Share"><i class="bi bi-share-fill"></i></button>
      <button hx-get="/item/update/{{.Id}}" hx-push-url="true" hx-target="#page-content" title="Edit"><i class="bi bi-pencil"></i></button>
      <button hx-delete="/item/delete/{{.Id}}" hx-target="closest tr" hx-swap="outerHTML swap:1s" hx-trigger="confirmed" onClick="bm_show_confirm_delete(this, 'Items', 'Delete this item ?')" title="Delete"><i class="bi bi-trash"></i></button>
    </td>
  </tr>
  {{ end }}
  {{ end }}