File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -99,3 +99,23 @@ func TestViewRepoWithSymlinks(t *testing.T) {
99
99
assert .Equal (t , items [3 ], "link_hi: octicon octicon-file-symlink-file" )
100
100
assert .Equal (t , items [4 ], "link_link: octicon octicon-file-symlink-file" )
101
101
}
102
+
103
+ // TestViewAsRepoAdmin tests PR #2167
104
+ func TestViewAsRepoAdmin (t * testing.T ) {
105
+ for user , expectedNoDescription := range map [string ]bool {
106
+ "user2" : true ,
107
+ "user3" : false ,
108
+ } {
109
+ prepareTestEnv (t )
110
+
111
+ session := loginUser (t , user )
112
+
113
+ req := NewRequest (t , "GET" , "/user2/repo1.git" )
114
+ resp := session .MakeRequest (t , req , http .StatusOK )
115
+
116
+ htmlDoc := NewHTMLParser (t , resp .Body )
117
+ noDescription := htmlDoc .doc .Find ("#repo-desc" ).Children ()
118
+
119
+ assert .Equal (t , expectedNoDescription , noDescription .HasClass ("no-description" ))
120
+ }
121
+ }
Original file line number Diff line number Diff line change 5
5
{{template "base/alert" .}}
6
6
<div class="ui repo-description">
7
7
<div id="repo-desc">
8
- {{if .Repository.DescriptionHTML}}<span class="description has-emoji">{{.Repository.DescriptionHTML}}</span>{{else}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
8
+ {{if .Repository.DescriptionHTML}}<span class="description has-emoji">{{.Repository.DescriptionHTML}}</span>{{else if .IsRepositoryAdmin }}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
9
9
<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
10
10
</div>
11
11
{{if .RepoSearchEnabled}}
You can’t perform that action at this time.
0 commit comments