# `MishkaDocumentWeb.Templates.DocumentSection`
[🔗](https://github.com/mishka-group/mishka_document/blob/v0.0.1/lib/mishka_document_web/templates/document_section.ex#L5)

The sections list: full-width cards beside a rail of workspace panels.

Declared only by `MishkaDocument.Section`, and it reads that record directly rather than by column
position — a card is a specific shape (a breadcrumb of chips, a title over its slug, a preview of the
content, a meta line and two review badges) that a generic position mapping cannot describe. The
resource's columns stay the field-selection contract and the sort menu's vocabulary.

## The rail

Whatever the page hands in through `:rail` — Software Info, Site Information, Maintainers, Recent
Activity — is laid out by this template rather than beside it, which is the only way its position
can follow the viewport. The four class strings come from
`MishkaGervaz.Table.Templates.Shared.rail_class/2`, so switching to the plain table keeps the rail
in the same place instead of stacking it on top of the records.

## The expanded panel

`:expand` here is server-rendered: the Comment-style toggle pushes `expand_row`, the page answers by
rendering its own Notes / Recent Activity panel and pushing it back as `expanded_html`, and this
template only frames it. That is why `state.expanded_data` carries HTML rather than a payload — see
`MishkaDocumentWeb.Live.Admin.Dashboard.Section.Index.render_expanded_section/2`.

## Features
- `:filter` - the toolbar: Add Section, search, the archive switch, an Advanced panel, the view switch
- `:select` - per-card selection for bulk operations, with a Select all row over the list
- `:bulk_actions` - bulk actions on the selected cards
- `:paginate` - the page-size picker and numbered pages under the list
- `:expand` - the Advanced Details panel

The furniture around the cards is `MishkaCmsCoreWeb.Templates.CardChrome`, which
`MishkaDocumentWeb.Templates.IssueCard` draws from too. Pairs with
`MishkaCmsCoreWeb.UIAdapters.Admin`, which draws the archive switch, the view switch and the row
actions.

# `count`

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

One aggregate or calculation off the record, or 0 when the viewer cannot see it.

# `crumbs`

```elixir
@spec crumbs(map()) :: [String.t()]
```

The chips between "Documentation" and the section's own title — its ancestors, nearest last.

`breadcrumb_path` is a field-policy gated calculation, so it arrives as `%Ash.NotLoaded{}` for a
viewer who cannot see it; that reads as a section with no ancestors rather than taking the card down.

# `pending_drafts`

```elixir
@spec pending_drafts(map()) :: non_neg_integer()
```

How many drafts of this section are still waiting on a review — content and technical together.

Both are aggregates behind the same field policy as the calculations, so either can arrive unloaded.

# `preview`

```elixir
@spec preview(map()) :: String.t() | nil
```

The one-line taste of the section's content the card shows: its text, without its markup
(`MishkaDocument.ContentText`).

Kept to a single line by the design, so it is cut at a line's length and left for CSS to ellipsise.

# `render_bulk_actions`

# `render_empty`

# `render_error`

# `render_filters`

# `render_header`

# `render_item`

One section card.

On a narrow screen the row rewraps rather than shrinking: the checkbox and the action squares take
the first line on their own, the chips follow on the second, and the title, preview and meta run full
width underneath. Squeezing all three columns onto a phone is what pushed the last action square off
the card.

# `render_pagination`

# `render_template_switcher`

# `review`

```elixir
@spec review(atom()) :: String.t()
```

The colours a review-status badge wears, falling back to `:pending` — the attribute's default.

# `review_label`

```elixir
@spec review_label(atom()) :: String.t()
```

The words a review-status badge reads, in the viewer's language.

# `version`

```elixir
@spec version(map()) :: String.t()
```

The version a section was last changed in, falling back to the attribute's own default.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
