aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2026-01-25 16:27:48 -0500
committerJoe Mou <dev@mou.fo>2026-01-25 17:46:15 -0500
commit7132094f28ca2dc08c32f207ade9c63a28952115 (patch)
tree103f64b974ea709e810832dcce5c0625ff55bc1c /views
parent27588cba68a2594da8a41d8d3ebaecaadb3ab2f2 (diff)
Repository page with info
Diffstat (limited to 'views')
-rw-r--r--views/_tree.eta14
-rw-r--r--views/repo.eta23
-rw-r--r--views/tree.eta15
3 files changed, 38 insertions, 14 deletions
diff --git a/views/_tree.eta b/views/_tree.eta
new file mode 100644
index 0000000..ac7b2b1
--- /dev/null
+++ b/views/_tree.eta
@@ -0,0 +1,14 @@
+<table>
+ <% for (const item of it.items) { %>
+ <tr>
+ <td>
+ <span class="icon"><%= item.contentType === 'directory' ? '📁' : '📄' %></span>
+ <% if (item.contentType === 'directory') { %>
+ <a href="/<%= it.repo.owner %>/<%= it.repo.name %>/tree/<%= it.branch %>/<%= item.path %>"><%= item.name %></a>
+ <% } else { %>
+ <a href="/<%= it.repo.owner %>/<%= it.repo.name %>/blob/<%= it.branch %>/<%= item.path %>"><%= item.name %></a>
+ <% } %>
+ </td>
+ </tr>
+ <% } %>
+</table>
diff --git a/views/repo.eta b/views/repo.eta
new file mode 100644
index 0000000..0b345df
--- /dev/null
+++ b/views/repo.eta
@@ -0,0 +1,23 @@
+<% layout("./layout") %>
+
+<% if (it.info) { %>
+ <div class="repo-info">
+ <% if (it.info.description) { %>
+ <div class="description"><%= it.info.description %></div>
+ <% } %>
+ <% if (it.info.website) { %>
+ <div><a href="<%= it.info.website %>" rel="noopener noreferrer"><%= it.info.website %></a></div>
+ <% } %>
+ <% if (it.info.stars) { %>
+ <span>★ <%= it.info.stars %></span>
+ <% } %>
+ <% if (it.info.watchers) { %>
+ <span>👁 <%= it.info.watchers %></span>
+ <% } %>
+ <% if (it.info.forks) { %>
+ <span>🔀 <%= it.info.forks %></span>
+ <% } %>
+ </div>
+<% } %>
+
+<%~ include("./_tree", it) %>
diff --git a/views/tree.eta b/views/tree.eta
index 911b7ee..7068754 100644
--- a/views/tree.eta
+++ b/views/tree.eta
@@ -1,16 +1,3 @@
<% layout("./layout") %>
-<table>
- <% for (const item of it.items) { %>
- <tr>
- <td>
- <span class="icon"><%= item.contentType === 'directory' ? '📁' : '📄' %></span>
- <% if (item.contentType === 'directory') { %>
- <a href="/<%= it.repo.owner %>/<%= it.repo.name %>/tree/<%= it.branch %>/<%= item.path %>"><%= item.name %></a>
- <% } else { %>
- <a href="/<%= it.repo.owner %>/<%= it.repo.name %>/blob/<%= it.branch %>/<%= item.path %>"><%= item.name %></a>
- <% } %>
- </td>
- </tr>
- <% } %>
-</table>
+<%~ include("./_tree", it) %>