summaryrefslogtreecommitdiff
path: root/cgithub/views/_tree.eta
blob: d0c34537bf73db72c13b430f6f49d55bb98759e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<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)) { %>
    <div class="overview box">
      <header><%= filename %></header>
      <%~ html %>
    </div>
  <% } %>
<% } %>