<!DOCTYPE html>
<html lang='en' data-theme="light">
  <head>
    <title>Index of <%= base_uri %></title>

    <meta charset='utf-8'>
    <meta name="viewport" content="width=device-width, initial-scale=1" >

    <link href='/heel_css/pico.min.css' rel='stylesheet' type='text/css'>
  </head>
  <body>
    <main class="container">
      <h1>Index of: <%= base_uri %></h1>

      <figure>
        <table>
          <thead>
            <tr>
              <th>Name</th>
              <th>Last Modified</th>
              <th>Size</th>
              <th>Type</th>
            </tr>
          </thead>

          <tbody>
            <% entries.each do |entry| %>
              <tr>
                <td>
                  <a href="<%= "#{base_uri.chomp('/')}/#{entry.link}" %>">
                    <% if entry.icon_url then %>
                      <img src="<%= entry.icon_url %>" width="32" height="32" alt="icon for type <%= entry.content_type %>">
                    <% end %>
                    <%= entry.name %>
                  </a>
                  <% if highlighting? && (entry.content_type != 'Directory') then %>
                    (<a download="<%= entry.name %>" href="<%= "#{base_uri.chomp('/')}/#{entry.link}?highlighting=false" %>">download</a>)
                  <% end %>
                </td>
                <td><%= entry.last_modified %></td>
                <td class="<%= entry.content_type == "Directory" ? 'c' : 'n' %>" ><%= entry.size %></td>
                <td><%= entry.content_type %></td>
              </tr>
            <% end %>
          </tbody>

          <tfoot>
            <tr>
              <th>Name</th>
              <th>Last Modified</th>
              <th>Size</th>
              <th>Type</th>
            </tr>
          </tfoot>
        </table>
      </figure>

      <footer class="container">
        <hr>
        <p>
          <small><a href="<%= homepage %>" target="_blank">heel</a> v<%= Heel::VERSION %></small>
        </p>
      </footer>
    </main>
  </body>
</html>
