Added repo_commit view.

Commit
2f57633bdf9f6d36a554cc4c9105e7c26f548f67
Author
Marius Peter <marius.peter@tutanota.com>
Author date
Committer
Marius Peter <marius.peter@tutanota.com>
Committer date
lib/views.ml
index cde27e7e..3c1330ef 100644..100644
@@ -93,13 +93,23 @@
93 93 in
94 94 Layout.application body_data
95 95
96 Removed: let repo_summary repo_path ~branches ~commits =
96 Added: let repo_summary repo_path branches commits =
97 Added: let open Git_helpers in
97 98 let open Dream_html in
98 99 let li_of_branch branch =
99 100 HTML.(li [] [ a [ href "%s" branch ] [ txt "%s" branch ] ])
100 101 in
101 102 let li_of_commit commit =
102 Removed: HTML.(li [] [ a [ href "%s" commit ] [ txt "%s" commit ] ])
103 Added: match commit.message with
104 Added: | Some msg ->
105 Added: HTML.(
106 Added: li []
107 Added: [
108 Added: a
109 Added: [ href "commit/?id=%s" commit.hash ]
110 Added: [ txt "%s %s" (short_hash commit.hash) msg ];
111 Added: ])
112 Added: | None -> HTML.(li [] [ a [ href "" ] [ txt "caca!!" ] ])
103 113 in
104 114 let content =
105 115 HTML.
@@ -113,7 +123,21 @@
113 123 Layout.application
114 124 {
115 125 title = repo_path;
116 Removed: subtitle = "Macaroniii";
126 Added: subtitle = repo_description repo_path;
127 Added: topnav = Components.topnav repo_path "";
128 Added: content;
129 Added: }
130 Added:
131 Added: let repo_commit repo_path commit =
132 Added: let open Git_helpers in
133 Added: let open Dream_html in
134 Added: let message = match commit.message with Some msg -> msg | None -> "" in
135 Added: let content = HTML.[ h3 [] [ txt "%s" message ] ] in
136 Added: let title = Printf.sprintf "%s : %s" repo_path (short_hash commit.hash) in
137 Added: Layout.application
138 Added: {
139 Added: title;
140 Added: subtitle = "";
117 141 topnav = Components.topnav repo_path "";
118 142 content;
119 143 }