Skip to content

Commit d88b221

Browse files
authored
Merge branch 'main' into feature-commit-cross-reference
2 parents f9e781e + e88b529 commit d88b221

File tree

8 files changed

+77
-37
lines changed

8 files changed

+77
-37
lines changed

models/issues/issue.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,6 +1572,7 @@ type IssueStatsOptions struct {
15721572
RepoID int64
15731573
Labels string
15741574
MilestoneID int64
1575+
ProjectID int64
15751576
AssigneeID int64
15761577
MentionedID int64
15771578
PosterID int64
@@ -1650,6 +1651,11 @@ func getIssueStatsChunk(opts *IssueStatsOptions, issueIDs []int64) (*IssueStats,
16501651
sess.And("issue.milestone_id = ?", opts.MilestoneID)
16511652
}
16521653

1654+
if opts.ProjectID > 0 {
1655+
sess.Join("INNER", "project_issue", "issue.id = project_issue.issue_id").
1656+
And("project_issue.project_id=?", opts.ProjectID)
1657+
}
1658+
16531659
if opts.AssigneeID > 0 {
16541660
applyAssigneeCondition(sess, opts.AssigneeID)
16551661
}

options/locale/locale_en-US.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ never = Never
111111

112112
rss_feed = RSS Feed
113113

114+
[aria]
115+
navbar = Navigation Bar
116+
footer = Footer
117+
footer.software = About Software
118+
footer.links = Links
119+
114120
[filter]
115121
string.asc = A - Z
116122
string.desc = Z - A
@@ -1297,6 +1303,8 @@ issues.filter_label_exclude = `Use <code>alt</code> + <code>click/enter</code> t
12971303
issues.filter_label_no_select = All labels
12981304
issues.filter_milestone = Milestone
12991305
issues.filter_milestone_no_select = All milestones
1306+
issues.filter_project = Project
1307+
issues.filter_project_no_select = All projects
13001308
issues.filter_assignee = Assignee
13011309
issues.filter_assginee_no_select = All assignees
13021310
issues.filter_poster = Author

routers/web/repo/issue.go

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
203203
RepoID: repo.ID,
204204
Labels: selectLabels,
205205
MilestoneID: milestoneID,
206+
ProjectID: projectID,
206207
AssigneeID: assigneeID,
207208
MentionedID: mentionedID,
208209
PosterID: posterID,
@@ -362,25 +363,24 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
362363
return 0
363364
}
364365

365-
if ctx.Repo.CanWriteIssuesOrPulls(ctx.Params(":type") == "pulls") {
366-
projects, _, err := project_model.FindProjects(ctx, project_model.SearchOptions{
367-
RepoID: repo.ID,
368-
Type: project_model.TypeRepository,
369-
IsClosed: util.OptionalBoolOf(isShowClosed),
370-
})
371-
if err != nil {
372-
ctx.ServerError("GetProjects", err)
373-
return
374-
}
375-
ctx.Data["Projects"] = projects
366+
projects, _, err := project_model.FindProjects(ctx, project_model.SearchOptions{
367+
RepoID: repo.ID,
368+
Type: project_model.TypeRepository,
369+
IsClosed: util.OptionalBoolOf(isShowClosed),
370+
})
371+
if err != nil {
372+
ctx.ServerError("FindProjects", err)
373+
return
376374
}
375+
ctx.Data["Projects"] = projects
377376

378377
ctx.Data["IssueStats"] = issueStats
379378
ctx.Data["SelLabelIDs"] = labelIDs
380379
ctx.Data["SelectLabels"] = selectLabels
381380
ctx.Data["ViewType"] = viewType
382381
ctx.Data["SortType"] = sortType
383382
ctx.Data["MilestoneID"] = milestoneID
383+
ctx.Data["ProjectID"] = projectID
384384
ctx.Data["AssigneeID"] = assigneeID
385385
ctx.Data["PosterID"] = posterID
386386
ctx.Data["IsShowClosed"] = isShowClosed
@@ -397,6 +397,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
397397
pager.AddParam(ctx, "state", "State")
398398
pager.AddParam(ctx, "labels", "SelectLabels")
399399
pager.AddParam(ctx, "milestone", "MilestoneID")
400+
pager.AddParam(ctx, "project", "ProjectID")
400401
pager.AddParam(ctx, "assignee", "AssigneeID")
401402
pager.AddParam(ctx, "poster", "PosterID")
402403
ctx.Data["Page"] = pager
@@ -2352,6 +2353,8 @@ func SearchIssues(ctx *context.Context) {
23522353
includedMilestones = strings.Split(milestones, ",")
23532354
}
23542355

2356+
projectID := ctx.FormInt64("project")
2357+
23552358
// this api is also used in UI,
23562359
// so the default limit is set to fit UI needs
23572360
limit := ctx.FormInt("limit")
@@ -2374,6 +2377,7 @@ func SearchIssues(ctx *context.Context) {
23742377
IssueIDs: issueIDs,
23752378
IncludedLabelNames: includedLabelNames,
23762379
IncludeMilestones: includedMilestones,
2380+
ProjectID: projectID,
23772381
SortType: "priorityrepo",
23782382
PriorityRepoID: ctx.FormInt64("priority_repo_id"),
23792383
IsPull: isPull,
@@ -2511,6 +2515,8 @@ func ListIssues(ctx *context.Context) {
25112515
}
25122516
}
25132517

2518+
projectID := ctx.FormInt64("project")
2519+
25142520
listOptions := db.ListOptions{
25152521
Page: ctx.FormInt("page"),
25162522
PageSize: convert.ToCorrectPageSize(ctx.FormInt("limit")),
@@ -2550,6 +2556,7 @@ func ListIssues(ctx *context.Context) {
25502556
IssueIDs: issueIDs,
25512557
LabelIDs: labelIDs,
25522558
MilestoneIDs: mileIDs,
2559+
ProjectID: projectID,
25532560
IsPull: isPull,
25542561
UpdatedBeforeUnix: before,
25552562
UpdatedAfterUnix: since,

templates/base/footer_content.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<footer>
1+
<footer role="group" aria-label="{{.locale.Tr "aria.footer"}}">
22
<div class="ui container">
3-
<div class="ui left">
3+
<div class="ui left" role="contentinfo" aria-label="{{.locale.Tr "aria.footer.software"}}">
44
<a target="_blank" rel="noopener noreferrer" href="https://gitea.io">{{.locale.Tr "powered_by" "Gitea"}}</a>
55
{{if (or .ShowFooterVersion .PageIsAdmin)}}
66
{{.locale.Tr "version"}}:
@@ -15,7 +15,7 @@
1515
{{.locale.Tr "template"}}{{if .TemplateName}} {{.TemplateName}}{{end}}: <strong>{{call .TemplateLoadTimes}}</strong>
1616
{{end}}
1717
</div>
18-
<div class="ui right links">
18+
<div class="ui right links" role="group" aria-label="{{.locale.Tr "aria.footer.links"}}">
1919
{{if .ShowFooterBranding}}
2020
<a target="_blank" rel="noopener noreferrer" href="https://github.com/go-gitea/gitea">{{svg "octicon-mark-github"}}<span class="sr-only">GitHub</span></a>
2121
{{end}}

templates/base/head_navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="ui container" id="navbar">
1+
<div class="ui container" id="navbar" role="navigation" aria-label="{{.locale.Tr "aria.navbar"}}">
22
{{$notificationUnreadCount := 0}}
33
{{if .IsSigned}}
44
{{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}}

0 commit comments

Comments
 (0)