Skip to content

Commit cd83c2c

Browse files
authored
Fix topics saving internal error and disable for archived repos (#5821)
1 parent ec31ee1 commit cd83c2c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

routers/routes/routes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ func RegisterRoutes(m *macaron.Macaron) {
652652

653653
m.Group("/:username/:reponame", func() {
654654
m.Post("/topics", repo.TopicsPost)
655-
}, context.RepoMustNotBeArchived(), context.RepoAssignment(), reqRepoAdmin)
655+
}, context.RepoAssignment(), context.RepoMustNotBeArchived(), reqRepoAdmin)
656656

657657
m.Group("/:username/:reponame", func() {
658658
m.Group("", func() {

templates/repo/home.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
</div>
2626
<div class="ui repo-topic" id="repo-topic">
2727
{{range .Topics}}<a class="ui green basic label topic" style="cursor:pointer;" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}}
28-
{{if .Permission.IsAdmin}}<a id="manage_topic" style="cursor:pointer;margin-left:10px;">{{.i18n.Tr "repo.topic.manage_topics"}}</a>{{end}}
28+
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<a id="manage_topic" style="cursor:pointer;margin-left:10px;">{{.i18n.Tr "repo.topic.manage_topics"}}</a>{{end}}
2929
</div>
30-
{{if .Permission.IsAdmin}}
30+
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
3131
<div class="ui repo-topic-edit grid form segment error" id="topic_edit" style="display:none">
3232
<div class="fourteen wide column">
3333
<div class="field">

0 commit comments

Comments
 (0)