Browse Source

fix template error on explore repos (#2319)

Lunny Xiao 2 years ago
parent
commit
aec826b023
2 changed files with 18 additions and 1 deletions
  1. 17 0
      integrations/explore_repos_test.go
  2. 1 1
      templates/explore/repo_list.tmpl

+ 17 - 0
integrations/explore_repos_test.go

@@ -0,0 +1,17 @@
1
+// Copyright 2017 The Gitea Authors. All rights reserved.
2
+// Use of this source code is governed by a MIT-style
3
+// license that can be found in the LICENSE file.
4
+
5
+package integrations
6
+
7
+import (
8
+	"net/http"
9
+	"testing"
10
+)
11
+
12
+func TestExploreRepos(t *testing.T) {
13
+	prepareTestEnv(t)
14
+
15
+	req := NewRequest(t, "GET", "/explore/repos")
16
+	MakeRequest(t, req, http.StatusOK)
17
+}

+ 1 - 1
templates/explore/repo_list.tmpl

@@ -2,7 +2,7 @@
2 2
 	{{range .Repos}}
3 3
 		<div class="item">
4 4
 			<div class="ui header">
5
-				<a class="name" href="{{AppSubUrl}}/{{if .Owner}}{{.Owner.Name}}{{else if $.Org}}{{$.Org.Name}}{{else}}{{$.Owner.Name}}{{end}}/{{.Name}}">{{if or $.PageIsExplore $.PageIsProfileStarList }}{{.Owner.Name}} / {{end}}{{.Name}}</a>
5
+				<a class="name" href="{{AppSubUrl}}/{{if .Owner}}{{.Owner.Name}}{{else if $.Org}}{{$.Org.Name}}{{else}}{{$.Owner.Name}}{{end}}/{{.Name}}">{{if or $.PageIsExplore $.PageIsProfileStarList }}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}}</a>
6 6
 				{{if .IsPrivate}}
7 7
 					<span class="text gold"><i class="octicon octicon-lock"></i></span>
8 8
 				{{else if .IsFork}}