MishkaBlogWeb.Templates.TagCard (Mishka Blog v0.0.1)

Copy Markdown View Source

The tags grid: one compact chip per tag, packed several to a row.

Declared only by MishkaBlog.Tag, and it reads that record directly rather than by column position. A tag is small — a hash tile, a name, its language, and how many posts wear it — so the chip is dense and the actions fold into the kebab menu the resource already declares as a dropdown row-action layout, which MishkaGervaz.Table.Templates.Shared.render_row_actions/1 draws.

The grid is intrinsic, not stepped

The track list is repeat(auto-fill, minmax(min(100%, 220px), 1fr)): a chip never goes below 220px unless the viewport is narrower, so the column count falls from four to two to one on its own.

Features

  • :filter - the labelled filter row: search, site, language
  • :select - per-chip selection for bulk operations
  • :bulk_actions - bulk actions on the selected chips
  • :paginate - the page-size picker and Load more under the grid

The list shows one chip per tag rather than one per translation (MishkaCmsCore.LanguageEditions); a translated tag names its languages under its name (MishkaBlogWeb.Templates.EditionChips), each the way to that edition.

The furniture is MishkaCmsCoreWeb.Templates.CardChrome and the controls are MishkaCmsCoreWeb.UIAdapters.Admin, both shared with every other blog card page.

Summary

Functions

One aggregate off the record, or 0 when it arrived unloaded.

The switcher draws the grid-of-squares glyph, identical to every other blog card page.

One tag chip.

The hash-tile tint, picked from the tag name so it never flickers between renders.

Functions

count(record, key)

@spec count(map(), atom()) :: non_neg_integer()

One aggregate off the record, or 0 when it arrived unloaded.

icon()

The switcher draws the grid-of-squares glyph, identical to every other blog card page.

render_bulk_actions(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_bulk_actions/1.

render_empty(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_empty/1.

render_error(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_error/1.

render_filters(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_filters/1.

render_header(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_header/1.

render_item(assigns)

One tag chip.

render_pagination(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_pagination/1.

render_template_switcher(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_template_switcher/1.

tint(record)

@spec tint(map()) :: String.t()

The hash-tile tint, picked from the tag name so it never flickers between renders.