diff --git a/templates/projects/board.html b/templates/projects/board.html index 283bd52..f4ed627 100644 --- a/templates/projects/board.html +++ b/templates/projects/board.html @@ -33,7 +33,10 @@ newTicketOpen: false, exportOpen: false, filterOpen: false, + filterOpen: false, manageStatusesOpen: false, + permissionsOpen: false, + allowedMoveToStatusIds: {{ allowed_move_to_status_ids }}, createStatusName: '', createStatusColor: '#6B7280', @@ -199,8 +202,8 @@ touch.clientY >= rect.top && touch.clientY <= rect.bottom) targetColumn = col; col.classList.remove('bg-blue-50', 'dark:bg-blue-900/20'); }); - {% if not can_move_to_completed %} - if (targetColumn && targetColumn.getAttribute('data-status-completed') === 'true') targetColumn = null; + {% if can_move %} + if (targetColumn && targetColumn.getAttribute('data-status-id') && !this.allowedMoveToStatusIds.includes(parseInt(targetColumn.getAttribute('data-status-id')))) targetColumn = null; {% endif %} if (targetColumn && targetColumn !== originalColumn) this.moveTicketToStatus(this.draggingTicket, targetColumn.getAttribute('data-status-id')); @@ -224,8 +227,8 @@ col.addEventListener('drop', (e) => { e.preventDefault(); col.classList.remove('bg-blue-50', 'dark:bg-blue-900/20'); - {% if not can_move_to_completed %} - if (col.getAttribute('data-status-completed') === 'true') return; + {% if can_move %} + if (col.getAttribute('data-status-id') && !this.allowedMoveToStatusIds.includes(parseInt(col.getAttribute('data-status-id')))) return; {% endif %} if (this.draggingTicket) { this.moveTicketToStatus(this.draggingTicket, col.getAttribute('data-status-id')); @@ -316,6 +319,9 @@ class="space-y-6" Filter {% if selected_user_ids %}{{ selected_user_ids|length }}{% endif %} {% if is_admin %} + @@ -368,10 +374,10 @@ class="space-y-6" View Only ModeYou can view tickets but cannot move them -{% elif not can_move_to_completed %} +{% elif can_move and allowed_move_to_status_ids|length < columns|length %}
| Role | +Can move to | +Actions | +
|---|---|---|
| {{ perm.get_role_display }} | +
+
+ {% for status in perm.move_to_statuses.all %}
+
+
+ {{ status.name }}
+
+ {% empty %}
+ None
+ {% endfor %}
+
+ |
+ + + | +
| No permissions configured. All non-admin roles are restricted by default. | ||
Superadmin and manager roles always have full access. Select the statuses a developer role can move tickets to.
+| Role | +Can move to | +Actions | +
|---|---|---|
| {{ perm.get_role_display }} | +
+
+ {% for status in perm.move_to_statuses.all %}
+
+
+ {{ status.name }}
+
+ {% empty %}
+ None
+ {% endfor %}
+
+ |
+ + + | +
| No permissions configured. All non-admin roles are restricted by default. | ||
Superadmin and manager roles always have full access. Select the statuses a developer role can move tickets to.
+