|
1 | 1 | {{$canWriteProject := and .CanWriteProjects (or (not .Repository) (not .Repository.IsArchived))}} |
2 | 2 |
|
3 | | -<div class="ui container"> |
4 | | - <div class="gt-df gt-sb gt-ac gt-mb-4"> |
5 | | - <h2 class="gt-mb-0">{{.Project.Title}}</h2> |
6 | | - {{if $canWriteProject}} |
7 | | - <div class="ui compact mini menu"> |
8 | | - <a class="item" href="{{.Link}}/edit?redirect=project"> |
9 | | - {{svg "octicon-pencil"}} |
10 | | - {{ctx.Locale.Tr "repo.issues.label_edit"}} |
11 | | - </a> |
12 | | - {{if .Project.IsClosed}} |
13 | | - <button class="item btn link-action" data-url="{{.Link}}/open"> |
14 | | - {{svg "octicon-check"}} |
15 | | - {{ctx.Locale.Tr "repo.projects.open"}} |
16 | | - </button> |
17 | | - {{else}} |
18 | | - <button class="item btn link-action" data-url="{{.Link}}/close"> |
19 | | - {{svg "octicon-skip"}} |
20 | | - {{ctx.Locale.Tr "repo.projects.close"}} |
21 | | - </button> |
22 | | - {{end}} |
23 | | - <button class="item btn delete-button" data-url="{{.Link}}/delete" data-id="{{.Project.ID}}"> |
24 | | - {{svg "octicon-trash"}} |
25 | | - {{ctx.Locale.Tr "repo.issues.label_delete"}} |
| 3 | +<div class="gt-df gt-sb gt-ac gt-mb-4"> |
| 4 | + <h2 class="gt-mb-0">{{.Project.Title}}</h2> |
| 5 | + {{if $canWriteProject}} |
| 6 | + <div class="ui compact mini menu"> |
| 7 | + <a class="item" href="{{.Link}}/edit?redirect=project"> |
| 8 | + {{svg "octicon-pencil"}} |
| 9 | + {{ctx.Locale.Tr "repo.issues.label_edit"}} |
| 10 | + </a> |
| 11 | + {{if .Project.IsClosed}} |
| 12 | + <button class="item btn link-action" data-url="{{.Link}}/open"> |
| 13 | + {{svg "octicon-check"}} |
| 14 | + {{ctx.Locale.Tr "repo.projects.open"}} |
26 | 15 | </button> |
27 | | - <button class="item btn show-modal" data-modal="#new-project-column-item"> |
28 | | - {{svg "octicon-plus"}} |
29 | | - {{ctx.Locale.Tr "new_project_column"}} |
| 16 | + {{else}} |
| 17 | + <button class="item btn link-action" data-url="{{.Link}}/close"> |
| 18 | + {{svg "octicon-skip"}} |
| 19 | + {{ctx.Locale.Tr "repo.projects.close"}} |
30 | 20 | </button> |
| 21 | + {{end}} |
| 22 | + <button class="item btn delete-button" data-url="{{.Link}}/delete" data-id="{{.Project.ID}}"> |
| 23 | + {{svg "octicon-trash"}} |
| 24 | + {{ctx.Locale.Tr "repo.issues.label_delete"}} |
| 25 | + </button> |
| 26 | + <button class="item btn show-modal" data-modal="#new-project-column-item"> |
| 27 | + {{svg "octicon-plus"}} |
| 28 | + {{ctx.Locale.Tr "new_project_column"}} |
| 29 | + </button> |
| 30 | + </div> |
| 31 | + <div class="ui small modal new-project-column-modal" id="new-project-column-item"> |
| 32 | + <div class="header"> |
| 33 | + {{ctx.Locale.Tr "repo.projects.column.new"}} |
31 | 34 | </div> |
32 | | - <div class="ui small modal new-project-column-modal" id="new-project-column-item"> |
33 | | - <div class="header"> |
34 | | - {{ctx.Locale.Tr "repo.projects.column.new"}} |
35 | | - </div> |
36 | | - <div class="content"> |
37 | | - <form class="ui form"> |
38 | | - <div class="required field"> |
39 | | - <label for="new_project_column">{{ctx.Locale.Tr "repo.projects.column.new_title"}}</label> |
40 | | - <input class="new-project-column" id="new_project_column" name="title" required> |
41 | | - </div> |
| 35 | + <div class="content"> |
| 36 | + <form class="ui form"> |
| 37 | + <div class="required field"> |
| 38 | + <label for="new_project_column">{{ctx.Locale.Tr "repo.projects.column.new_title"}}</label> |
| 39 | + <input class="new-project-column" id="new_project_column" name="title" required> |
| 40 | + </div> |
42 | 41 |
|
43 | | - <div class="field color-field"> |
44 | | - <label for="new_project_column_color">{{ctx.Locale.Tr "repo.projects.column.color"}}</label> |
45 | | - <div class="color picker column"> |
46 | | - <input class="color-picker" maxlength="7" placeholder="#c320f6" id="new_project_column_color_picker" name="color"> |
47 | | - {{template "repo/issue/label_precolors"}} |
48 | | - </div> |
| 42 | + <div class="field color-field"> |
| 43 | + <label for="new_project_column_color">{{ctx.Locale.Tr "repo.projects.column.color"}}</label> |
| 44 | + <div class="color picker column"> |
| 45 | + <input class="color-picker" maxlength="7" placeholder="#c320f6" id="new_project_column_color_picker" name="color"> |
| 46 | + {{template "repo/issue/label_precolors"}} |
49 | 47 | </div> |
| 48 | + </div> |
50 | 49 |
|
51 | | - <div class="text right actions"> |
52 | | - <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> |
53 | | - <button data-url="{{$.Link}}" class="ui primary button" id="new_project_column_submit">{{ctx.Locale.Tr "repo.projects.column.new_submit"}}</button> |
| 50 | + {{if .Labels }} |
| 51 | + <!-- Label --> |
| 52 | + <div class="ui dropdown jump item label-filter" > |
| 53 | + <span class="text"> |
| 54 | + Choose label |
| 55 | + {{svg "octicon-triangle-down" 14 "dropdown icon"}} |
| 56 | + </span> |
| 57 | + <div class="menu" style="max-height:300px;overflow-y: scroll;"> |
| 58 | + <div class="ui icon search input"> |
| 59 | + <i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i> |
| 60 | + <input type="text" id="new_project_column_label" name="label" placeholder="{{.locale.Tr "repo.issues.filter_label"}}"> |
| 61 | + </div> |
| 62 | + {{$previousExclusiveScope := "_no_scope"}} |
| 63 | + {{range .Labels}} |
| 64 | + {{$exclusiveScope := .ExclusiveScope}} |
| 65 | + {{if and (ne $previousExclusiveScope $exclusiveScope)}} |
| 66 | + <div class="divider"></div> |
| 67 | + {{end}} |
| 68 | + {{$previousExclusiveScope = $exclusiveScope}} |
| 69 | + <div class="item label-filter-item labels-for-project-creation" data-label-id="{{.ID}}" >{{RenderLabel $.Context .}}</div> |
| 70 | + {{end}} |
| 71 | + </div> |
54 | 72 | </div> |
55 | | - </form> |
56 | | - </div> |
| 73 | + <input name="label" id="new_project_column_project_label" class="gt-mb-4"> |
| 74 | + <input name="labelId" id="new_project_column_project_label_id" type="number" style="display: none;"> |
| 75 | + {{end}} |
| 76 | + <div class="text right actions"> |
| 77 | + <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button> |
| 78 | + <button data-url="{{$.Link}}" class="ui primary button" id="new_project_column_submit">{{ctx.Locale.Tr "repo.projects.column.new_submit"}}</button> |
| 79 | + </div> |
| 80 | + </form> |
57 | 81 | </div> |
58 | | - {{end}} |
59 | | - </div> |
| 82 | + </div> |
| 83 | + {{end}} |
| 84 | +</div> |
60 | 85 |
|
61 | | - <div class="content">{{$.Project.RenderedContent|Str2html}}</div> |
| 86 | +<div class="content">{{$.Project.RenderedContent|Str2html}}</div> |
62 | 87 |
|
63 | | - <div class="divider"></div> |
64 | | -</div> |
| 88 | +<div class="divider"></div> |
65 | 89 |
|
66 | 90 | <div id="project-board"> |
67 | 91 | <div class="board {{if .CanWriteProjects}}sortable{{end}}"> |
|
165 | 189 |
|
166 | 190 | <div class="divider"></div> |
167 | 191 |
|
| 192 | + {{- $currentColumnLabelID := .LabelID }} |
168 | 193 | <div class="ui cards {{if and $canWriteProject (ne .ID 0)}}{{/* ID 0 is default column which cannot be moved */}}gt-cursor-grab{{end}}" data-url="{{$.Link}}/{{.ID}}" data-project="{{$.Project.ID}}" data-board="{{.ID}}" id="board_{{.ID}}"> |
169 | 194 | {{range (index $.IssuesMap .ID)}} |
170 | | - <div class="issue-card gt-word-break {{if $canWriteProject}}gt-cursor-grab{{end}}" data-issue="{{.ID}}"> |
| 195 | + <div class="issue-card gt-word-break {{if $canWriteProject}}gt-cursor-grab{{end}}" data-issue="{{.ID}}" data-column-label-id="{{$currentColumnLabelID}}"> |
171 | 196 | {{template "repo/issue/card" (dict "Issue" . "Page" $)}} |
172 | 197 | </div> |
173 | 198 | {{end}} |
|
0 commit comments