Explorer

html-ui.account-line-html

description
(en) The HTML of a line of definy_list_accounts
type
Fn(language: String, line: String) -> List<@html.node>
expression
fn(language$990, line$0) =>
  match @std.string-starts-with(value: $0, prefix: "Account ") {
    true =>
      let account$1 = @html-ui.segment(segments: @core.string-split(text: $0, separator: " "), index: 1);
      [
        @html.element(
          name: "div",
          attributes: [{name: "class", value: "snapshot-head"}],
          children: [
            @html-ui.account-link(
              account_id: $1,
              name: @core.string-slice(
                value: $0,
                start: @core.plus(left: @core.string-length(value: $1), right: 9),
                end: @core.string-length(value: $0)
              )
            ),
            @html.text(text: " "),
            @html.element(name: "code", attributes: [{name: "class", value: "muted"}], children: [@html.text(text: $1)])
          ]
        )
      ],
    false =>
      match @std.string-starts-with(value: $0, prefix: "  events: ") {
        true =>
          [
            @html.element(
              name: "div",
              attributes: [{name: "class", value: "message"}],
              children: [
                @html.text(text: @html-ui.text(language: $990, en: "Events: ", ja: "イベント ", eo: "Eventoj: ")),
                @html.text(text: @html-ui.after-prefix(line: $0, prefix: "  events: ")),
                @html.text(text: @html-ui.text(language: $990, en: "", ja: " 件", eo: ""))
              ]
            )
          ],
        false =>
          match @std.string-starts-with(value: $0, prefix: "  first: ") {
            true =>
              [
                @html.element(
                  name: "div",
                  attributes: [{name: "class", value: "message"}],
                  children: [
                    @html.element(
                      name: "span",
                      attributes: [{name: "class", value: "muted"}],
                      children: [@html.text(text: @html-ui.text(language: $990, en: "First", ja: "最初", eo: "Unua"))]
                    ),
                    @html.text(text: " "),
                    @html-ui.time-span(ms: @html-ui.after-prefix(line: $0, prefix: "  first: "))
                  ]
                )
              ],
            false =>
              match @std.string-starts-with(value: $0, prefix: "  last: ") {
                true =>
                  [
                    @html.element(
                      name: "div",
                      attributes: [{name: "class", value: "message"}],
                      children: [
                        @html.element(
                          name: "span",
                          attributes: [{name: "class", value: "muted"}],
                          children: [@html.text(text: @html-ui.text(language: $990, en: "Last", ja: "最後", eo: "Lasta"))]
                        ),
                        @html.text(text: " "),
                        @html-ui.time-span(ms: @html-ui.after-prefix(line: $0, prefix: "  last: "))
                      ]
                    )
                  ],
                false =>
                  []
              }
          }
      }
  }
visibility
public
html-ui.account-line-html (project html-ui, branch main, snapshot Daaw3vbJhY15cDW6JsA4JuXvffjj_qFyxoZQMUM8hvQ)
id: RTivyzrCjuQrTFbLd1AaGF_Qko3FSWjGyxh5rDvnNCI
content hash: hBQMPPbzZR4OTbO890TAvbf0FhpIibuSMsBRSCNiV-s