Skip to content

Commit bbce905

Browse files
authored
Feature: show issue assignee on project board (#15232)
* Show assignees in project boards.
1 parent 1546580 commit bbce905

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,7 @@ projects.board.deletion_desc = "Deleting a project board moves all related issue
11811181
projects.board.color = "Color"
11821182
projects.open = Open
11831183
projects.close = Close
1184+
projects.board.assigned_to = Assigned to
11841185
11851186
issues.desc = Organize bug reports, tasks and milestones.
11861187
issues.filter_assignees = Filter Assignee

templates/repo/projects/view.tmpl

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@
8282

8383
<div class="ui segment board-column" style="background: {{.Color}} !important;" data-id="{{.ID}}" data-sorting="{{.Sorting}}" data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}">
8484
<div class="board-column-header df ac sb">
85-
<div class="ui large label board-label py-2">{{.Title}}</div>
85+
<div class="ui large label board-label py-2">
86+
<div class="ui small circular grey label board-card-cnt">
87+
{{len .Issues}}
88+
</div>
89+
{{.Title}}
90+
</div>
8691
{{if and $.CanWriteProjects (not $.Repository.IsArchived) (ne .ID 0)}}
8792
<div class="ui dropdown jump item tooltip">
8893
<div class="not-mobile px-3" tabindex="-1">
@@ -229,13 +234,19 @@
229234
</div>
230235
{{- end }}
231236
</div>
232-
{{if .Labels}}
233-
<div class="extra content labels-list p-0 pt-2">
234-
{{ range .Labels }}
235-
<a class="ui label" href="{{$.RepoLink}}/issues?labels={{.ID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}};" title="{{.Description | RenderEmojiPlain}}">{{.Name | RenderEmoji}}</a>
237+
238+
{{ if or .Labels .Assignees }}
239+
<div class="extra content labels-list p-0 pt-2">
240+
{{ range .Labels }}
241+
<a class="ui label" target="_blank" href="{{$.RepoLink}}/issues?labels={{.ID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}};" title="{{.Description | RenderEmojiPlain}}">{{.Name | RenderEmoji}}</a>
242+
{{ end }}
243+
<div class="right floated">
244+
{{ range .Assignees }}
245+
<a class="tooltip" target="_blank" href="{{.HTMLURL}}" data-content="{{$.i18n.Tr "repo.projects.board.assigned_to"}} {{.Name}}">{{avatar . 28 "mini mr-3"}}</a>
236246
{{ end }}
237247
</div>
238-
{{end}}
248+
</div>
249+
{{ end }}
239250
</div>
240251
<!-- stop issue card -->
241252

web_src/js/features/repo-projects.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@ import $ from 'jquery';
22

33
const {csrfToken} = window.config;
44

5+
function updateIssueCount(cards) {
6+
const parent = cards.parentElement;
7+
const cnt = parent.getElementsByClassName('board-card').length;
8+
parent.getElementsByClassName('board-card-cnt')[0].innerText = cnt;
9+
}
10+
511
function moveIssue({item, from, to, oldIndex}) {
612
const columnCards = to.getElementsByClassName('board-card');
13+
updateIssueCount(from);
14+
updateIssueCount(to);
715

816
const columnSorting = {
917
issues: [...columnCards].map((card, i) => ({

web_src/less/features/projects.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
.board-column > .cards {
4949
flex: 1;
5050
display: flex;
51+
align-content: baseline;
5152
margin: 0 !important;
5253
padding: 0 !important;
5354
flex-wrap: nowrap !important;

0 commit comments

Comments
 (0)