Login
4 branches 0 tags
Ben (Desktop/Arch) Allow for tags in issues d1f00f7 12 days ago 249 Commits
rubhub / templates / project / tree.html
{% import "macros/markdown_content.html" as md %}
<html>
  <head>
    <title>{{ owner.name }}/{{ project.name }} - {{ current_path }}</title>
  </head>

  <body>
    {% include "partials/sidebar.html" %}
    <main>
      <section>
        <div class="page-header">
          <h1 class="project-header">
            <a href="{{ owner.uri() }}">{{ owner.name }}</a> /
            <a href="{{ project.uri() }}">{{ project.name }}</a> /
            <a href="{{ project.uri_tree(selected_branch, "") }}">Code</a>
          </h1>
        </div>

        {% include "partials/project_tabs.html" %}

        <div class="card">
          {% include "partials/repo_bar.html" %}

          {% if let Some(info) = info %}
          {% include "partials/commit_bar.html" %}
          {% endif %}

          <div class="file-browser">
            {% if path_parts.len() > 0 %}
            <div class="path-breadcrumb">
              <a href="{{ project.uri_tree(&selected_branch, "") }}">{{ project.slug }}</a>
              {% for (i, part) in path_parts.iter().enumerate() %}
                {% let subpath = path_parts[..=i].join("/") %}
                / <a href="{{ project.uri_tree(&selected_branch, &subpath) }}">{{ part }}</a>
              {% endfor %}
            </div>
            {% endif %}

            {% if let Some(parent) = parent_path %}
            <div class="tree-item parent">
              <a href="{{ project.uri_tree(&selected_branch, &parent) }}">
                <span class="icon i-folder"></span>
                <span class="name">..</span>
              </a>
            </div>
            {% endif %}

            {% for entry in tree_entries %}
            <div class="tree-item {% if entry.kind == EntryKind::Tree %}directory{% else %}file{% endif %} {% if entry.filename.starts_with(".") %}dotfile{% endif %}">
              {% if entry.kind == EntryKind::Tree %}
                <a href="{{ entry.uri_tree(&owner.slug, &project.slug, &selected_branch, &current_path) }}">
                  <span class="icon i-folder"></span>
                  <span class="name">{{ entry.filename }}</span>
                </a>
              {% else %}
                <a href="{{ entry.uri_blob(&owner.slug, &project.slug, &selected_branch, &current_path) }}">
                  <span class="icon i-file"></span>
                  <span class="name">{{ entry.filename }}</span>
                </a>
              {% endif %}
            </div>
            {% endfor %}
          </div>
          <br/>

          {% match readme_html %}
          {% when Some(html) %}
              {% let fm = readme_frontmatter %}
              {{ md::render(fm, html) }}
          {% when _ %}
          {% endmatch %}
        </div>
      </section>
    </main>
  </body>

</html>