Update handlers.

Commit
df57135697ecec1f940f4ce212267814438e0ad7
Author
Marius Peter <marius.peter@tutanota.com>
Author date
Committer
Marius Peter <marius.peter@tutanota.com>
Committer date
lib/handlers/handlers.ml
index 7142439f..564d5636 100644..100644
@@ -1,43 +1,13 @@
1 Removed: (* Page layout function *)
2 Removed: let page_layout ~content =
3 Removed: "<html><body>"
4 Removed: ^ Layouts.Header.header ()
5 Removed: ^ Layouts.Topnav.topnav ()
6 Removed: ^ "<main>" ^ content ^ "</main>"
7 Removed: ^ "</body></html>"
1 Added: let ogit_root _ = Dream_html.respond @@ Views.Ogit_root.render ()
2 Added: let repo_root repo = Dream_html.respond @@ Views.Repo.render repo
8 3
9 Removed: let root _ =
10 Removed: let content =
11 Removed: "<h1>Available Repositories</h1><ul>"
12 Removed: ^ Helpers.Html_helpers.generate_repo_links ()
13 Removed: ^ "</ul>"
14 Removed: in
15 Removed: Dream.html (page_layout ~content)
16 Removed:
17 Removed: let repo_root _ =
18 Removed: (* let repo_name = Dream.param request "repo_name" in *)
19 Removed: let content =
20 Removed: "<div class=\"content\"><table summary=\"repository info\" class=\"list nowrap\"><tbody>\n"
21 Removed: ^ "<tr class=\"nohover\"><th class=\"left\">Branch</th><th class=\"left\">Commit message</th><th class=\"left\">Author</th><th class=\"left\" colspan=\"2\">Age</th></tr>\n"
22 Removed: ^ "<tr><td><a href=\"/wtt.git/log/\">master</a></td><td><a href=\"/wtt.git/commit/\">Ensure session[:id] before scoring: all tests now pass.</a></td><td>Marius Peter</td><td colspan=\"2\"><span class=\"age-weeks\" title=\"2025-01-02 19:11:34 +0100\">2 weeks</span></td></tr>\n"
23 Removed: ^ "<tr class=\"nohover\"><td colspan=\"3\">&nbsp;</td></tr>\n"
24 Removed: ^ "<tr class=\"nohover\"><th class=\"left\">Tag</th><th class=\"left\">Download</th><th class=\"left\">Author</th><th class=\"left\" colspan=\"2\">Age</th></tr>\n"
25 Removed: ^ "<tr><td><a href=\"/wtt.git/tag/?h=v1.0\">v1.0</a></td><td><a href=\"/wtt.git/commit/?id=175111f9d84354dce00503525649197e9acb6382\">commit 175111f9d8...</a></td><td>Marius Peter</td><td colspan=\"2\"><span class=\"age-weeks\" title=\"2025-01-02 13:58:46 +0100\">2 weeks</span></td></tr>\n"
26 Removed: ^ "<tr class=\"nohover\"><td colspan=\"3\">&nbsp;</td></tr>\n"
27 Removed: ^ "<tr class=\"nohover\"><th class=\"left\">Age</th><th class=\"left\">Commit message</th><th class=\"left\">Author</th></tr>\n"
28 Removed: ^ "<tr><td><span title=\"2025-01-02 19:11:34 +0100\">2025-01-02</span></td><td><a href=\"/wtt.git/commit/?id=b34d2b51174b511d59fa324d9f42abc75a1fa09a\">Ensure session[:id] before scoring: all tests now pass.</a><span class=\"decoration\"><a class=\"deco\" href=\"/wtt.git/commit/?id=b34d2b51174b511d59fa324d9f42abc75a1fa09a\">HEAD</a><a class=\"branch-deco\" href=\"/wtt.git/log/\">master</a></span></td><td>Marius Peter</td></tr>\n"
29 Removed: ^ "</tbody></table></div>"
30 Removed: in
31 Removed: Dream.html (page_layout ~content)
32 Removed:
33 Removed: let repo_tree request =
34 Removed: let repo_name = Dream.param request "repo_name" in
35 Removed: let repo_path = Filename.concat (Unix.getenv "HOME") ("git/" ^ repo_name) in
36 Removed: let content =
37 Removed: if Sys.file_exists repo_path && Sys.is_directory repo_path then
38 Removed: let files = Helpers.File_helpers.list_files repo_path in
39 Removed: "<h1>Browsing repository: " ^ repo_name ^ "</h1><ul>" ^ files ^ "</ul>"
40 Removed: else
41 Removed: "<h1>Repository not found: " ^ repo_name ^ "</h1>"
42 Removed: in
43 Removed: Dream.html (page_layout ~content)
4 Added: (* let repo_tree request = *)
5 Added: (* let repo_name = Dream.param request "repo_name" in *)
6 Added: (* let repo_path = Filename.concat (Unix.getenv "HOME") ("git/" ^ repo_name) in *)
7 Added: (* let content = *)
8 Added: (* if Sys.file_exists repo_path && Sys.is_directory repo_path then *)
9 Added: (* let files = Helpers.File_helpers.list_files repo_path in *)
10 Added: (* "<h1>Browsing repository: " ^ repo_name ^ "</h1><ul>" ^ files ^ "</ul>" *)
11 Added: (* else "<h1>Repository not found: " ^ repo_name ^ "</h1>" *)
12 Added: (* in *)
13 Added: (* Dream.html (page_layout ~content) *)