Feature/discussion err#11 (#18)
* add new discussions * feat discussion 스탯 별도 처리 로직 추가
This commit is contained in:
parent
b15346f4a1
commit
f9c73568c5
|
@ -117,7 +117,13 @@ func GetIssueStats(ctx context.Context, opts *IssuesOptions) (*IssueStats, error
|
|||
|
||||
func getIssueStatsChunk(ctx context.Context, opts *IssuesOptions, issueIDs []int64) (*IssueStats, error) {
|
||||
stats := &IssueStats{}
|
||||
|
||||
if opts.IsDiscussion.Has() && opts.IsDiscussion.Value() {
|
||||
// dummy data for open/closed
|
||||
// TODO: 백엔드 연동시 수정 필요
|
||||
stats.OpenCount = 2
|
||||
stats.ClosedCount = 0
|
||||
return stats, nil
|
||||
}
|
||||
sess := db.GetEngine(ctx).
|
||||
Join("INNER", "repository", "`issue`.repo_id = `repository`.id")
|
||||
|
||||
|
|
|
@ -1756,6 +1756,8 @@ issues.reference_link = Reference: %s
|
|||
compare.compare_base = base
|
||||
compare.compare_head = compare
|
||||
|
||||
discussions.new = New Discussion
|
||||
|
||||
pulls.desc = Enable pull requests and code reviews.
|
||||
pulls.new = New Pull Request
|
||||
pulls.new.blocked_user = Cannot create pull request because you are blocked by the repository owner.
|
||||
|
|
|
@ -836,6 +836,7 @@ issues.review.reviewers=리뷰어
|
|||
issues.review.show_outdated=오래된 내역 보기
|
||||
issues.review.hide_outdated=오래된 내역 숨기기
|
||||
|
||||
discussions.new=새로운 토론
|
||||
|
||||
pulls.new=새 풀 리퀘스트
|
||||
pulls.compare_changes=새 풀 리퀘스트
|
||||
|
|
|
@ -19,9 +19,20 @@
|
|||
{{template "repo/issue/search" .}}
|
||||
{{if not .Repository.IsArchived}}
|
||||
{{if .PageIsIssueList}}
|
||||
<a class="ui small primary button issue-list-new" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{ctx.Locale.Tr "repo.issues.new"}}</a>
|
||||
{{else}}
|
||||
<a class="ui small primary button new-pr-button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{ctx.Locale.Tr "repo.pulls.new"}}</a>
|
||||
<a class="ui small primary button issue-list-new"
|
||||
href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">
|
||||
{{ctx.Locale.Tr "repo.issues.new"}}
|
||||
</a>
|
||||
{{else if .PageIsPullList}}
|
||||
<a class="ui small primary button new-pr-button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}"
|
||||
href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">
|
||||
{{ctx.Locale.Tr "repo.pulls.new"}}
|
||||
</a>
|
||||
{{else if .PageIsDiscussionList}}
|
||||
<a class="ui small primary button new-discussion-button issue-list-new"
|
||||
href="{{.RepoLink}}/discussions/new">
|
||||
{{ctx.Locale.Tr "repo.discussions.new"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{else}}
|
||||
{{if not .PageIsIssueList}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user