Explorer

html-ui.events-pager

description
(en) Links to the newer and older 50 events (base is the URL up to the ? or & before offset=)
type
Fn(language: String, base: String, offset: Number, text: String) -> @html.node
expression
fn(language$990, base$0, offset$1, text$2) =>
  let count$3 = @core.minus(left: @core.list-length(value: @core.string-split(text: $2, separator: "\nEvent ")), right: 1);
  @html.element(
    name: "p",
    attributes: [],
    children: @core.list-concat(
      left: match @core.less-than(left: 0, right: $1) {
        true =>
          [
            @html.element(
              name: "a",
              attributes: [
                {
                  name: "href",
                  value: @core.string-join(
                    items: [$0, "offset=", @std.number-to-string(value: @std.max(a: 0, b: @core.minus(left: $1, right: 50)))],
                    separator: ""
                  )
                }
              ],
              children: [
                @html.text(text: @html-ui.text(language: $990, en: "Newer 50", ja: "新しい 50 件", eo: "50 pli novaj"))
              ]
            ),
            @html.text(text: " ")
          ],
        false =>
          []
      },
      right: match @core.less-than(left: $3, right: 50) {
        true =>
          [],
        false =>
          [
            @html.element(
              name: "a",
              attributes: [
                {
                  name: "href",
                  value: @core.string-join(
                    items: [$0, "offset=", @std.number-to-string(value: @core.plus(left: $1, right: 50))],
                    separator: ""
                  )
                }
              ],
              children: [
                @html.text(text: @html-ui.text(language: $990, en: "Older 50", ja: "古い 50 件", eo: "50 pli malnovaj"))
              ]
            )
          ]
      }
    )
  )
visibility
public
html-ui.events-pager (project html-ui, branch main, snapshot Daaw3vbJhY15cDW6JsA4JuXvffjj_qFyxoZQMUM8hvQ)
id: wiPAIwe0brhKUYQgT6mwMfA6-E-U77fzS4AH5Q3slag
content hash: 7n8ZrHeBX-HxM1bI0GQ_dCPWuWeA-qIoE-CFK_SuPkM