Sam Jeston
History
88 lines·
5.7 KB
·HTML
| 1 | {% extends "layout_repo.html" %} |
| 2 | {% block page_title %}{% if !view.path.is_empty() %}{{ view.path }} at {{ view.refname }} · {% endif %}{% endblock %} |
| 3 | {% block content %} |
| 4 | {% let base = r.base() %} |
| 5 | {% if let Some((branch, pushed)) = view.recent_branch %} |
| 6 | <div class="banner"> |
| 7 | <span>{{ crate::web::fmt::icon("git-branch")|safe }} <strong>{{ branch }}</strong> had recent pushes <time>{{ crate::web::fmt::ago(pushed) }}</time></span> |
| 8 | <a class="btn btn-sm btn-success" href="{{ base }}/compare/{{ crate::web::fmt::urlpath(r.repo.default_branch) }}...{{ crate::web::fmt::urlpath(branch) }}">Compare & pull request</a> |
| 9 | </div> |
| 10 | {% endif %} |
| 11 | <div class="{% if is_root %}layout-repo{% else %}layout-full{% endif %}"> |
| 12 | <div class="repo-main"> |
| 13 | <div class="code-toolbar"> |
| 14 | {% let refsel = view.refsel %} |
| 15 | {% include "partials/refsel.html" %} |
| 16 | {% if is_root %} |
| 17 | <a class="toolbar-link" href="{{ base }}/branches">{{ crate::web::fmt::icon("git-branch")|safe }} <strong>{{ view.branch_count }}</strong> {% if view.branch_count == 1 %}branch{% else %}branches{% endif %}</a> |
| 18 | <a class="toolbar-link" href="{{ base }}/tags">{{ crate::web::fmt::icon("tag")|safe }} <strong>{{ view.tag_count }}</strong> {% if view.tag_count == 1 %}tag{% else %}tags{% endif %}</a> |
| 19 | {% else %} |
| 20 | <nav class="breadcrumbs" aria-label="Path"> |
| 21 | <a href="{{ base }}/tree/{{ crate::web::fmt::urlpath(view.refname) }}"><strong>{{ r.repo.name }}</strong></a> |
| 22 | {% for c in view.crumbs %}<span class="crumb-sep">/</span>{% if loop.last %}<strong>{{ c.name }}</strong>{% else %}<a href="{{ c.href }}">{{ c.name }}</a>{% endif %}{% endfor %} |
| 23 | </nav> |
| 24 | {% endif %} |
| 25 | <span class="toolbar-spacer"></span> |
| 26 | {% if is_root %}{% include "partials/clone.html" %}{% endif %} |
| 27 | </div> |
| 28 | <div class="box file-browser"> |
| 29 | {% if let Some(c) = view.latest %} |
| 30 | <div class="box-header latest-commit"> |
| 31 | {{ crate::web::fmt::avatar(c.author_name, 22)|safe }} |
| 32 | <strong class="latest-author">{{ c.author_name }}</strong> |
| 33 | <a class="latest-message truncate" href="{{ base }}/commit/{{ c.id }}" title="{{ c.summary }}">{{ c.summary }}</a> |
| 34 | <span class="latest-meta"> |
| 35 | <a class="text-mono text-muted" href="{{ base }}/commit/{{ c.id }}">{{ c.short_id }}</a> |
| 36 | <span class="dot">·</span> |
| 37 | <time title="{{ crate::web::fmt::datetime_full(c.committer_time) }}">{{ crate::web::fmt::ago(c.committer_time) }}</time> |
| 38 | </span> |
| 39 | <a class="history-link" href="{{ view.history_href }}">{{ crate::web::fmt::icon("history")|safe }}{% if is_root %} <strong>{{ view.commit_count }}</strong> {% if view.commit_count == 1 %}commit{% else %}commits{% endif %}{% else %} History{% endif %}</a> |
| 40 | </div> |
| 41 | {% endif %} |
| 42 | <table class="files"> |
| 43 | <tbody> |
| 44 | {% if let Some(up) = view.parent_href %} |
| 45 | <tr><td class="file-icon"></td><td class="file-name" colspan="3"><a href="{{ up }}" title="Up one level">..</a></td></tr> |
| 46 | {% endif %} |
| 47 | {% for row in view.entries %} |
| 48 | <tr> |
| 49 | <td class="file-icon{% if row.entry.is_dir() %} is-dir{% endif %}">{% if row.entry.is_dir() %}{{ crate::web::fmt::icon("folder")|safe }}{% else if row.entry.is_submodule() %}{{ crate::web::fmt::icon("folder")|safe }}{% else %}{{ crate::web::fmt::icon("file")|safe }}{% endif %}</td> |
| 50 | <td class="file-name">{% if row.entry.is_submodule() %}<span title="Submodule">{{ row.entry.name }}</span>{% else %}<a href="{{ row.href }}">{{ row.entry.name }}</a>{% endif %}</td> |
| 51 | <td class="file-message">{% if let Some(c) = row.entry.last_commit %}<a href="{{ base }}/commit/{{ c.id }}" title="{{ c.summary }}">{{ c.summary }}</a>{% endif %}</td> |
| 52 | <td class="file-age">{% if let Some(c) = row.entry.last_commit %}<time title="{{ crate::web::fmt::datetime_full(c.committer_time) }}">{{ crate::web::fmt::ago(c.committer_time) }}</time>{% endif %}</td> |
| 53 | </tr> |
| 54 | {% endfor %} |
| 55 | </tbody> |
| 56 | </table> |
| 57 | </div> |
| 58 | {% if let Some(readme) = view.readme %} |
| 59 | <div class="box readme" id="readme"> |
| 60 | <div class="box-header readme-header">{{ crate::web::fmt::icon("book-marked")|safe }} <strong>{{ readme.name }}</strong></div> |
| 61 | {% if readme.is_markdown %} |
| 62 | <article class="markdown-body">{{ readme.html|safe }}</article> |
| 63 | {% else %} |
| 64 | <pre class="readme-plain">{{ readme.html|safe }}</pre> |
| 65 | {% endif %} |
| 66 | </div> |
| 67 | {% endif %} |
| 68 | </div> |
| 69 | {% if is_root %} |
| 70 | <aside class="repo-sidebar"> |
| 71 | <h2>About</h2> |
| 72 | {% if r.repo.description.is_empty() %} |
| 73 | <p class="text-muted"><em>No description provided.</em></p> |
| 74 | {% else %} |
| 75 | <p class="about-description">{{ r.repo.description }}</p> |
| 76 | {% endif %} |
| 77 | <ul class="about-list"> |
| 78 | {% if view.readme.is_some() %}<li><a href="#readme">{{ crate::web::fmt::icon("book-marked")|safe }} Readme</a></li>{% endif %} |
| 79 | <li><a href="{{ base }}/commits">{{ crate::web::fmt::icon("history")|safe }} {{ crate::web::fmt::plural(view.commit_count, "commit") }}</a></li> |
| 80 | <li><a href="{{ base }}/branches">{{ crate::web::fmt::icon("git-branch")|safe }} {{ crate::web::fmt::plural(view.branch_count, "branch") }}</a></li> |
| 81 | <li><a href="{{ base }}/tags">{{ crate::web::fmt::icon("tag")|safe }} {{ crate::web::fmt::plural(view.tag_count, "tag") }}</a></li> |
| 82 | <li><a href="{{ base }}/pulls">{{ crate::web::fmt::icon("git-pull-request")|safe }} {{ r.open_pulls }} open pull {% if r.open_pulls == 1 %}request{% else %}requests{% endif %}</a></li> |
| 83 | </ul> |
| 84 | {% if r.access.admin %}<a class="text-small" href="{{ base }}/settings">{{ crate::web::fmt::icon("settings")|safe }} Edit repository details</a>{% endif %} |
| 85 | </aside> |
| 86 | {% endif %} |
| 87 | </div> |
| 88 | {% endblock %} |