{% extends "base.html" %}

{% block title %}blame {{ path }} - {{ repo }}{% endblock %}

{% block breadcrumbs %}
<ul>
  <li><a href="{{ crate::base_url() }}/">{{ crate::hostname() }}</a></li>
  <li><a href="{{ crate::base_url() }}/{{ repo }}">{{ repo }}</a></li>
  <li><a href="{{ crate::base_url() }}/{{ repo }}/commits/{{ sha }}">{{ sha[..8] }}</a></li>
  {% for crumb in breadcrumbs %}
  <li>{% if loop.last %}{{ crumb.label }}{% else %}<a href="{{ crumb.url }}">{{ crumb.label }}</a>{% endif %}</li>
  {% endfor %}
</ul>
{% endblock %}

{% block content %}
<div class="file-view">
  <div class="repo-nav">
    <a href="{{ tree_url }}" class="repo-nav-item">
      <svg class="summary-icon"><use href="#icon-file"/></svg>
      <span>File</span>
      <span class="repo-nav-item-arrow">[&gt;]</span>
    </a>
  </div>
  <div class="blame-wrap">
  <table class="blame-table">
    {% for line in lines %}
    <tr class="blame-row">
      <td class="blame-sha"><a href="{{ crate::base_url() }}/{{ repo }}/commits/{{ line.sha }}" style="color: {{ line.color }}">{{ line.short_sha }}</a></td>
      <td class="blame-linenum">{{ line.num }}</td>
      <td class="blame-code">{{ line.content }}</td>
    </tr>
    {% endfor %}
  </table>
  </div>
</div>
{% endblock %}