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/_refs.eta | |
| parent | 9819d8e5504d6f03d27ec6b8786eec8fe5a752a5 (diff) | |
| parent | 01494e6fa1345a509560e5e19a7f08cb2aac5cc8 (diff) | |
Diffstat (limited to 'cgithub/views/_refs.eta')
| -rw-r--r-- | cgithub/views/_refs.eta | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cgithub/views/_refs.eta b/cgithub/views/_refs.eta new file mode 100644 index 0000000..9d951cc --- /dev/null +++ b/cgithub/views/_refs.eta @@ -0,0 +1,21 @@ +<% +const linkPrefix = `/${it.repo.owner}/${it.repo.name}/${it.view}/`; +const linkSuffix = it.path ? `/${it.path}` : ""; +%> +<% if (it.refs.length === 0) { %> + <div class="ref-selector-empty">No <%= it.type %> found.</div> +<% } else { %> + <ul class="ref-selector-items"> + <% for (const ref of it.refs) { %> + <li> + <a href="<%= linkPrefix %><%= ref.name %><%= linkSuffix %>"><%= ref.name %></a> + <% if (ref.isDefault) { %><span class="ref-selector-badge">default</span><% } %> + </li> + <% } %> + </ul> +<% } %> +<% if (it.hasMore) { %> + <div class="ref-selector-more"> + <a href="/<%= it.repo.owner %>/<%= it.repo.name %>/<%= it.type %>">View all <%= it.type %></a> + </div> +<% } %> |
