2023-08-12 10:30:28 +00:00
|
|
|
{{$canWriteProject := and .CanWriteProjects (or (not .Repository) (not .Repository.IsArchived))}}
|
|
|
|
|
2024-04-23 04:17:51 +00:00
|
|
|
<div class="ui container tw-max-w-full">
|
|
|
|
<div class="tw-flex tw-justify-between tw-items-center tw-mb-4 tw-gap-3">
|
|
|
|
<h2 class="tw-mb-0 tw-flex-1 tw-break-anywhere">{{.Project.Title}}</h2>
|
2024-09-12 03:53:40 +00:00
|
|
|
<div class="project-toolbar-right">
|
|
|
|
<div class="ui secondary filter menu labels">
|
Refactor issue filter (labels, poster, assignee) (#32771)
Rewrite a lot of legacy strange code, remove duplicate code, remove
jquery, and make these filters reusable.
Let's forget the old code, new code affects:
* issue list open/close switch
* issue list filter (label, author, assignee)
* milestone list open/close switch
* milestone issue list filter (label, author, assignee)
* project view (label, assignee)
2024-12-10 03:38:22 +00:00
|
|
|
{{$queryLink := QueryBuild "?" "labels" .SelectLabels "assignee" $.AssigneeID "archived_labels" (Iif $.ShowArchivedLabels "true")}}
|
2024-09-12 03:53:40 +00:00
|
|
|
|
Refactor issue filter (labels, poster, assignee) (#32771)
Rewrite a lot of legacy strange code, remove duplicate code, remove
jquery, and make these filters reusable.
Let's forget the old code, new code affects:
* issue list open/close switch
* issue list filter (label, author, assignee)
* milestone list open/close switch
* milestone issue list filter (label, author, assignee)
* project view (label, assignee)
2024-12-10 03:38:22 +00:00
|
|
|
{{template "repo/issue/filter_item_label" dict "Labels" .Labels "QueryLink" $queryLink "SupportArchivedLabel" true}}
|
|
|
|
|
|
|
|
{{template "repo/issue/filter_item_user_assign" dict
|
|
|
|
"QueryParamKey" "assignee"
|
|
|
|
"QueryLink" $queryLink
|
|
|
|
"UserSearchList" $.Assignees
|
|
|
|
"SelectedUserId" $.AssigneeID
|
|
|
|
"TextFilterTitle" (ctx.Locale.Tr "repo.issues.filter_assignee")
|
|
|
|
"TextZeroValue" (ctx.Locale.Tr "repo.issues.filter_assginee_no_select")
|
|
|
|
"TextNegativeOne" (ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee")
|
|
|
|
}}
|
2024-09-12 03:53:40 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-11-27 17:43:52 +00:00
|
|
|
{{if $canWriteProject}}
|
|
|
|
<div class="ui compact mini menu">
|
|
|
|
<a class="item" href="{{.Link}}/edit?redirect=project">
|
|
|
|
{{svg "octicon-pencil"}}
|
|
|
|
{{ctx.Locale.Tr "repo.issues.label_edit"}}
|
|
|
|
</a>
|
|
|
|
{{if .Project.IsClosed}}
|
|
|
|
<button class="item btn link-action" data-url="{{.Link}}/open">
|
|
|
|
{{svg "octicon-check"}}
|
|
|
|
{{ctx.Locale.Tr "repo.projects.open"}}
|
|
|
|
</button>
|
|
|
|
{{else}}
|
|
|
|
<button class="item btn link-action" data-url="{{.Link}}/close">
|
|
|
|
{{svg "octicon-skip"}}
|
|
|
|
{{ctx.Locale.Tr "repo.projects.close"}}
|
|
|
|
</button>
|
|
|
|
{{end}}
|
2024-12-19 08:37:12 +00:00
|
|
|
<button class="item btn link-action" data-url="{{.Link}}/delete?id={{.Project.ID}}"
|
|
|
|
data-modal-confirm-header="{{ctx.Locale.Tr "repo.projects.deletion"}}"
|
|
|
|
data-modal-confirm-content="{{ctx.Locale.Tr "repo.projects.deletion_desc"}}"
|
|
|
|
>
|
2023-11-27 17:43:52 +00:00
|
|
|
{{svg "octicon-trash"}}
|
|
|
|
{{ctx.Locale.Tr "repo.issues.label_delete"}}
|
2023-08-12 10:30:28 +00:00
|
|
|
</button>
|
2024-12-19 08:37:12 +00:00
|
|
|
<button class="item btn show-modal show-project-column-modal-edit" data-modal="#project-column-modal-edit"
|
|
|
|
data-modal-header="{{ctx.Locale.Tr "repo.projects.column.new"}}"
|
|
|
|
data-modal-project-column-title-label="{{ctx.Locale.Tr "repo.projects.column.new_title"}}"
|
|
|
|
data-modal-project-column-button-save="{{ctx.Locale.Tr "repo.projects.column.new_submit"}}"
|
|
|
|
data-modal-project-column-id=""
|
|
|
|
data-modal-project-column-title-input=""
|
|
|
|
data-modal-project-column-color-input=""
|
|
|
|
>
|
2023-11-27 17:43:52 +00:00
|
|
|
{{svg "octicon-plus"}}
|
|
|
|
{{ctx.Locale.Tr "new_project_column"}}
|
2023-08-12 10:30:28 +00:00
|
|
|
</button>
|
2023-01-20 11:42:33 +00:00
|
|
|
</div>
|
2023-11-27 17:43:52 +00:00
|
|
|
{{end}}
|
|
|
|
</div>
|
2023-07-07 15:27:12 +00:00
|
|
|
|
2024-03-01 07:11:51 +00:00
|
|
|
<div class="content">{{$.Project.RenderedContent}}</div>
|
2023-08-12 10:30:28 +00:00
|
|
|
|
2023-11-27 17:43:52 +00:00
|
|
|
<div class="divider"></div>
|
|
|
|
</div>
|
2023-01-20 11:42:33 +00:00
|
|
|
|
2024-12-19 08:37:12 +00:00
|
|
|
<div id="project-board" data-project-borad-writable="{{$canWriteProject}}">
|
|
|
|
<div class="board {{if $canWriteProject}}sortable{{end}}" {{if $canWriteProject}}data-url="{{$.Link}}/move"{{end}}>
|
2023-08-12 10:30:28 +00:00
|
|
|
{{range .Columns}}
|
2024-12-19 08:37:12 +00:00
|
|
|
<div class="project-column" {{if .Color}}style="background: {{.Color}} !important; color: {{ContrastColor .Color}} !important"{{end}} data-id="{{.ID}}" data-sorting="{{.Sorting}}" data-url="{{$.Link}}/{{.ID}}">
|
2024-03-27 23:20:38 +00:00
|
|
|
<div class="project-column-header{{if $canWriteProject}} tw-cursor-grab{{end}}">
|
2024-05-20 05:21:01 +00:00
|
|
|
<div class="ui circular label project-column-issue-count">
|
|
|
|
{{.NumIssues ctx}}
|
2023-08-12 10:30:28 +00:00
|
|
|
</div>
|
2024-12-19 08:37:12 +00:00
|
|
|
<div class="project-column-title-text gt-ellipsis">{{.Title}}</div>
|
2024-03-27 20:54:32 +00:00
|
|
|
{{if $canWriteProject}}
|
2024-05-20 05:21:01 +00:00
|
|
|
<div class="ui dropdown tw-p-1">
|
|
|
|
{{svg "octicon-kebab-horizontal"}}
|
|
|
|
<div class="menu">
|
2024-12-19 08:37:12 +00:00
|
|
|
<a class="item button show-modal show-project-column-modal-edit" data-modal="#project-column-modal-edit"
|
|
|
|
data-modal-header="{{ctx.Locale.Tr "repo.projects.column.edit"}}"
|
|
|
|
data-modal-project-column-title-label="{{ctx.Locale.Tr "repo.projects.column.edit_title"}}"
|
|
|
|
data-modal-project-column-button-save="{{ctx.Locale.Tr "repo.projects.column.edit"}}"
|
|
|
|
data-modal-project-column-id="{{.ID}}"
|
|
|
|
data-modal-project-column-title-input="{{.Title}}"
|
|
|
|
data-modal-project-column-color-input="{{.Color}}"
|
|
|
|
>
|
|
|
|
{{svg "octicon-pencil"}} {{ctx.Locale.Tr "repo.projects.column.edit"}}
|
2023-01-20 11:42:33 +00:00
|
|
|
</a>
|
2023-08-12 10:30:28 +00:00
|
|
|
{{if not .Default}}
|
2024-12-19 08:37:12 +00:00
|
|
|
<a class="item button link-action" data-url="{{$.Link}}/{{.ID}}/default"
|
|
|
|
data-modal-confirm-header="{{ctx.Locale.Tr "repo.projects.column.set_default"}}"
|
|
|
|
data-modal-confirm-content="{{ctx.Locale.Tr "repo.projects.column.set_default_desc"}}"
|
|
|
|
>
|
|
|
|
{{svg "octicon-pin"}} {{ctx.Locale.Tr "repo.projects.column.set_default"}}
|
2023-08-12 10:30:28 +00:00
|
|
|
</a>
|
2024-12-19 08:37:12 +00:00
|
|
|
<a class="item button link-action" data-url="{{$.Link}}/{{.ID}}" data-link-action-method="DELETE"
|
|
|
|
data-modal-confirm-header="{{ctx.Locale.Tr "repo.projects.column.delete"}}"
|
|
|
|
data-modal-confirm-content="{{ctx.Locale.Tr "repo.projects.column.deletion_desc"}}"
|
|
|
|
>
|
|
|
|
{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.projects.column.delete"}}
|
2023-08-12 10:30:28 +00:00
|
|
|
</a>
|
|
|
|
{{end}}
|
2023-01-20 11:42:33 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-07-07 18:06:49 +00:00
|
|
|
{{end}}
|
2023-08-12 10:30:28 +00:00
|
|
|
</div>
|
2024-04-07 16:19:25 +00:00
|
|
|
<div class="divider"{{if .Color}} style="color: {{ContrastColor .Color}} !important"{{end}}></div>
|
2024-03-27 23:20:38 +00:00
|
|
|
<div class="ui cards" data-url="{{$.Link}}/{{.ID}}" data-project="{{$.Project.ID}}" data-board="{{.ID}}" id="board_{{.ID}}">
|
2023-08-12 10:30:28 +00:00
|
|
|
{{range (index $.IssuesMap .ID)}}
|
2024-06-04 13:57:11 +00:00
|
|
|
<div class="issue-card tw-break-anywhere {{if $canWriteProject}}tw-cursor-grab{{end}}" data-issue="{{.ID}}">
|
2023-08-12 10:30:28 +00:00
|
|
|
{{template "repo/issue/card" (dict "Issue" . "Page" $)}}
|
2023-01-20 11:42:33 +00:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-07-07 18:06:49 +00:00
|
|
|
{{end}}
|
2023-01-20 11:42:33 +00:00
|
|
|
</div>
|
2023-07-07 18:06:49 +00:00
|
|
|
</div>
|
|
|
|
|
2024-12-19 08:37:12 +00:00
|
|
|
{{if $canWriteProject}}
|
|
|
|
<div class="ui small modal" id="project-column-modal-edit">
|
|
|
|
<div class="header">edit</div>
|
|
|
|
<div class="content">
|
|
|
|
<form class="ui form ignore-dirty" method="post" data-action-base-link="{{$.Link}}">
|
|
|
|
<input class="project-column-id" type="hidden" name="id">
|
|
|
|
<div class="required field">
|
|
|
|
<label class="project-column-title-label" for="project-column-title-input">title</label>
|
|
|
|
<input id="project-column-title-input" name="title" value="{{.Title}}" required>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label class="project-column-color-label" for="project-column-color-input">color</label>
|
|
|
|
<div class="js-color-picker-input column">
|
|
|
|
<input maxlength="7" placeholder="#c320f6" id="project-column-color-input" name="color" value="{{.Color}}">
|
|
|
|
{{template "repo/issue/label_precolors"}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="actions tw-text-right">
|
|
|
|
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
|
|
|
<button type="submit" class="ui primary button project-column-button-save">save</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
2023-01-20 11:42:33 +00:00
|
|
|
</div>
|
2024-12-19 08:37:12 +00:00
|
|
|
</div>
|
2023-01-20 11:42:33 +00:00
|
|
|
{{end}}
|