Skip to content

Commit

Permalink
remove no-description
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Apr 20, 2024
1 parent 3939146 commit 8275653
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 33 deletions.
1 change: 0 additions & 1 deletion options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,6 @@ action.blocked_user = Cannot perform action because you are blocked by the repos
download_archive = Download Repository
more_operations = More Operations
no_desc = No Description
quick_guide = Quick Guide
clone_this_repo = Clone this repository
cite_this_repo = Cite this repository
Expand Down
8 changes: 2 additions & 6 deletions templates/repo/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
{{if and (not .HideRepoInfo) (not .IsBlame)}}
<div class="repo-description gt-word-break">
{{- $description := .Repository.DescriptionHTML ctx -}}
{{- if $description -}}
{{- $description | RenderCodeBlock -}}
{{- else if .IsRepositoryAdmin -}}
<span class="no-description tw-italic">{{ctx.Locale.Tr "repo.no_desc"}}</span>
{{- end -}}
{{- if .Repository.Website}}<a href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end -}}
{{if $description}}{{$description | RenderCodeBlock}}{{end}}
{{if .Repository.Website}}<a href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end}}
</div>
<div class="tw-flex tw-items-center tw-flex-wrap tw-gap-2 tw-my-2" id="repo-topics">
{{/* it should match the code in issue-home.js */}}
Expand Down
26 changes: 0 additions & 26 deletions tests/integration/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ func TestViewRepo(t *testing.T) {
resp := session.MakeRequest(t, req, http.StatusOK)

htmlDoc := NewHTMLParser(t, resp.Body)
noDescription := htmlDoc.doc.Find(".repo-description").Children()
repoTopics := htmlDoc.doc.Find("#repo-topics").Children()
repoSummary := htmlDoc.doc.Find(".repository-summary").Children()

assert.True(t, noDescription.HasClass("no-description"))
assert.True(t, repoTopics.HasClass("repo-topic"))
assert.True(t, repoSummary.HasClass("repository-menu"))

Expand Down Expand Up @@ -177,30 +175,6 @@ func TestViewRepoWithSymlinks(t *testing.T) {
assert.Equal(t, "link_link: svg octicon-file-symlink-file", items[4])
}

// TestViewAsRepoAdmin tests PR #2167
func TestViewAsRepoAdmin(t *testing.T) {
for user, expectedNoDescription := range map[string]bool{
"user2": true,
"user4": false,
} {
defer tests.PrepareTestEnv(t)()

session := loginUser(t, user)

req := NewRequest(t, "GET", "/user2/repo1.git")
resp := session.MakeRequest(t, req, http.StatusOK)

htmlDoc := NewHTMLParser(t, resp.Body)
noDescription := htmlDoc.doc.Find(".repo-description").Children()
repoTopics := htmlDoc.doc.Find("#repo-topics").Children()
repoSummary := htmlDoc.doc.Find(".repository-summary").Children()

assert.Equal(t, expectedNoDescription, noDescription.HasClass("no-description"))
assert.True(t, repoTopics.HasClass("repo-topic"))
assert.True(t, repoSummary.HasClass("repository-menu"))
}
}

// TestViewFileInRepo repo description, topics and summary should not be displayed when viewing a file
func TestViewFileInRepo(t *testing.T) {
defer tests.PrepareTestEnv(t)()
Expand Down

0 comments on commit 8275653

Please sign in to comment.