Explorer

html-ui.account-page

description
(en) The page of an account /a/<account ID>: the name (from its events) and its events (definy_list_events with accountId)
type
Fn(language: String, account_id: String, offset: Number, response: @html-ui.response) -> @definy.service-io
expression
fn(language$990, account_id$0, offset$1, response$2) =>
  let marker$3 = @core.string-join(items: [" by ", $0, " "], separator: "");
  let start$4 = @core.string-index-of(text: $2.text, target: $3, start: 0);
  let name$5 = match @core.less-than(left: $4, right: 0) {
      true =>
        "",
      false =>
        let name_start$6 = @core.plus(left: $4, right: @core.string-length(value: $3));
        let name_end$7 = @core.string-index-of(text: $2.text, target: "\n", start: $6);
        @core.string-slice(
          value: $2.text,
          start: $6,
          end: match @core.less-than(left: $7, right: 0) {
            true =>
              @core.string-length(value: $2.text),
            false =>
              $7
          }
        )
    };
  @html-ui.page(
    language: $990,
    title: match @core.equal(left: $5, right: "") {
      true =>
        @html-ui.text(language: $990, en: "Accounts", ja: "アカウント", eo: "Kontoj"),
      false =>
        $5
    },
    body: @html.concat(
      lists: [
        [
          @html.element(
            name: "nav",
            attributes: [],
            children: [
              @html.element(
                name: "a",
                attributes: [{name: "href", value: "/accounts"}],
                children: [
                  @html.text(text: @html-ui.text(language: $990, en: "Accounts", ja: "アカウント", eo: "Kontoj"))
                ]
              )
            ]
          ),
          @html.element(name: "h1", attributes: [], children: [@html.text(text: $5)]),
          @html.element(
            name: "p",
            attributes: [],
            children: [@html.element(name: "code", attributes: [], children: [@html.text(text: $0)])]
          ),
          @html.element(
            name: "h2",
            attributes: [],
            children: [@html.text(text: @html-ui.text(language: $990, en: "Events", ja: "イベント", eo: "Eventoj"))]
          )
        ],
        @html-ui.error-text(response: $2),
        @html-ui.event-lines-html(language: $990, text: $2.text),
        [
          @html-ui.events-pager(
            language: $990,
            base: @core.string-join(items: ["/a/", $0, "?"], separator: ""),
            offset: $1,
            text: $2.text
          )
        ]
      ]
    )
  )
visibility
public
html-ui.account-page (project html-ui, branch main, snapshot Daaw3vbJhY15cDW6JsA4JuXvffjj_qFyxoZQMUM8hvQ)
id: qy1j2LHoffrInnPzu_3yQZ3mci7FEiOXRjH05zewxLk
content hash: pB62eK10_Z_H3_h7OMlW-Km6_E6fu2QpsjBZ8cbr-Is