Explorer

html-ui.home-page

description
type
Fn(language: String, editable: Boolean, me: String, accounts: String, response: @html-ui.response) -> @definy.service-io
expression
fn(language$990, editable$2, me$3, accounts$5, response$0) =>
  @html-ui.page(
    language: $990,
    title: @html-ui.text(language: $990, en: "Projects", ja: "プロジェクト", eo: "Projektoj"),
    body: @html.concat(
      lists: [
        [
          @html.element(
            name: "h1",
            attributes: [],
            children: [
              @html.text(
                text: @html-ui.text(
                  language: $990,
                  en: "Projects and branches",
                  ja: "プロジェクトとブランチ",
                  eo: "Projektoj kaj branĉoj"
                )
              )
            ]
          )
        ],
        @html-ui.status-note(language: $990, response: $0),
        match @core.equal(left: $3, right: "") {
          true =>
            [],
          false =>
            [
              @html.element(
                name: "p",
                attributes: [{name: "class", value: "muted"}],
                children: [
                  @html.text(
                    text: @html-ui.text(
                      language: $990,
                      en: "This server signs with the account ",
                      ja: "このサーバーが署名するアカウント: ",
                      eo: "Ĉi tiu servilo subskribas per la konto "
                    )
                  ),
                  @html-ui.account-link(account_id: $3, name: @html-ui.account-name-in(accounts: $5, account_id: $3))
                ]
              )
            ]
        },
        [
          @html.element(
            name: "ul",
            attributes: [],
            children: @core.list-map(
              T: @definy.json,
              U: @html.node,
              f: fn(item$1) =>
                @html-ui.branch-item(
                  language: $990,
                  project: @html-ui.json-string(value: $1, key: "projectName"),
                  branch: @html-ui.json-string(value: $1, key: "branch"),
                  creator: @html-ui.json-string(value: $1, key: "creatorAccountId"),
                  creator_name: @html-ui.account-name-in(accounts: $5, account_id: @html-ui.json-string(value: $1, key: "creatorAccountId")),
                  count: match @definy.json-get-number(value: $1, key: "commitCount") {
                    #some(count$4) =>
                      $4,
                    #none(_) =>
                      0
                  },
                  me: $3,
                  status: @html-ui.json-string(value: $1, key: "status")
                ),
              xs: @definy.json-get-array(value: $0.json, key: "branches")
            )
          )
        ],
        match $2 {
          true =>
            @html-ui.home-tools(language: $990),
          false =>
            []
        }
      ]
    )
  )
visibility
public
html-ui.home-page (project html-ui, branch main, snapshot Daaw3vbJhY15cDW6JsA4JuXvffjj_qFyxoZQMUM8hvQ)
id: AFk3JCNvWinz7sYzDe4Dq7Dn_kwX7H5rOOE5zCWIszI
content hash: wZ2sHLkYJobj6IhggmdOc2TCBRQ6LnFa_PVycNTIGl8