From 21cbcf2e8b69403f3973fa19e5e96bee5ba870b7 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Thu, 29 May 2025 16:30:24 +0200 Subject: Start work on Trees. Making slow but steady progress... Bulldozer mindset. --- lib/views.ml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'lib/views.ml') diff --git a/lib/views.ml b/lib/views.ml index 33654ea..283d8d9 100644 --- a/lib/views.ml +++ b/lib/views.ml @@ -98,7 +98,7 @@ let root () = module Repo = struct let page_title repo = Printf.sprintf "%s — %s" repo (repo_description repo) - let li_of_branch repo branch = + let li_of_branch repo (branch : branch) = HTML.(li [] [ Routes.link_to branch.name (Tag (repo, branch.name)) ]) let li_of_commit repo commit = @@ -163,11 +163,19 @@ module Repo = struct content; } - let tree repo = - let content = HTML.[ null [] ] in + let tree repo tree = + let title = Printf.sprintf "%s : %s" repo tree.short_hash in + let li_of_entry entry = HTML.(li [] [ txt "%s" entry.name ]) in + let content = + HTML. + [ + h3 [] [ txt "Tree %s" tree.short_hash ]; + ul [] (List.map li_of_entry tree.entries); + ] + in Page.render ~page_title:(page_title repo) { - title = repo; + title; subtitle = repo_description repo; topnav = Components.topnav repo; content; -- cgit v1.2.3