diff options
author | Marius Peter <marius.peter@tutanota.com> | 2025-06-29 01:03:54 +0200 |
---|---|---|
committer | Marius Peter <marius.peter@tutanota.com> | 2025-06-29 01:03:54 +0200 |
commit | 0fe1e0b999226b00a310578f4759234a88354c0a (patch) | |
tree | 6c36ca545c942bde71fbb6fd5a656d8bbcb0a5bd /lib/views.ml | |
parent | 7acf56191a2d51b9476b2d0699d783d259ef862f (diff) |
Update views.
Diffstat (limited to 'lib/views.ml')
-rw-r--r-- | lib/views.ml | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/views.ml b/lib/views.ml index 9402ad3..576fa14 100644 --- a/lib/views.ml +++ b/lib/views.ml @@ -113,16 +113,13 @@ module Repo = struct HTML.li [] [ Routes.link_to route node ] let li_of_entry repo (entry : Resolvers.Entry.t) = - let display_name = - if entry.perm = 0o040000 then entry.name ^ "/" else entry.name + let route = Routes.File (repo, entry.hash) in + let text = + txt "%s" (if entry.perm = 0o040000 then entry.name ^ "/" else entry.name) in - let route = - if entry.perm = 0o040000 then Routes.Files repo - else Routes.File (repo, entry.hash) - in - HTML.(li [] [ Routes.link_to route @@ txt "%s" display_name ]) + HTML.(li [] [ Routes.link_to route text ]) - let summary repo branches commits authors = + let summary repo branches commits = respond @@ Page.render ~page_title:(page_title repo) { @@ -177,11 +174,11 @@ module Repo = struct { title = Printf.sprintf "%s" repo; subtitle = Resolvers.repo_description repo; - topnav = Components.Topnav.(v ~active_path:Files repo); + topnav = Components.Topnav.v ~active_path:Files repo; content = HTML. [ - h3 [] [ txt "Files %s" @@ Resolvers.short_hash tree.hash ]; + h3 [] [ txt "Files at %s" tree.path ]; ul [] (List.map (li_of_entry repo) tree.entries); ]; } |