<div class="preamble" id="gram-base">
  <h1>
    <a class="icon" href="https://share.operand.online/gram/#{@base |> Path.basename}/?download=tar_gz"></a>
    gram: <code>{@base |> Path.basename}</code>
  </h1>

  <%= Source.measure(@base, "README.md") |> Render.embed |> raw %>
</div>

<div class="banner">
  <div class="column">
    <h2>Logged Changes:</h2>

    <div class="banner">
      <ul class="column">
        <%= for { day, changes } <- Source.changes_by_day(@base) do %>
        <li><h3><%= day %></h3>
        <%= for [ hash, day, clock, zone, labels, message ] <- changes do %>
          <!-- <a href={"/gram/#{@base |> Path.basename}/#{node}"}> -->
          <!-- </a> -->

          <div class="gram-change" id={hash}>
              <code><%= clock %> |
              <a href={"#" <> hash}><%= hash %></a></code>
            <%= message %>
          </div>

        <% end %>
        </li>
        <% end %>
      </ul>
    </div>
  </div>

  <div class="column mx-16">
    <h2>Code Pages:</h2>
    <%= if @address do %>
      <blockquote>Searching based on: <code><%= @address %></code></blockquote>
      <a href={"/gram/#{@base}"}>clear?</a>
    <% end %>

    <ul> <%= for %Source.Node{base: base, address: node} <- Source.nodes(@base) do %>
      <li>
        <a href={"/gram/#{@base |> Path.basename}/#{node}"}><%= node %></a>
      </li>
    <% end %> </ul>
  </div>
</div>
