git repos / sago_web_git

commit 55fa1ac0

Poul Sander · 2026-06-27 18:12
55fa1ac0b398c748c7e2421b855a1606790cafc9 patch · browse files
parent e6fed232320fc1bd4c7f35df8325080183937ba4

Split the pages into seperate files

Changed files

M CMakeLists.txt before
A templates/history.tmpl
A templates/master.tmpl
A templates/pages.tmpl
A templates/repo.tmpl
D templates/skin.tmpl before
diff --git a/CMakeLists.txt b/CMakeLists.txt index 280f4db..ed76f77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -30,13 +30,18 @@ find_program(CPPCMS_TMPL_CC NAMES cppcms_tmpl_cc REQUIRED)
# --- Generate cppcms views from the template skin -------------------------
-set(SKIN ${CMAKE_CURRENT_SOURCE_DIR}/templates/skin.tmpl)
+set(TEMPLATE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/templates)
+set(SKINS
+ ${TEMPLATE_DIR}/master.tmpl
+ ${TEMPLATE_DIR}/pages.tmpl
+ ${TEMPLATE_DIR}/repo.tmpl
+ ${TEMPLATE_DIR}/history.tmpl)
set(VIEWS_CPP ${CMAKE_CURRENT_BINARY_DIR}/views.cpp)
add_custom_command(
OUTPUT ${VIEWS_CPP}
- COMMAND ${CPPCMS_TMPL_CC} ${SKIN} -o ${VIEWS_CPP}
- DEPENDS ${SKIN}
- COMMENT "Generating cppcms views from skin.tmpl"
+ COMMAND ${CPPCMS_TMPL_CC} ${SKINS} -o ${VIEWS_CPP}
+ DEPENDS ${SKINS}
+ COMMENT "Generating cppcms views from templates"
VERBATIM)
# --- Application ----------------------------------------------------------
diff --git a/templates/history.tmpl b/templates/history.tmpl new file mode 100644 index 0000000..55f5d6f --- /dev/null +++ b/templates/history.tmpl
@@ -0,0 +1,151 @@
+<% c++ #include "content.h" %>
+<% c++ #include "util.h" %>
+<% skin git %>
+
+<% view log_view uses content::log_view extends master %>
+<% template content_body() %>
+<h1>log: <%= repo %></h1>
+<% if (content.has_bodies) %>
+<p class="log-controls"><button type="button" class="log-toggle" aria-pressed="false">expand: off</button></p>
+<% end %>
+<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) %>
+<pre class="commit-body" hidden><%= c.body %></pre>
+<% 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 %> &middot;
+points to <a href="/repos/<%= repo %>/commit/<%= tag.target_oid %>"><%= tag.short_oid %></a>
+&middot; <% c++ out() << util::format_time(content.tag.time); %>
+&middot; <a href="/repos/<%= repo %>/tree/?id=<%= tag.target_oid %>">browse files</a>
+&middot; <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) %> &lt;<%= commit.author_email %>&gt;<% end %> &middot;
+<% c++ out() << util::format_time(content.commit.time); %><br>
+<%= commit.oid %>
+<a href="/repos/<%= repo %>/commit/<%= commit.oid %>.patch">patch</a>
+&middot; <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 %>
diff --git a/templates/master.tmpl b/templates/master.tmpl new file mode 100644 index 0000000..7795756 --- /dev/null +++ b/templates/master.tmpl
@@ -0,0 +1,45 @@
+<% 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 %> &middot; 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) %>
+<a href="/about">about</a>
+<% end %>
+<% 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/dockerfile.min.js"></script>
+<script src="/static/terraform.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 %>
+
+<% end skin %>
diff --git a/templates/pages.tmpl b/templates/pages.tmpl new file mode 100644 index 0000000..3acc3de --- /dev/null +++ b/templates/pages.tmpl
@@ -0,0 +1,33 @@
+<% c++ #include "content.h" %>
+<% c++ #include "util.h" %>
+<% skin git %>
+
+<% 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 &rarr;</a></p>
+<% end template %>
+<% end view %>
+
+<% view about uses content::master extends master %>
+<% template content_body() %>
+<h1>About</h1>
+<p>A lightweight, read-only web frontend for browsing and cloning local git repositories.</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 %>
+
+<% end skin %>
diff --git a/templates/repo.tmpl b/templates/repo.tmpl new file mode 100644 index 0000000..5777132 --- /dev/null +++ b/templates/repo.tmpl
@@ -0,0 +1,163 @@
+<% c++ #include "content.h" %>
+<% c++ #include "util.h" %>
+<% skin git %>
+
+<% view repo_home uses content::repo_home extends master %>
+<% template content_body() %>
+<h1><%= repo %></h1>
+<p class="meta">default branch: <%= default_branch %> &middot; commit <%= commit_oid %></p>
+<p class="actions">
+<a href="/repos/<%= repo %>/tree/<%= query %>">files</a> &middot;
+<a href="/repos/<%= repo %>/log/<%= query %>">log</a>
+</p>
+<% if (content.clone_http.length() > 0 or content.clone_https.length() > 0) %>
+<div class="checkout">
+<h2>Checkout</h2>
+<% if (content.clone_http.length() > 0) %>
+<p class="clone-line"><span class="clone-label">Non-GitHub</span> <code>git clone <%= clone_http %></code></p>
+<% end %>
+<% if (content.clone_https.length() > 0) %>
+<p class="clone-line"><span class="clone-label">HTTPS</span> <code>git clone <%= clone_https %></code></p>
+<p class="clone-line"><span class="clone-label">SSH</span> <code>git clone <%= clone_ssh %></code></p>
+<% end %>
+</div>
+<% end %>
+<% if (content.readme_name.length() > 0) %>
+<article id="readme" class="readme markdown">Loading README&hellip;</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 %>
+<% if (content.entries.size() > 0) %>
+<p class="tree-controls"><button type="button" class="view-toggle" aria-pressed="false">view: list</button></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>
+<div class="tree-grid" hidden>
+<% if (not content.is_root) %>
+<a class="tile dir" href="/repos/<%= repo %>/tree/<%= parent_path %><%= query %>"><span class="tile-icon">&#128193;</span><span class="tile-name">..</span></a>
+<% end %>
+<% foreach e in entries %><% item %>
+<% if e.is_dir %>
+<a class="tile dir" href="/repos/<%= repo %>/tree/<%= e.path %><%= query %>"><span class="tile-icon">&#128193;</span><span class="tile-name"><%= e.name %>/</span></a>
+<% else %>
+<% if e.is_submodule %>
+<span class="tile submodule"><span class="tile-icon">&#128279;</span><span class="tile-name"><%= e.name %></span></span>
+<% else %>
+<a class="tile" href="/repos/<%= repo %>/tree/<%= e.path %><%= query %>">
+<% if e.is_image %>
+<img class="thumb" loading="lazy" src="/repos/<%= repo %>/raw/<%= e.path %><%= query %>" alt="<%= e.name %>">
+<% else %>
+<span class="tile-icon">&#128196;</span>
+<% end %>
+<span class="tile-name"><%= e.name %></span></a>
+<% end %>
+<% end %>
+<% end item %><% end %>
+</div>
+<% 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> &middot;
+<a href="/repos/<%= repo %>/blame/<%= path %><%= query %>">blame</a> &middot;
+<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); %>) &mdash;
+<a href="/repos/<%= repo %>/raw/<%= path %><%= query %>">view raw</a></p>
+<% else %>
+<% if is_markdown %>
+<article id="filemd" class="readme markdown">Loading&hellip;</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> &middot;
+<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 %>
+
+<% end skin %>
diff --git a/templates/skin.tmpl b/templates/skin.tmpl deleted file mode 100644 index 2454759..0000000 --- a/templates/skin.tmpl +++ /dev/null
@@ -1,377 +0,0 @@
-<% 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 %> &middot; 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) %>
-<a href="/about">about</a>
-<% end %>
-<% 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/dockerfile.min.js"></script>
-<script src="/static/terraform.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 &rarr;</a></p>
-<% end template %>
-<% end view %>
-
-<% view about uses content::master extends master %>
-<% template content_body() %>
-<h1>About</h1>
-<p>A lightweight, read-only web frontend for browsing and cloning local git repositories.</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 %> &middot; commit <%= commit_oid %></p>
-<p class="actions">
-<a href="/repos/<%= repo %>/tree/<%= query %>">files</a> &middot;
-<a href="/repos/<%= repo %>/log/<%= query %>">log</a>
-</p>
-<% if (content.clone_http.length() > 0 or content.clone_https.length() > 0) %>
-<div class="checkout">
-<h2>Checkout</h2>
-<% if (content.clone_http.length() > 0) %>
-<p class="clone-line"><span class="clone-label">Non-GitHub</span> <code>git clone <%= clone_http %></code></p>
-<% end %>
-<% if (content.clone_https.length() > 0) %>
-<p class="clone-line"><span class="clone-label">HTTPS</span> <code>git clone <%= clone_https %></code></p>
-<p class="clone-line"><span class="clone-label">SSH</span> <code>git clone <%= clone_ssh %></code></p>
-<% end %>
-</div>
-<% end %>
-<% if (content.readme_name.length() > 0) %>
-<article id="readme" class="readme markdown">Loading README&hellip;</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 %>
-<% if (content.entries.size() > 0) %>
-<p class="tree-controls"><button type="button" class="view-toggle" aria-pressed="false">view: list</button></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>
-<div class="tree-grid" hidden>
-<% if (not content.is_root) %>
-<a class="tile dir" href="/repos/<%= repo %>/tree/<%= parent_path %><%= query %>"><span class="tile-icon">&#128193;</span><span class="tile-name">..</span></a>
-<% end %>
-<% foreach e in entries %><% item %>
-<% if e.is_dir %>
-<a class="tile dir" href="/repos/<%= repo %>/tree/<%= e.path %><%= query %>"><span class="tile-icon">&#128193;</span><span class="tile-name"><%= e.name %>/</span></a>
-<% else %>
-<% if e.is_submodule %>
-<span class="tile submodule"><span class="tile-icon">&#128279;</span><span class="tile-name"><%= e.name %></span></span>
-<% else %>
-<a class="tile" href="/repos/<%= repo %>/tree/<%= e.path %><%= query %>">
-<% if e.is_image %>
-<img class="thumb" loading="lazy" src="/repos/<%= repo %>/raw/<%= e.path %><%= query %>" alt="<%= e.name %>">
-<% else %>
-<span class="tile-icon">&#128196;</span>
-<% end %>
-<span class="tile-name"><%= e.name %></span></a>
-<% end %>
-<% end %>
-<% end item %><% end %>
-</div>
-<% 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> &middot;
-<a href="/repos/<%= repo %>/blame/<%= path %><%= query %>">blame</a> &middot;
-<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); %>) &mdash;
-<a href="/repos/<%= repo %>/raw/<%= path %><%= query %>">view raw</a></p>
-<% else %>
-<% if is_markdown %>
-<article id="filemd" class="readme markdown">Loading&hellip;</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> &middot;
-<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>
-<% if (content.has_bodies) %>
-<p class="log-controls"><button type="button" class="log-toggle" aria-pressed="false">expand: off</button></p>
-<% end %>
-<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) %>
-<pre class="commit-body" hidden><%= c.body %></pre>
-<% 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 %> &middot;
-points to <a href="/repos/<%= repo %>/commit/<%= tag.target_oid %>"><%= tag.short_oid %></a>
-&middot; <% c++ out() << util::format_time(content.tag.time); %>
-&middot; <a href="/repos/<%= repo %>/tree/?id=<%= tag.target_oid %>">browse files</a>
-&middot; <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) %> &lt;<%= commit.author_email %>&gt;<% end %> &middot;
-<% c++ out() << util::format_time(content.commit.time); %><br>
-<%= commit.oid %>
-<a href="/repos/<%= repo %>/commit/<%= commit.oid %>.patch">patch</a>
-&middot; <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 %>