text/html
•
2.77 KB
•
75 lines
{% import "macros/markdown_content.html" as md %}
<html>
<head>
<title>{{ owner.name }}/{{ project.name }} - {{ file_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>
</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-view">
<div class="file-header">
<div class="path-breadcrumb">
<a href="{{ project.uri_tree(&selected_branch, "") }}">{{ project.slug }}</a>
{% for (i, part) in path_parts.iter().enumerate() %}
{% if i == path_parts.len() - 1 %}
/ {{ part }}
{% else %}
/ <a href="{{ project.uri_tree(&selected_branch, &path_parts[..=i].join("/")) }}">{{ part }}</a>
{% endif %}
{% endfor %}
</div>
<div class="file-actions">
<a href="{{ raw_url }}" class="btn btn-outline file-action-link"><span class="icon i-binary"></span> Raw</a>
{% if let Some(src_url) = source_url %}
<a href="{{ src_url }}" class="btn btn-outline file-action-link {% if is_source %}active{% endif %}"><span class="icon i-code"></span> Source</a>
{% endif %}
</div>
</div>
<div class="file-metadata">
<span class="file-meta-item">{{ mime_type }}</span>
<span class="file-meta-separator">•</span>
<span class="file-meta-item">{{ human_readable_size }}</span>
{% if let Some(lines) = line_count %}
<span class="file-meta-separator">•</span>
<span class="file-meta-item">{{ *lines }} line{% if *lines != 1 %}s{% endif %}</span>
{% endif %}
</div>
{% if is_image %}
<div class="image-view">
<img src="{{ raw_url }}" alt="{{ file_path }}" />
</div>
{% elif is_binary %}
<div class="binary-notice">
<p>Binary file</p>
</div>
{% elif is_rendered_markdown %}
{% call md::render(markdown_frontmatter, file_content) %}
{% else %}
<pre class="file-content"><code>{{ file_content }}</code></pre>
{% endif %}
</div>
</div>
</section>
</main>
</body>
</html>