[OCaml] Mobile-friendly clone of cgit.
feat show collapsible directory tree on summary page
The summary page now displays the root tree with the same fold-out directory hierarchy as the files view, followed by the latest commits. Subdirectories collapse/expand with the same chevron + details pattern used elsewhere.
Changed files
lib/handlers.ml
@@ -74,10 +74,12 @@
74
74
handler repository context id)
75
75
76
76
let summary config repository context =
77
Added:
let* tree = Resolvers.Tree.head repository in
78
Added:
let* preloaded = Resolvers.Tree.preload repository tree in
77
79
let* commits =
78
80
Resolvers.Commit.recent repository config.Config.commits_max_displayed
79
81
in
80
Removed:
Views.Repo.summary context commits
82
Added:
Views.Repo.summary context preloaded commits
81
83
82
84
let commit_matches ?filter_type ?author ?committer
83
85
(commit : Resolvers.Commit.t) =
lib/views/repo.ml
@@ -501,7 +501,7 @@
501
501
];
502
502
])
503
503
504
Removed:
let summary context commits =
504
Added:
let summary context (entries : Resolvers.Tree.preloaded_entry list) commits =
505
505
let description_section =
506
506
if context.description = "" then HTML.null []
507
507
else HTML.(p [] [ txt "%s" context.description ])
@@ -510,6 +510,7 @@
510
510
HTML.
511
511
[
512
512
description_section;
513
Added:
ul [] (List.map (li_of_preloaded context.repo) entries);
513
514
h3 [] [ txt "Latest commits" ];
514
515
ul [] (List.map (li_of_commit context.repo) commits);
515
516
]