aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorThorsten Ortlepp <post@ortlepp.eu>2024-11-07 23:15:40 +0100
committerThorsten Ortlepp <post@ortlepp.eu>2024-11-07 23:15:40 +0100
commit2ded5fe7bc44af014a822e3718ac20a250bdbf51 (patch)
treea372635a0f06bcf84f797e42898b828ed7be4340 /views
parentb5bbc59189f81ad0e2e764786866057e81ecea78 (diff)
downloadgit-arr-fork-2ded5fe7bc44af014a822e3718ac20a250bdbf51.zip
Added main branch handling from upstream project
Diffstat (limited to 'views')
-rw-r--r--views/summary.html32
1 files changed, 8 insertions, 24 deletions
diff --git a/views/summary.html b/views/summary.html
index 905f2ee..2d926dc 100644
--- a/views/summary.html
+++ b/views/summary.html
@@ -35,38 +35,22 @@
<hr/>
% end
-% if "master" in repo.branch_names():
+% if repo.main_branch():
<div class="toggable-title" onclick="toggle('commits')">
- <a href="b/master/">commits (master)</a>
+ <a href="b/{{repo.main_branch()}}/">commits ({{repo.main_branch()}})</a>
</div>
-% kwargs = dict(repo = repo, start_ref = "refs/heads/master",
+% kwargs = dict(repo = repo,
+% start_ref = "refs/heads/" + repo.main_branch(),
% limit = repo.info.commits_in_summary,
% shorten = shorten, repo_root = ".", offset = 0)
% include('commit-list.html', **kwargs)
<hr/>
<div class="toggable-title" onclick="toggle('ls')">
- <a href="b/master/t/">tree (master)</a>
+ <a href="b/{{repo.main_branch()}}/t/">tree ({{repo.main_branch()}})</a>
</div>
-% kwargs = dict(repo = repo, tree=repo.tree("master"),
-% treeroot="b/master/t", dirname=smstr.from_url(""))
-% include('tree-list.html', **kwargs)
-<hr/>
-% end
-
-% if "main" in repo.branch_names():
-<div class="toggable-title" onclick="toggle('commits')">
- <a href="b/main/">commits (main)</a>
-</div>
-% kwargs = dict(repo = repo, start_ref = "refs/heads/main",
-% limit = repo.info.commits_in_summary,
-% shorten = shorten, repo_root = ".", offset = 0)
-% include('commit-list.html', **kwargs)
-<hr/>
-<div class="toggable-title" onclick="toggle('ls')">
- <a href="b/main/t/">tree (main)</a>
-</div>
-% kwargs = dict(repo = repo, tree=repo.tree("main"),
-% treeroot="b/main/t", dirname=smstr.from_url(""))
+% kwargs = dict(repo = repo, tree=repo.tree(repo.main_branch()),
+% treeroot="b/" + repo.main_branch() + "/t",
+% dirname=smstr.from_url(""))
% include('tree-list.html', **kwargs)
<hr/>
% end