MishkaCmsCoreWeb.Live.Admin.Components.ContentMediaChooser (Mishka CMS Core v0.0.1)

Copy Markdown View Source

Media Manager inside the content editor's settings (MishkaCmsCoreWeb.Live.Admin.Components.ContentComponentPicker): the pictures, or the videos, of the site the record is on, newest first, 48 at a time with Load more for the next, searchable by name, and an upload that adds a file to the site's media and picks it. At the top, All media, every folder's files are listed and the folders beside them; a folder opened lists only its own, and the folders inside it, with the way back up above.

A pick goes back to the settings that opened this as send_update(ContentComponentPicker, id: target, media: %{url: url}), and Back as media: :closed — or to the component notify names, a form's picture field (MishkaCmsCoreWeb.Live.Admin.Components.MediaField). The library is read as the signed-in user — a master's on the record's site, a site user's on their own — and an upload is the Media resource's own upload (or master_upload) action, so its checks are the library's.

Given a folder name, an upload is filed in the folder of that name at the top of the site's media, made on the first upload; without one, at the top. The author may file it elsewhere — any folder of the site, none, or a new one made there and then. library: :closed shows the upload alone, and the files only once they are asked for; back: false leaves out Back; in_form: true is for a chooser drawn inside another form, whose upload and folder controls must not be a form inside it. opened is the count of the form it is drawn in (MishkaGervaz.Form.Web.State): when it changes, the chooser starts over, closed again as its opener asks.

It is its own component because it reads its own query, in the background.