diff options
author | Marius Peter <marius.peter@tutanota.com> | 2025-05-29 16:30:24 +0200 |
---|---|---|
committer | Marius Peter <marius.peter@tutanota.com> | 2025-05-29 16:30:24 +0200 |
commit | 21cbcf2e8b69403f3973fa19e5e96bee5ba870b7 (patch) | |
tree | 456af4ff0f2c75fe3ce2ad9375d5ad2f96166597 /lib/views.ml | |
parent | ffae61af1a13862ffc2bf9415313f5da3d90d38e (diff) |
Start work on Trees.
Making slow but steady progress... Bulldozer mindset.
Diffstat (limited to 'lib/views.ml')
-rw-r--r-- | lib/views.ml | 16 |
1 files changed, 12 insertions, 4 deletions
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; |