2023-08-12 13:30:28 +03:00
{{ $ canWriteProject : = and .CanWriteProjects ( or ( not .Repository ) ( not .Repository .IsArchived ) ) }}
<div class="gt-df gt-sb gt-ac gt-mb-4">
<h2 class="gt-mb-0"> {{ .Project .Title }} </h2>
{{ 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 }}
<button class="item btn delete-button" data-url=" {{ .Link }} /delete" data-id=" {{ .Project .ID }} ">
{{ svg "octicon-trash" }}
{{ ctx .Locale .Tr "repo.issues.label_delete" }}
</button>
<button class="item btn show-modal" data-modal="#new-project-column-item">
{{ svg "octicon-plus" }}
{{ ctx .Locale .Tr "new_project_column" }}
</button>
</div>
<div class="ui small modal new-project-column-modal" id="new-project-column-item">
2023-07-07 21:06:49 +03:00
<div class="header">
2023-08-12 13:30:28 +03:00
{{ ctx .Locale .Tr "repo.projects.column.new" }}
2023-01-20 14:42:33 +03:00
</div>
2023-07-07 21:06:49 +03:00
<div class="content">
<form class="ui form">
<div class="required field">
2023-08-12 13:30:28 +03:00
<label for="new_project_column"> {{ ctx .Locale .Tr "repo.projects.column.new_title" }} </label>
<input class="new-project-column" id="new_project_column" name="title" required>
2023-01-20 14:42:33 +03:00
</div>
2023-07-07 21:06:49 +03:00
<div class="field color-field">
2023-08-12 13:30:28 +03:00
<label for="new_project_column_color"> {{ ctx .Locale .Tr "repo.projects.column.color" }} </label>
2023-07-07 21:06:49 +03:00
<div class="color picker column">
2023-08-12 13:30:28 +03:00
<input class="color-picker" maxlength="7" placeholder="#c320f6" id="new_project_column_color_picker" name="color">
2023-08-28 17:14:51 +03:00
{{ template "repo/issue/label_precolors" }}
2023-07-07 21:06:49 +03:00
</div>
</div>
2023-01-20 14:42:33 +03:00
2023-07-07 21:06:49 +03:00
<div class="text right actions">
2023-08-12 13:30:28 +03:00
<button class="ui cancel button"> {{ ctx .Locale .Tr "settings.cancel" }} </button>
<button data-url=" {{ $ .Link }} " class="ui primary button" id="new_project_column_submit"> {{ ctx .Locale .Tr "repo.projects.column.new_submit" }} </button>
2023-01-20 14:42:33 +03:00
</div>
2023-07-07 21:06:49 +03:00
</form>
2023-01-20 14:42:33 +03:00
</div>
</div>
2023-07-07 21:06:49 +03:00
{{ end }}
</div>
2023-07-07 18:27:12 +03:00
2023-08-12 13:30:28 +03:00
<div class="content"> {{ $ .Project .RenderedContent | Str2html }} </div>
2023-07-07 21:06:49 +03:00
<div class="divider"></div>
2023-01-20 14:42:33 +03:00
2023-07-07 21:06:49 +03:00
<div id="project-board">
<div class="board {{ if .CanWriteProjects }} sortable {{ end }} ">
2023-08-12 13:30:28 +03:00
{{ range .Columns }}
<div class="ui segment project-column" style="background: {{ .Color }} !important;" data-id=" {{ .ID }} " data-sorting=" {{ .Sorting }} " data-url=" {{ $ .Link }} / {{ .ID }} ">
<div class="project-column-header">
<div class="ui large label project-column-title gt-py-2">
<div class="ui small circular grey label project-column-issue-count">
2023-09-29 15:12:54 +03:00
{{ .NumIssues ctx }}
2023-07-07 21:06:49 +03:00
</div>
2023-08-12 13:30:28 +03:00
{{ .Title }}
</div>
{{ if and $ canWriteProject ( ne .ID 0 ) }}
<div class="ui dropdown jump item">
2023-08-26 05:44:00 +03:00
<div class="gt-px-3">
2023-08-12 13:30:28 +03:00
{{ svg "octicon-kebab-horizontal" }}
</div>
2023-08-26 05:44:00 +03:00
<div class="menu user-menu">
2023-08-12 13:30:28 +03:00
<a class="item show-modal button" data-modal="#edit-project-column-modal- {{ .ID }} ">
{{ svg "octicon-pencil" }}
{{ ctx .Locale .Tr "repo.projects.column.edit" }}
2023-01-20 14:42:33 +03:00
</a>
2023-08-12 13:30:28 +03:00
{{ if not .Default }}
<a class="item show-modal button default-project-column-show"
data-modal="#default-project-column-modal- {{ .ID }} "
data-modal-default-project-column-header=" {{ ctx .Locale .Tr "repo.projects.column.set_default" }} "
data-modal-default-project-column-content=" {{ ctx .Locale .Tr "repo.projects.column.set_default_desc" }} "
data-url=" {{ $ .Link }} / {{ .ID }} /default">
{{ svg "octicon-pin" }}
{{ ctx .Locale .Tr "repo.projects.column.set_default" }}
</a>
{{ else }}
<a class="item show-modal button default-project-column-show"
data-modal="#default-project-column-modal- {{ .ID }} "
data-modal-default-project-column-header=" {{ ctx .Locale .Tr "repo.projects.column.unset_default" }} "
data-modal-default-project-column-content=" {{ ctx .Locale .Tr "repo.projects.column.unset_default_desc" }} "
data-url=" {{ $ .Link }} / {{ .ID }} /unsetdefault">
{{ svg "octicon-pin-slash" }}
{{ ctx .Locale .Tr "repo.projects.column.unset_default" }}
</a>
{{ end }}
<a class="item show-modal button show-delete-project-column-modal"
data-modal="#delete-project-column-modal- {{ .ID }} "
data-url=" {{ $ .Link }} / {{ .ID }} ">
{{ svg "octicon-trash" }}
{{ ctx .Locale .Tr "repo.projects.column.delete" }}
2023-01-20 14:42:33 +03:00
</a>
2023-08-12 13:30:28 +03:00
<div class="ui small modal edit-project-column-modal" id="edit-project-column-modal- {{ .ID }} ">
<div class="header">
{{ ctx .Locale .Tr "repo.projects.column.edit" }}
</div>
<div class="content">
<form class="ui form">
<div class="required field">
<label for="new_project_column_title"> {{ ctx .Locale .Tr "repo.projects.column.edit_title" }} </label>
<input class="project-column-title-input" id="new_project_column_title" name="title" value=" {{ .Title }} " required>
</div>
2023-01-20 14:42:33 +03:00
2023-08-12 13:30:28 +03:00
<div class="field color-field">
<label for="new_project_column_color"> {{ ctx .Locale .Tr "repo.projects.column.color" }} </label>
<div class="color picker column">
<input class="color-picker" maxlength="7" placeholder="#c320f6" id="new_project_column_color" name="color" value=" {{ .Color }} ">
2023-08-28 17:14:51 +03:00
{{ template "repo/issue/label_precolors" }}
2023-01-20 14:42:33 +03:00
</div>
</div>
2023-08-12 13:30:28 +03:00
<div class="text right actions">
<button class="ui cancel button"> {{ ctx .Locale .Tr "settings.cancel" }} </button>
<button data-url=" {{ $ .Link }} / {{ .ID }} " class="ui primary button edit-project-column-button"> {{ ctx .Locale .Tr "repo.projects.column.edit" }} </button>
</div>
</form>
</div>
2023-01-20 14:42:33 +03:00
</div>
2023-08-12 13:30:28 +03:00
<div class="ui g-modal-confirm modal default-project-column-modal" id="default-project-column-modal- {{ .ID }} ">
<div class="header">
<span id="default-project-column-header"></span>
</div>
<div class="content">
<label id="default-project-column-content"></label>
</div>
2023-09-24 23:31:58 +03:00
{{ template "base/modal_actions_confirm" ( dict "ModalButtonTypes" "confirm" ) }}
2023-01-20 14:42:33 +03:00
</div>
2023-08-12 13:30:28 +03:00
<div class="ui g-modal-confirm modal" id="delete-project-column-modal- {{ .ID }} ">
<div class="header">
{{ ctx .Locale .Tr "repo.projects.column.delete" }}
</div>
<div class="content">
<label>
{{ ctx .Locale .Tr "repo.projects.column.deletion_desc" }}
</label>
</div>
2023-09-24 23:31:58 +03:00
{{ template "base/modal_actions_confirm" ( dict "ModalButtonTypes" "confirm" ) }}
2023-07-07 21:06:49 +03:00
</div>
2023-01-20 14:42:33 +03:00
</div>
</div>
2023-07-07 21:06:49 +03:00
{{ end }}
2023-08-12 13:30:28 +03:00
</div>
2023-01-20 14:42:33 +03:00
2023-08-12 13:30:28 +03:00
<div class="divider"></div>
2023-08-14 04:15:16 +03:00
<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 }} ">
2023-08-12 13:30:28 +03:00
{{ range ( in dex $ .IssuesMap .ID ) }}
2023-08-14 04:15:16 +03:00
<div class="issue-card gt-word-break {{ if $ canWriteProject }} gt-cursor-grab {{ end }} " data-issue=" {{ .ID }} ">
2023-08-12 13:30:28 +03:00
{{ template "repo/issue/card" ( dict "Issue" . "Page" $ ) }}
2023-01-20 14:42:33 +03:00
</div>
{{ end }}
</div>
</div>
2023-07-07 21:06:49 +03:00
{{ end }}
2023-01-20 14:42:33 +03:00
</div>
2023-07-07 21:06:49 +03:00
</div>
2023-03-12 16:36:47 +03:00
{{ if .CanWriteProjects }}
2023-04-24 14:08:59 +03:00
<div class="ui g-modal-confirm delete modal">
2023-04-23 12:24:19 +03:00
<div class="header">
2023-01-20 14:42:33 +03:00
{{ svg "octicon-trash" }}
2023-08-12 13:30:28 +03:00
{{ ctx .Locale .Tr "repo.projects.deletion" }}
2023-01-20 14:42:33 +03:00
</div>
<div class="content">
2023-08-12 13:30:28 +03:00
<p> {{ ctx .Locale .Tr "repo.projects.deletion_desc" }} </p>
2023-01-20 14:42:33 +03:00
</div>
2023-04-23 12:24:19 +03:00
{{ template "base/modal_actions_confirm" . }}
2023-01-20 14:42:33 +03:00
</div>
{{ end }}