summaryrefslogtreecommitdiff
path: root/lib/views.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/views.ml')
-rw-r--r--lib/views.ml46
1 files changed, 23 insertions, 23 deletions
diff --git a/lib/views.ml b/lib/views.ml
index ccaf73b..843afdc 100644
--- a/lib/views.ml
+++ b/lib/views.ml
@@ -10,14 +10,14 @@ type body_data = {
module Components = struct
open Dream_html
- let topnav repo_path =
+ let topnav repo =
let open HTML in
- let () = Dream.log "%s" ("current path is: " ^ repo_path) in
+ let () = Dream.log "%s" ("current path is: " ^ repo) in
let li_of_a (path, text) =
let () = Dream.log "%s" ("and path is: " ^ path) in
- let is_active = String.ends_with ~suffix:path repo_path in
+ let is_active = String.ends_with ~suffix:path repo in
let attrs = if is_active then [ id "active" ] else [] in
- let url = Printf.sprintf "/%s/%s" repo_path path in
+ let url = Printf.sprintf "/%s/%s" repo path in
li attrs [ a [ href "%s" url ] [ txt text ] ]
in
nav
@@ -96,7 +96,7 @@ let root () =
Page.render body_data
module Repo = struct
- let summary repo_path branches commits authors =
+ let summary repo branches commits authors =
let open Dream_html in
let li_of_branch branch =
HTML.(li [] [ a [ href "%s" branch ] [ txt "%s" branch ] ])
@@ -129,53 +129,53 @@ module Repo = struct
in
Page.render
{
- title = repo_path;
- subtitle = Git_helpers.repo_description repo_path;
- topnav = Components.topnav repo_path;
+ title = repo;
+ subtitle = Git_helpers.repo_description repo;
+ topnav = Components.topnav repo;
content;
}
- let refs repo_path =
+ let refs repo =
let open Dream_html in
Page.render
HTML.
{
- title = repo_path;
- subtitle = Git_helpers.repo_description repo_path;
- topnav = Components.topnav repo_path;
+ title = repo;
+ subtitle = Git_helpers.repo_description repo;
+ topnav = Components.topnav repo;
content = [ null [] ];
}
- let log repo_path =
+ let log repo =
let open Dream_html in
Page.render
HTML.
{
- title = repo_path;
- subtitle = Git_helpers.repo_description repo_path;
- topnav = Components.topnav repo_path;
+ title = repo;
+ subtitle = Git_helpers.repo_description repo;
+ topnav = Components.topnav repo;
content = [ null [] ];
}
- let tree repo_path =
+ let tree repo =
let open Dream_html in
Page.render
HTML.
{
- title = repo_path;
- subtitle = Git_helpers.repo_description repo_path;
- topnav = Components.topnav repo_path;
+ title = repo;
+ subtitle = Git_helpers.repo_description repo;
+ topnav = Components.topnav repo;
content = [ null [] ];
}
- let commit repo_path (commit : Git_helpers.Commit.t) =
+ let commit repo (commit : Git_helpers.Commit.t) =
let open Dream_html in
let open Git_helpers 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
+ let title = Printf.sprintf "%s : %s" repo (short_hash commit.hash) in
Page.render
- { title; subtitle = ""; topnav = Components.topnav repo_path; content }
+ { title; subtitle = ""; topnav = Components.topnav repo; content }
end
let error_page message =
Copyright 2019--2025 Marius PETER