templates/skin.tmpl
browsing at commit = f94948ee920ac4654a97980edc83bf249aa160f5
<% c++ #include "content.h" %>
<% c++ #include "util.h" %>
<% skin git %>
<% view master uses content::master %>
<% template render() %><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><%= title %> · git</title>
<link rel="stylesheet" href="/static/style.css">
<link rel="stylesheet" href="/static/highlight.css">
</head>
<body>
<header class="topbar">
<a class="brand" href="/">git</a>
<a href="/repos">repos</a>
<% if (content.repo.length() > 0) %>
<span class="sep">/</span>
<a href="/repos/<%= repo %><%= query %>"><%= repo %></a>
<nav class="repo-nav">
<a href="/repos/<%= repo %>/tree/<%= query %>">files</a>
<a href="/repos/<%= repo %>/log/<%= query %>">log</a>
<a href="/repos/<%= repo %>/branches/">branches</a>
<a href="/repos/<%= repo %>/tags/">tags</a>
</nav>
<% end %>
</header>
<main><% include content_body() %></main>
<script src="/static/highlight.min.js"></script>
<script src="/static/cmake.min.js"></script>
<script src="/static/marked.min.js"></script>
<script src="/static/app.js"></script>
</body>
</html><% end template %>
<% template content_body() %><% end template %>
<% end view %>
<% view frontpage uses content::frontpage extends master %>
<% template content_body() %>
<h1>Multi Git Frontend</h1>
<p>Serving <%= repo_count %> repositories.</p>
<p><a href="/repos">Browse repositories →</a></p>
<% end template %>
<% end view %>
<% view repo_list uses content::repo_list extends master %>
<% template content_body() %>
<h1>Repositories</h1>
<ul class="repo-list">
<% foreach r in repos %><% item %>
<li><a href="/repos/<%= r %>"><%= r %></a></li>
<% end item %><% empty %>
<li>No repositories found.</li>
<% end %>
</ul>
<% end template %>
<% end view %>
<% view repo_home uses content::repo_home extends master %>
<% template content_body() %>
<h1><%= repo %></h1>
<p class="meta">default branch: <%= default_branch %> · commit <%= commit_oid %></p>
<p class="actions">
<a href="/repos/<%= repo %>/tree/<%= query %>">files</a> ·
<a href="/repos/<%= repo %>/log/<%= query %>">log</a>
</p>
<% if (content.readme_name.length() > 0) %>
<article id="readme" class="readme markdown">Loading README…</article>
<div class="markdown-src" data-target="#readme" hidden><%= readme_text %></div>
<% else %>
<p>No README found.</p>
<% end %>
<% end template %>
<% end view %>
<% view tree_view uses content::tree_view extends master %>
<% template content_body() %>
<h1><%= repo %><% if (content.path.length() > 0) %>/<%= path %><% end %></h1>
<% if (content.query.length() > 0) %>
<p class="commit-notice">browsing at commit = <%= commit_oid %></p>
<% end %>
<% if (not content.on_default_branch) %>
<% if (content.branches.size() > 0) %>
<p class="tags">branches: <% foreach b in branches %><% item %><a href="/repos/<%= repo %>/tree/?id=<%= b.target_oid %>"><%= b.name %></a> <% end item %><% end foreach %></p>
<% else %>
<p class="tags">not on any branch</p>
<% end %>
<% end %>
<% if (content.tags.size() > 0) %>
<p class="tags">tags: <% foreach t in tags %><% item %><a href="/repos/<%= repo %>/tags/<%= t %>"><%= t %></a> <% end item %><% end foreach %></p>
<% end %>
<table class="tree">
<% if (not content.is_root) %>
<tr><td class="name"><a href="/repos/<%= repo %>/tree/<%= parent_path %><%= query %>">..</a></td><td></td></tr>
<% end %>
<% foreach e in entries %><% item %>
<tr>
<td class="name">
<% if e.is_dir %>
<a class="dir" href="/repos/<%= repo %>/tree/<%= e.path %><%= query %>"><%= e.name %>/</a>
<% else %>
<% if e.is_submodule %>
<span class="submodule"><%= e.name %> @ <%= e.oid %></span>
<% else %>
<a href="/repos/<%= repo %>/tree/<%= e.path %><%= query %>"><%= e.name %></a>
<% end %>
<% end %>
</td>
<td class="size"><% if e.is_dir %><% else %><% if e.is_submodule %><% else %><% c++ out() << util::human_size(e.size); %><% end %><% end %></td>
</tr>
<% end item %><% empty %>
<tr><td>empty tree</td></tr>
<% end %>
</table>
<% end template %>
<% end view %>
<% view file_view uses content::file_view extends master %>
<% template content_body() %>
<h1><%= path %></h1>
<% if (content.query.length() > 0) %>
<p class="commit-notice">browsing at commit = <%= commit_oid %></p>
<% end %>
<% if (not content.on_default_branch) %>
<% if (content.branches.size() > 0) %>
<p class="tags">branches: <% foreach b in branches %><% item %><a href="/repos/<%= repo %>/tree/?id=<%= b.target_oid %>"><%= b.name %></a> <% end item %><% end foreach %></p>
<% else %>
<p class="tags">not on any branch</p>
<% end %>
<% end %>
<% if (content.tags.size() > 0) %>
<p class="tags">tags: <% foreach t in tags %><% item %><a href="/repos/<%= repo %>/tags/<%= t %>"><%= t %></a> <% end item %><% end foreach %></p>
<% end %>
<p class="actions">
<a href="/repos/<%= repo %>/raw/<%= path %><%= query %>">raw</a> ·
<a href="/repos/<%= repo %>/blame/<%= path %><%= query %>">blame</a> ·
<a href="/repos/<%= repo %>/log/<%= query %>">history</a>
</p>
<% if is_image %>
<p class="fileimg"><img src="/repos/<%= repo %>/raw/<%= path %><%= query %>" alt="<%= filename %>"></p>
<% if not empty text %>
<pre class="code"><code class="hljs" data-filename="<%= filename %>"><%= text %></code></pre>
<% end %>
<% else %>
<% if is_binary %>
<p class="binary">Binary file (<% c++ out() << util::human_size(content.size); %>) —
<a href="/repos/<%= repo %>/raw/<%= path %><%= query %>">view raw</a></p>
<% else %>
<% if is_markdown %>
<article id="filemd" class="readme markdown">Loading…</article>
<div class="markdown-src" data-target="#filemd" hidden><%= text %></div>
<% else %>
<pre class="code"><code class="hljs" data-filename="<%= filename %>"><%= text %></code></pre>
<% end %>
<% end %>
<% end %>
<% end template %>
<% end view %>
<% view blame_view uses content::blame_view extends master %>
<% template content_body() %>
<h1>blame: <%= path %></h1>
<p class="actions">
<a href="/repos/<%= repo %>/tree/<%= path %><%= query %>">normal view</a> ·
<a href="/repos/<%= repo %>/raw/<%= path %><%= query %>">raw</a>
</p>
<table class="blame">
<% foreach l in lines %><% item %>
<tr>
<td class="commit"><a href="/repos/<%= repo %>/commit/<%= l.short_oid %>"><%= l.short_oid %></a></td>
<td class="author"><%= l.author %></td>
<td class="lineno"><%= l.number %></td>
<td class="line"><pre><%= l.content %></pre></td>
</tr>
<% end item %><% end foreach %>
</table>
<% end template %>
<% end view %>
<% view log_view uses content::log_view extends master %>
<% template content_body() %>
<h1>log: <%= repo %></h1>
<table class="log">
<% foreach c in commits %><% item %>
<tr>
<td class="commit"><a href="/repos/<%= repo %>/commit/<%= c.oid %>"><%= c.short_oid %></a></td>
<td class="msg"><a href="/repos/<%= repo %>/commit/<%= c.oid %>"><%= c.summary %></a>
<% if (c.body.length() > 0) %>
<details class="commit-more"><summary>expand</summary><pre class="commit-body"><%= c.body %></pre></details>
<% end %>
</td>
<td class="author"><%= c.author_name %></td>
<td class="date"><% c++ out() << util::format_time(c.time); %></td>
</tr>
<% end item %><% empty %>
<tr><td>no commits</td></tr>
<% end %>
</table>
<% end template %>
<% end view %>
<% view object_view uses content::object_view extends master %>
<% template content_body() %>
<h1>object <%= object.oid %></h1>
<p class="meta">type: <%= object.type_name %></p>
<% if (content.object.kind == ObjectKind::Tree) %>
<table class="tree">
<% foreach e in object.entries %><% item %>
<tr>
<td class="name"><a href="/repos/<%= repo %>/object/<%= e.oid %>"><%= e.name %></a></td>
<td class="oid"><%= e.oid %></td>
</tr>
<% end item %><% end foreach %>
</table>
<% else %>
<pre class="code"><code><%= object.body %></code></pre>
<% end %>
<% end template %>
<% end view %>
<% view tags_view uses content::tags_view extends master %>
<% template content_body() %>
<h1>tags: <%= repo %></h1>
<table class="log">
<% foreach t in tags %><% item %>
<tr>
<td class="commit"><a href="/repos/<%= repo %>/commit/<%= t.target_oid %>"><%= t.short_oid %></a></td>
<td class="msg"><a href="/repos/<%= repo %>/tags/<%= t.name %>"><%= t.name %></a></td>
<td class="msg"><a href="/repos/<%= repo %>/tree/?id=<%= t.target_oid %>">browse files</a></td>
<td class="msg"><a href="/repos/<%= repo %>/tags/<%= t.name %>.tar.gz">download .tar.gz</a></td>
<td class="date"><% c++ out() << util::format_time(t.time); %></td>
</tr>
<% end item %><% empty %>
<tr><td>no tags</td></tr>
<% end %>
</table>
<% end template %>
<% end view %>
<% view tag_view uses content::tag_view extends master %>
<% template content_body() %>
<h1>tag: <%= tag.name %></h1>
<p class="meta">
<% if tag.annotated %>annotated<% else %>lightweight<% end %> ·
points to <a href="/repos/<%= repo %>/commit/<%= tag.target_oid %>"><%= tag.short_oid %></a>
· <% c++ out() << util::format_time(content.tag.time); %>
· <a href="/repos/<%= repo %>/tree/?id=<%= tag.target_oid %>">browse files</a>
· <a href="/repos/<%= repo %>/tags/<%= tag.name %>.tar.gz">download .tar.gz</a>
<% if (content.tag.tagger_name.length() > 0) %><br>tagger: <%= tag.tagger_name %><% end %>
</p>
<% if (content.tag.message.length() > 0) %>
<pre class="code"><code><%= tag.message %></code></pre>
<% end %>
<% end template %>
<% end view %>
<% view branches_view uses content::branches_view extends master %>
<% template content_body() %>
<h1>branches: <%= repo %></h1>
<table class="log">
<% foreach b in branches %><% item %>
<tr>
<td class="commit"><a href="/repos/<%= repo %>/commit/<%= b.target_oid %>"><%= b.short_oid %></a></td>
<td class="msg"><%= b.name %><% if b.is_default %> (default)<% end %></td>
<td class="msg"><a href="/repos/<%= repo %>/log/?id=<%= b.target_oid %>">log</a></td>
<td class="msg"><a href="/repos/<%= repo %>/tree/?id=<%= b.target_oid %>">browse files</a></td>
<td class="date"><% c++ out() << util::format_time(b.time); %></td>
</tr>
<% end item %><% empty %>
<tr><td>no branches</td></tr>
<% end %>
</table>
<% end template %>
<% end view %>
<% view commit_view uses content::commit_view extends master %>
<% template content_body() %>
<h1>commit <%= commit.short_oid %></h1>
<% if (not content.on_default_branch) %>
<% if (content.branches.size() > 0) %>
<p class="tags">branches: <% foreach b in branches %><% item %><a href="/repos/<%= repo %>/tree/?id=<%= b.target_oid %>"><%= b.name %></a> <% end item %><% end foreach %></p>
<% else %>
<p class="tags">not on any branch</p>
<% end %>
<% end %>
<p class="meta">
<%= commit.author_name %><% if (content.commit.author_email.length() > 0) %> <<%= commit.author_email %>><% end %> ·
<% c++ out() << util::format_time(content.commit.time); %><br>
<%= commit.oid %>
<a href="/repos/<%= repo %>/commit/<%= commit.oid %>.patch">patch</a>
· <a href="/repos/<%= repo %>/tree/?id=<%= commit.oid %>">browse files</a>
<% foreach p in commit.parents %><% item %><br>parent <a href="/repos/<%= repo %>/commit/<%= p %>"><%= p %></a><% end item %><% end foreach %>
</p>
<pre class="code"><code><%= commit.message %></code></pre>
<h2>Changed files</h2>
<table class="tree">
<% foreach f in commit.files %><% item %>
<tr>
<td class="status"><%= f.status %></td>
<td class="name">
<% if (f.status == 'D') %>
<%= f.path %>
<% else %>
<a href="/repos/<%= repo %>/tree/<%= f.path %>?id=<%= commit.oid %>"><%= f.path %></a>
<% end %>
<% if (content.commit.first_parent.length() > 0 and (f.status == 'M' or f.status == 'D')) %>
<a class="before" href="/repos/<%= repo %>/tree/<%= f.old_path %>?id=<%= commit.first_parent %>">before</a>
<% end %>
</td>
</tr>
<% end item %><% empty %>
<tr><td>no changes</td></tr>
<% end %>
</table>
<div class="diff">
<% foreach d in commit.diff %><% item %>
<div class="<%= d.css %>"><%= d.content %></div>
<% end item %><% end foreach %>
</div>
<% end template %>
<% end view %>
<% end skin %>