aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorAlberto Bertogli <albertito@blitiri.com.ar>2020-05-24 16:52:11 +0200
committerAlberto Bertogli <albertito@blitiri.com.ar>2020-05-24 17:05:18 +0200
commitaee18d0edd88b9db07c3cfb5c13d9889ffac94c1 (patch)
treebd17d5b50e5de951b8b2df67e56a6ce3de57bfcb /views
parent20b99ee568fd15ca2897f995e9775861ef293544 (diff)
downloadgit-arr-fork-aee18d0edd88b9db07c3cfb5c13d9889ffac94c1.zip
Simplify smstr
With the Python 2 to 3 migration and the type checking, we can be fairly confident that smstr are always constructed from strings, not bytes. This allows the code to be simplified, as we no longer need to carry the dual raw/unicode representation.
Diffstat (limited to 'views')
-rw-r--r--views/blob.html10
-rw-r--r--views/tree.html4
2 files changed, 7 insertions, 7 deletions
diff --git a/views/blob.html b/views/blob.html
index 58c40a7..f1c6ad0 100644
--- a/views/blob.html
+++ b/views/blob.html
@@ -10,7 +10,7 @@
% relroot = reltree + '../' * (len(branch.split('/')) - 1)
<title>git &raquo; {{repo.name}} &raquo;
- {{branch}} &raquo; {{dirname.unicode}}{{fname.unicode}}</title>
+ {{branch}} &raquo; {{dirname.raw}}{{fname.raw}}</title>
<link rel="stylesheet" type="text/css"
href="{{relroot}}../../../../../static/git-arr.css"/>
<link rel="stylesheet" type="text/css"
@@ -33,7 +33,7 @@
% if not c.raw:
% continue
% end
- <a href="{{base.url}}{{c.url}}/">{{c.unicode}}</a> /
+ <a href="{{base.url}}{{c.url}}/">{{c.raw}}</a> /
% base += c + '/'
% end
<a href="">{{!fname.html}}</a>
@@ -45,7 +45,7 @@
<td>empty &mdash; 0 bytes</td>
</tr>
</table>
-% elif can_embed_image(repo, fname.unicode):
+% elif can_embed_image(repo, fname.raw):
{{!embed_image_blob(fname.raw, blob.raw_content)}}
% elif is_binary(blob.raw_content):
<table class="nice blob-binary">
@@ -72,12 +72,12 @@
</tr>
% end
</table>
-% elif can_markdown(repo, fname.unicode):
+% elif can_markdown(repo, fname.raw):
<div class="markdown">
{{!markdown_blob(blob.utf8_content)}}
</div>
% elif can_colorize(blob.utf8_content):
-{{!colorize_blob(fname.unicode, blob.utf8_content)}}
+{{!colorize_blob(fname.raw, blob.utf8_content)}}
% else:
<pre class="blob-body">
{{blob.utf8_content}}
diff --git a/views/tree.html b/views/tree.html
index 3f3829c..179672d 100644
--- a/views/tree.html
+++ b/views/tree.html
@@ -10,7 +10,7 @@
% relroot = reltree + '../' * (len(branch.split('/')) - 1)
<title>git &raquo; {{repo.name}} &raquo;
- {{branch}} &raquo; {{dirname.unicode if dirname.unicode else '/'}}</title>
+ {{branch}} &raquo; {{dirname.raw if dirname.raw else '/'}}</title>
<link rel="stylesheet" type="text/css"
href="{{relroot}}../../../../../static/git-arr.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
@@ -31,7 +31,7 @@
% if not c.raw:
% continue
% end
- <a href="{{base.url}}{{c.url}}/">{{c.unicode}}</a> /
+ <a href="{{base.url}}{{c.url}}/">{{c.raw}}</a> /
% base += c + '/'
% end
</h3>