Skip to content

Commit 4d94b7c

Browse files
committed
fix: hide repo related info while viewing or blaming a file
- Hide repository's description, website link, topics list, and statistics bar while viewing or blaming a file from the repo - Resolves go-gitea#21406
1 parent 5ba2306 commit 4d94b7c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

templates/repo/home.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{{template "repo/header" .}}
44
<div class="ui container {{if .IsBlame}}fluid padded{{end}}">
55
{{template "base/alert" .}}
6+
{{if and (not .IsViewFile) (not .IsBlame)}}
67
<div class="ui repo-description">
78
<div id="repo-desc">
89
{{$description := .Repository.DescriptionHTML $.Context}}
@@ -31,6 +32,7 @@
3132
{{range .Topics}}<a class="ui repo-topic large label topic" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}}
3233
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<a id="manage_topic" class="muted">{{.locale.Tr "repo.topic.manage_topics"}}</a>{{end}}
3334
</div>
35+
{{end}}
3436
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
3537
<div class="ui repo-topic-edit grid form" id="topic_edit" style="display:none">
3638
<div class="fourteen wide column">

templates/repo/sub_menu.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{if and (not .IsViewFile) (not .IsBlame)}}
12
<div class="ui segments repository-summary{{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo) .LanguageStats}} repository-summary-language-stats{{end}} mt-2 mb-0">
23
<div class="ui segment sub-menu repository-menu">
34
<div class="ui two horizontal center link list">
@@ -44,3 +45,4 @@
4445
</a>
4546
{{end}}
4647
</div>
48+
{{end}}

0 commit comments

Comments
 (0)