implemented 08-web-ui.md: added Thymeleaf-based web UI: templates for builds, artifacts, current builds, and fragments; static assets for favicon, CSS, and JavaScript

This commit is contained in:
Michael Hoennig
2026-07-07 12:23:12 +02:00
parent 490914de0b
commit 25a0742a58
22 changed files with 1420 additions and 16 deletions
@@ -0,0 +1,35 @@
package de.hoennig.gittally.server
import de.hoennig.gittally.config.GiteaConfig
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import java.time.Duration
class UiViewsTest : FunSpec() {
init {
test("durations format as m:ss and h:mm:ss like the legacy duration column") {
UiFormats.duration(null) shouldBe ""
UiFormats.duration(Duration.ofSeconds(0)) shouldBe "0:00"
UiFormats.duration(Duration.ofSeconds(83)) shouldBe "1:23"
UiFormats.duration(Duration.ofSeconds(3600 + 62)) shouldBe "1:01:02"
}
test("Gitea web links escape branch segments but keep slashes") {
val links =
GiteaWebLinks(GiteaConfig(baseUrl = "https://git.example.org/", owner = "acme", repo = "widget"))
links.repoUrl shouldBe "https://git.example.org/acme/widget"
links.branchUrl("feature/some topic") shouldBe
"https://git.example.org/acme/widget/src/branch/feature/some%20topic"
links.commitUrl("0123abc") shouldBe "https://git.example.org/acme/widget/commit/0123abc"
}
test("Gitea web links are null when Gitea is not configured") {
val links = GiteaWebLinks(GiteaConfig())
links.repoUrl shouldBe null
links.branchUrl("main") shouldBe null
links.commitUrl("0123abc") shouldBe null
}
}
}