Explorer

html-ui.history-page

description
(en) The snapshot history page of a branch (definy_get_history)
type
Fn(language: String, project: String, branch: String, limit: Number, response: @html-ui.response) -> @definy.service-io
expression
fn(language$990, project$0, branch$1, limit$2, response$3) =>
  @html-ui.page(
    language: $990,
    title: @core.string-join(
      items: [@html-ui.text(language: $990, en: "History - ", ja: "履歴 - ", eo: "Historio - "), $0],
      separator: ""
    ),
    body: @html.concat(
      lists: [
        [
          @html-ui.breadcrumb(language: $990, project: $0, branch: $1),
          @html.element(
            name: "h1",
            attributes: [],
            children: [
              @html.text(
                text: @html-ui.text(
                  language: $990,
                  en: "Snapshot history",
                  ja: "スナップショット履歴",
                  eo: "Historio de momentfotoj"
                )
              )
            ]
          )
        ],
        @html-ui.status-note(language: $990, response: $3),
        [
          @html.element(
            name: "div",
            attributes: [{name: "class", value: "history"}],
            children: @core.list-fold(
              T: String,
              A: Record{commit: String, out: List<@html.node>},
              reducer: fn(acc$5, item$4) =>
                let commit$6 = match @std.string-starts-with(value: $4, prefix: "Snapshot ") {
                    true =>
                      @html-ui.segment(segments: @core.string-split(text: $4, separator: " "), index: 1),
                    false =>
                      $5.commit
                  };
                {
                  commit: $6,
                  out: @core.list-concat(
                    left: $5.out,
                    right: @html-ui.history-line(language: $990, project: $0, branch: $1, limit: $2, commit: $6, line: $4)
                  )
                },
              init: {commit: "", out: []},
              xs: @core.string-split(text: $3.text, separator: "\n")
            ).out
          ),
          @html.element(
            name: "script",
            attributes: [],
            children: [
              @html.text(
                text: "for(const e of document.querySelectorAll('[data-ms]'))e.textContent=new Date(+e.dataset.ms).toLocaleString()"
              )
            ]
          )
        ]
      ]
    )
  )
visibility
public
html-ui.history-page (project html-ui, branch main, snapshot Daaw3vbJhY15cDW6JsA4JuXvffjj_qFyxoZQMUM8hvQ)
id: fJjxOxs94nV6yF-7mJ7FJ6S4GfHYZwoVfDAg7lDlQm8
content hash: pHtByiZg5rKB9PCXkKcH8i56ddrjtXQROr10HJ2wvWc