diff options
-rw-r--r-- | lib/views.ml | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/lib/views.ml b/lib/views.ml index cde27e7..3c1330e 100644 --- a/lib/views.ml +++ b/lib/views.ml @@ -93,13 +93,23 @@ let ogit_root () = in Layout.application body_data -let repo_summary repo_path ~branches ~commits = +let repo_summary repo_path branches commits = + let open Git_helpers in let open Dream_html in let li_of_branch branch = HTML.(li [] [ a [ href "%s" branch ] [ txt "%s" branch ] ]) in let li_of_commit commit = - HTML.(li [] [ a [ href "%s" commit ] [ txt "%s" commit ] ]) + match commit.message with + | Some msg -> + HTML.( + li [] + [ + a + [ href "commit/?id=%s" commit.hash ] + [ txt "%s %s" (short_hash commit.hash) msg ]; + ]) + | None -> HTML.(li [] [ a [ href "" ] [ txt "caca!!" ] ]) in let content = HTML. @@ -113,7 +123,21 @@ let repo_summary repo_path ~branches ~commits = Layout.application { title = repo_path; - subtitle = "Macaroniii"; + subtitle = repo_description repo_path; + topnav = Components.topnav repo_path ""; + content; + } + +let repo_commit repo_path commit = + let open Git_helpers in + let open Dream_html in + let message = match commit.message with Some msg -> msg | None -> "" in + let content = HTML.[ h3 [] [ txt "%s" message ] ] in + let title = Printf.sprintf "%s : %s" repo_path (short_hash commit.hash) in + Layout.application + { + title; + subtitle = ""; topnav = Components.topnav repo_path ""; content; } |