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

Copy Markdown View Source

A MishkaGervaz custom table template: the inbox at /admin/dashboard/notifications, rendered as one card of full-width rows (checkbox, severity tile, title/body/time, per-row actions) rather than a table — backed by Gervaz, so filters, selection, bulk actions, pagination and realtime come from the resource DSL rather than from this module.

A template owns the WHOLE table, so the chrome is here too: the filter bar (render_filters/1), the select-all + bulk toolbar (render_selection_toolbar/1) and the footer (render_pagination/1). Each is generic — it walks static.filters / static.bulk_actions and never names a specific filter — so the resource stays the single source of truth. Row content comes from each column's render in MishkaCmsCore.Notify.Notification, mapped here by position: 0 icon, 1 title, 2 body, 3+ footer.

It lives in mishka_cms_core (not blog) because the bell is core and core cannot depend on an extension.

See MishkaCmsCore.Notify and MishkaCmsCoreWeb.Live.Admin.Dashboard.Notification.Index.

Summary

Functions

The filter bar: every :text filter becomes a grow-to-fill search box, every :select a labelled dropdown. Names and the phx-change="filter" form are Gervaz's contract — only the look is ours.

The footer: how far into the feed we are on the left, load-more + per-page on the right.

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)

The filter bar: every :text filter becomes a grow-to-fill search box, every :select a labelled dropdown. Names and the phx-change="filter" form are Gervaz's contract — only the look is ours.

render_header(assigns)

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

render_loading(assigns)

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

render_pagination(assigns)

The footer: how far into the feed we are on the left, load-more + per-page on the right.

Gervaz's own Shared.render_pagination/1 hardcodes the button's look, so its two controls are driven straight from here instead — same load_more / change_page_size events, our classes.

render_template_switcher(assigns)

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