diff options
| author | Joe Mou <dev@mou.fo> | 2026-09-18 07:27:21 +0100 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-09-18 07:27:21 +0100 |
| commit | 9659525bf2387af6deab9d401784b94b1f44d395 (patch) | |
| tree | c67dc1dd05bf2a8fa48dc123d6353d255a658ef1 /cgithub/views/_tree.eta | |
| parent | 9819d8e5504d6f03d27ec6b8786eec8fe5a752a5 (diff) | |
| parent | 01494e6fa1345a509560e5e19a7f08cb2aac5cc8 (diff) | |
Diffstat (limited to 'cgithub/views/_tree.eta')
| -rw-r--r-- | cgithub/views/_tree.eta | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/cgithub/views/_tree.eta b/cgithub/views/_tree.eta new file mode 100644 index 0000000..a3c943d --- /dev/null +++ b/cgithub/views/_tree.eta @@ -0,0 +1,38 @@ +<%~ include("./_nav.eta", {...it, view: "tree"}) %> + +<% const commitPath = it.path && it.path !== "/" ? it.path : ""; %> +<div class="placeholder commit box" data-src="/api/<%= it.repo.owner %>/<%= it.repo.name %>/latest-commit/<%= it.branch %>/<%= commitPath %>"> + <div> + <div>…</div> + <div class="commit-author">…</div> + </div> +</div> + +<table> + <% for (const item of it.items) { %> + <tr> + <td> + <% if (item.contentType === 'directory') { %> + <img src="/static/icons/folder-simple.svg" alt="tree" class="icon"> + <a href="/<%= it.repo.owner %>/<%= it.repo.name %>/tree/<%= it.branch %>/<%= item.path %>"><%= item.name %>/</a> + <% } else { %> + <img src="/static/icons/file.svg" alt="blob" class="icon"> + <a href="/<%= it.repo.owner %>/<%= it.repo.name %>/blob/<%= it.branch %>/<%= item.path %>"><%= item.name %></a> + <% } %> + </td> + </tr> + <% } %> +</table> + +<% if (it.overviewHtml) { %> + <% for (const [filename, html] of Object.entries(it.overviewHtml)) { %> + <% if (html !== null) { %> + <div class="overview box"> + <header><%= filename %></header> + <%~ html %> + </div> + <% } else { %> + <!-- No rendered content for <%= filename %> --> + <% } %> + <% } %> +<% } %> |
