Edit

kmx.io/kmxgit/lib/kmxgit_web/templates/repository/log.html.heex

Branch :

  • lib/kmxgit_web/templates/repository/log.html.heex
  • <div class="container-fluid">
    
      <div class="row">
        <div class="col">
          <%= render("show_title.html", assigns) %>
        </div>
      </div>
    
      <div class="row">
        <div class="col">
          <%= if @path do %>
            <hr/>
            <h2><%= link @path, to: Routes.repository_path(@conn, :show, Repository.owner_slug(@repo), Repository.splat(@repo, ["_tree", @tree] ++ String.split(@path, "/"))) %></h2>
          <% end %>
    
          <%= render("show_branch.html", assigns) %>
    
          <hr/>
          <h3><%= gettext("Log") %></h3>
    
          <table class="git-log table">
            <thead>
              <tr>
                <th class="author"><%= gettext "Author" %></th>
                <th class="commit"><%= gettext "Commit" %></th>
                <th class="date"><%= gettext "Date" %></th>
                <th class="ci"><%= gettext "CI" %></th>
                <th class="message"><%= gettext "Message" %></th>
              </tr>
            </thead>
            <tbody>
              <%= for commit <- @log do %>
                <tr class="commit">
                  <td class="author">
                    <%= render(KmxgitWeb.UserView, "avatar.html", conn: @conn, user: Map.get(@git.users_by_email, commit.author_email), email: commit.author_email, size: 48, title: commit.author, class: "") %>
                  </td>
                  <td class="hash">
                    <%= link String.slice(commit.hash, 0..7), id: commit.hash, to: Routes.repository_path(@conn, :show, Repository.owner_slug(@repo), Repository.splat(@repo, ["_commit", commit.hash])) %>
                  </td>
                  <td class="date">
                    <%= NaiveDateTime.add(~N[1970-01-01 00:00:00], commit.date) %>
                  </td>
                  <td class="ci">
                    <%= if File.exists?("priv/ci/#{Repository.full_slug(@repo)}/ci/log/rbpkg_ci.#{@repo.slug}.commit_#{commit.hash}.html") do %>
                      <% ci_status_path = Routes.repository_path(@conn, :show, Repository.owner_slug(@repo), Repository.splat(@repo, ["_ci", "ci", "log", "rbpkg_ci.#{@repo.slug}.commit_#{commit.hash}.html"])) %>
                      <%= link to: ci_status_path do %>
                        <img src={"/_images/status_#{commit.ci_status}.32.png"} alt={commit.ci_status} class={"status-#{commit.ci_status}"} />
                      <% end %>
                    <% end %>
                  </td>
                  <td class="message" %>
                    <%= commit.message %>
                  </td>
                </tr>
              <% end %>
            </tbody>
          </table>
        </div>
      </div>
    </div>