diff --git a/models/issues/review.go b/models/issues/review.go
index 3e787273be8..1c5c2ee30ac 100644
--- a/models/issues/review.go
+++ b/models/issues/review.go
@@ -930,17 +930,19 @@ func MarkConversation(ctx context.Context, comment *Comment, doer *user_model.Us
}
// CanMarkConversation Add or remove Conversation mark for a code comment permission check
-// the PR writer , offfcial reviewer and poster can do it
+// the PR writer , official reviewer and poster can do it
func CanMarkConversation(ctx context.Context, issue *Issue, doer *user_model.User) (permResult bool, err error) {
if doer == nil || issue == nil {
return false, fmt.Errorf("issue or doer is nil")
}
+ if err = issue.LoadRepo(ctx); err != nil {
+ return false, err
+ }
+ if issue.Repo.IsArchived {
+ return false, nil
+ }
if doer.ID != issue.PosterID {
- if err = issue.LoadRepo(ctx); err != nil {
- return false, err
- }
-
p, err := access_model.GetUserRepoPermission(ctx, issue.Repo, doer)
if err != nil {
return false, err
diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl
index ea01d96928c..a3b64b8a11f 100644
--- a/templates/repo/diff/box.tmpl
+++ b/templates/repo/diff/box.tmpl
@@ -24,7 +24,7 @@
{{end}}
- {{if and .PageIsPullFiles $.SignedUserID (not .IsArchived) (not .DiffNotAvailable)}}
+ {{if and .PageIsPullFiles $.SignedUserID (not .DiffNotAvailable)}}
{{end}}
- {{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
+ {{if and .PageIsPullFiles $.SignedUserID}}
{{template "repo/diff/new_review" .}}
{{end}}
@@ -105,7 +105,7 @@
{{$isCsv := (call $.IsCsvFile $file)}}
{{$showFileViewToggle := or $isImage (and (not $file.IsIncomplete) $isCsv)}}
{{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}}
- {{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.IsArchived) $.IsShowingAllCommits}}
+ {{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.Repository.IsArchived) $.IsShowingAllCommits}}
diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl
index 2febc6303aa..3bb01a139aa 100644
--- a/templates/repo/diff/new_review.tmpl
+++ b/templates/repo/diff/new_review.tmpl
@@ -1,56 +1,59 @@
-
-