jmou/cgithub
git clone https://github.com/jmou/cgithub.git
git clone git@github.com:jmou/cgithub.git
Loading…
(top)/views/_refs.eta
712 Bytes / 21 lines / 21 loc
History
View raw
<%
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>
<% } %>