diff options
Diffstat (limited to 'lib/views.ml')
-rw-r--r-- | lib/views.ml | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/lib/views.ml b/lib/views.ml index 283d8d9..b6cf617 100644 --- a/lib/views.ml +++ b/lib/views.ml @@ -82,8 +82,10 @@ let root () = Sys.readdir config.git_project_root |> Array.to_list |> List.sort String.compare in - HTML.( - div [ id "repositories" ] [ ul [] @@ List.map Routes.li_of_repo repos ]) + let li_of_repo repo = + HTML.li [] [ Routes.link_to (Routes.Repo repo) (txt "%s" repo) ] + in + HTML.(div [ id "repositories" ] [ ul [] @@ List.map li_of_repo repos ]) in let body_data = { @@ -99,19 +101,24 @@ module Repo = struct let page_title repo = Printf.sprintf "%s — %s" repo (repo_description repo) let li_of_branch repo (branch : branch) = - HTML.(li [] [ Routes.link_to branch.name (Tag (repo, branch.name)) ]) + HTML.( + li [] [ Routes.link_to (Tag (repo, branch.name)) (txt "%s" branch.name) ]) let li_of_commit repo commit = + let open HTML in match commit.message with + | None -> li [] [ txt "%s" commit.short_hash ] | Some msg -> - HTML.( - li [] - [ - Routes.link_to - (commit.short_hash ^ " - " ^ msg) - (Commit (repo, commit.hash)); - ]) - | None -> HTML.(li [] [ txt "%s" commit.short_hash ]) + li [] + [ + Routes.link_to + (Commit (repo, commit.hash)) + (null + [ + span [ class_ "commit-hash" ] [ txt "%s" commit.short_hash ]; + txt " — %s" msg; + ]); + ] let summary repo branches commits authors = let li_of_branch = li_of_branch repo in |