MishkaCmsCoreWeb.Templates.AssetsList (Mishka CMS Core v0.0.1)

Copy Markdown View Source

A MishkaGervaz table template: the file LIST in the builder's Assets sheet.

The sheet's other view of the same files — MishkaCmsCoreWeb.Templates.AssetsGrid is the cards, this is the rows, and the switcher in the toolbar moves between them.

Why it exists at all

The switcher used to offer Gervaz's own MishkaGervaz.Table.Templates.Table, and half of it was off the screen. That template draws a PAGE — a filter bar with Search, Type, Site, Featured and the archive switch laid across the width, then a multi-column table with a header. The sheet is 620px of overlay with a folder rail down one side, so the filters, the Type column and the actions all ran past the right edge with no way to reach them.

A row here is the card's information in one line: the same thumbnail, the same name and meta, the same actions. What it drops is everything that only pays for itself at page width — the column header, sorting, and columns for values the row already says in words.

The chrome above and below it — search, the switcher, select-all, the bulk bar and the paging — is MishkaCmsCoreWeb.Templates.AssetsChrome, shared with the grid so the two views differ in exactly one thing.

The thumbnail

A row's image hides itself when it fails to load, leaving the tinted square rather than a broken icon, and the admin bundle's MediaThumb hook is what notices — see MishkaGervaz.Table.Templates.MediaGallery. The onerror= attribute this replaces is blocked outright once a Content-Security-Policy is enforced, and no nonce applies to an event handler.

Summary

Functions

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_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.