+{% endif %}
+{% endwith %}
diff --git a/base/templates/cbv/rotating_shift/rotating_shift_detail_actions.html b/base/templates/cbv/rotating_shift/rotating_shift_detail_actions.html
index 71c74c14a..ce099f30d 100644
--- a/base/templates/cbv/rotating_shift/rotating_shift_detail_actions.html
+++ b/base/templates/cbv/rotating_shift/rotating_shift_detail_actions.html
@@ -1,80 +1,47 @@
{% load basefilters%}
-
{% load i18n %}
-
- {% if perms.base.change_rotatingshiftassign or request.user|is_reportingmanager %}
-
-
-
-
- {% endif %}
- {% if perms.base.delete_rotatingshiftassign or request.user|is_reportingmanager %}
-
- {% endif %}
+{% is_manager_of request.user instance as can_manage %}
+{% if perms.base.change_rotatingshiftassign or can_manage %}
+
+
+
+
+{% endif %}
+{% if perms.base.delete_rotatingshiftassign or can_manage %}
+
+{% endif %}
- {% if request.GET.detail %}
-
- {% endif %}
+{% if request.GET.detail %}
+
+{% endif %}
diff --git a/base/templates/cbv/rotating_work_type/rotate_detail_view_actions.html b/base/templates/cbv/rotating_work_type/rotate_detail_view_actions.html
index 701be0cce..c7e983c8f 100644
--- a/base/templates/cbv/rotating_work_type/rotate_detail_view_actions.html
+++ b/base/templates/cbv/rotating_work_type/rotate_detail_view_actions.html
@@ -1,70 +1,41 @@
{% load basefilters%}
-
{% load i18n %}
-
-
- {% if perms.base.change_rotatingworktypeassign or request.user|is_reportingmanager %}
-
- {% trans "Edit" %}
-
-
- {% endif %}
- {% if perms.base.delete_rotatingshiftassign or request.user|is_reportingmanager %}
-
- {% endif %}
+{% is_manager_of request.user instance as can_manage %}
+{% if perms.base.change_rotatingworktypeassign or can_manage %}
+
+ {% trans "Edit" %}
+
+
+{% endif %}
+{% if perms.base.delete_rotatingshiftassign or can_manage %}
+
+{% endif %}
{% if request.GET.deleted %}
-
+
{% endif %}
diff --git a/base/templates/cbv/rotating_work_type/work_rotate_actions.html b/base/templates/cbv/rotating_work_type/work_rotate_actions.html
index b297cad48..551f782cc 100644
--- a/base/templates/cbv/rotating_work_type/work_rotate_actions.html
+++ b/base/templates/cbv/rotating_work_type/work_rotate_actions.html
@@ -1,37 +1,39 @@
{% load i18n %}
{% load basefilters %}
-
+{% is_manager_of request.user instance as can_manage %}
+{% with can_change=perms.base.change_rotatingworktypeassign can_delete=perms.base.delete_rotatingworktypeassign %}
+{% if can_change or can_delete or can_manage %}
- {% if perms.base.change_rotatingworktypeassign or request.user|is_reportingmanager %}
+ {% if can_change or can_manage %}
{% endif %}
- {% if perms.base.change_rotatingworktypeassign or request.user|is_reportingmanager %}
+ {% if can_change or can_manage %}
{% if instance.is_active %}
-
-
-
-
+
+
+
{% else %}
-
-
-
-
-
+
+
+
{% endif %}
{% endif %}
- {% if perms.base.delete_rotatingworktypeassign or request.user|is_reportingmanager %}
-
-
+
{% endif %}
+{% endif %}
+{% endwith %}
diff --git a/base/templates/cbv/shift_request/actions_shift_requst.html b/base/templates/cbv/shift_request/actions_shift_requst.html
index 3c0ed8923..01a09892d 100644
--- a/base/templates/cbv/shift_request/actions_shift_requst.html
+++ b/base/templates/cbv/shift_request/actions_shift_requst.html
@@ -1,38 +1,41 @@
{% load basefilters %}
-{% load static %}
-{% load i18n %}
+{% load static i18n %}
+{% is_manager_of request.user instance as can_manage %}
+{% with is_owner=request.user.employee_get|equals:instance.employee_id can_change=perms.base.change_shiftrequest can_add=perms.base.add_shiftrequest can_delete=perms.base.delete_shiftrequest %}
+ {% if is_owner or can_change or can_add or can_delete or can_manage %}
+
+ {% if is_owner or can_change or can_manage %}
+ {% if instance.approved == False and not instance.canceled %}
+
+ {% else %}
+
+ {% endif %}
+ {% endif %}
+ {% if is_owner or can_add or can_manage %}
+
+
+
+ {% endif %}
-{% load i18n %}
-
-{% if request.user.employee_get == instance.employee_id or perms.base.change_shiftrequest or perms.base.add_shiftrequest or perms.base.delete_shiftrequest or request.user|is_reportingmanager %}
-
- {% if request.user.employee_get == instance.employee_id or perms.base.change_shiftrequest or request.user|is_reportingmanager %}
- {% if instance.approved == False and not instance.canceled %}
-
- {% else %}
-
- {% endif %}
+ {% if is_owner or can_delete or can_manage %}
+ {% if instance.approved == False and instance.canceled == False %}
+
+
+
+ {% else %}
+
+ {% endif %}
+ {% endif %}
+
{% endif %}
- {% if request.user.employee_get == instance.employee_id or perms.base.add_shiftrequest or request.user|is_reportingmanager %}
-
-
-
- {% endif %}
- {% if request.user.employee_get == instance.employee_id or perms.base.delete_shiftrequest or request.user|is_reportingmanager %}
- {% if instance.approved == False and instance.canceled == False %}
-
-
-
- {% else %}
-
- {% endif %}
- {% endif %}
-
- {% if request.user.employee_get == instance.reallocate_to and not request.user|is_reportingmanager %}
+ {% if is_owner and not can_manage %}
{% if instance.approved or instance.reallocate_canceled or instance.reallocate_approved %}
+{% endwith %}
diff --git a/base/templates/cbv/shift_request/comment.html b/base/templates/cbv/shift_request/comment.html
index 81b90d3f4..084390101 100644
--- a/base/templates/cbv/shift_request/comment.html
+++ b/base/templates/cbv/shift_request/comment.html
@@ -1,10 +1,13 @@
{% load basefilters %}
-{% if request.user.employee_get == instance.employee_id or perms.base.view_shiftrequestcomment or request.user|is_reportingmanager %}
-
-
-
-
-
-{% endif %}
+{% is_manager_of request.user instance as can_manage %}
+{% with is_owner=request.user.employee_get|equals:instance.employee_id can_view=perms.base.view_shiftrequestcomment %}
+ {% if is_owner or can_view or can_manage %}
+
+
+
+
+
+ {% endif %}
+{% endwith %}
diff --git a/base/templates/cbv/shift_request/confirm_allocated.html b/base/templates/cbv/shift_request/confirm_allocated.html
index 48d279cf8..47880b8a6 100644
--- a/base/templates/cbv/shift_request/confirm_allocated.html
+++ b/base/templates/cbv/shift_request/confirm_allocated.html
@@ -1,28 +1,35 @@
-
{% load basefilters %}
{% load i18n %}
+{% is_manager_of request.user instance as can_manage %}
+{% with is_owner=request.user.employee_get|equals:instance.employee_id can_change=perms.base.change_shiftrequest can_delete=perms.base.delete_shiftrequest %}
+{% if is_owner or can_change or can_delete or can_manage %}
+
+
-{% if perms.base.change_shiftrequest or request.user|is_reportingmanager %}
-
-
- {% if instance.approved == False and not instance.canceled %}
-
- {% else %}
-
- {% endif %}
- {% if instance.approved == False and instance.canceled == False %}
-
- {% elif perms.base.change_shiftrequest or request.user|is_reportingmanager %}
-
- {% else %}
-
- {% endif %}
-
-
- {% endif %}
+ {% if is_owner or can_change or can_manage %}
+ {% if instance.approved == False and not instance.canceled %}
+
+
+
+ {% else %}
+
+ {% endif %}
+ {% endif %}
+
+
+ {% if is_owner or can_delete or can_manage %}
+ {% if instance.approved == False and instance.canceled == False %}
+
+ {% else %}
+
+ {% endif %}
+ {% endif %}
+
+
+{% endif %}
+{% endwith %}
diff --git a/base/templates/cbv/shift_request/confirmations.html b/base/templates/cbv/shift_request/confirmations.html
index 668aff50d..b5dbf482f 100644
--- a/base/templates/cbv/shift_request/confirmations.html
+++ b/base/templates/cbv/shift_request/confirmations.html
@@ -4,8 +4,8 @@
display:none;
}
-
-{% if perms.base.change_shiftrequest or request.user|is_reportingmanager %}
+{% is_manager_of request.user instance as can_manage %}
+{% if perms.base.change_shiftrequest or can_manage %}
{% if instance.approved and instance.canceled %}
-
- {% if instance.approved == False and not instance.canceled %}
-
- {% else %}
-
- {% endif %}
- {% if instance.approved == False and instance.canceled == False %}
-
- {% elif perms.base.change_shiftrequest or request.user|is_reportingmanager %}
-
- {% else %}
-
- {% endif %}
-
-
- {% endif %}
+{% is_manager_of request.user instance as can_manage %}
+{% if perms.base.change_shiftrequest or can_manage %}
+
+
+ {% if instance.approved == False and not instance.canceled %}
+
+ {% else %}
+
+ {% endif %}
+ {% if instance.approved == False and instance.canceled == False %}
+
+ {% elif perms.base.change_shiftrequest or can_manage %}
+
+ {% else %}
+
+ {% endif %}
+
- {% if request.user.employee_get == instance.employee_id or perms.base.add_worktyperequest or perms.base.change_worktyperequest or perms.base.delete_worktyperequest or request.user|is_reportingmanager %}
+ {% if request.user.employee_get == instance.employee_id or can_add or can_change or can_delete or can_manage %}
- {% if request.user.employee_get == instance.employee_id or perms.base.change_worktyperequest or request.user|is_reportingmanager %}
+ {% if request.user.employee_get == instance.employee_id or can_change or can_manage %}
{% if instance.approved == False and not instance.canceled %}
+ class="oh-btn oh-btn--light-bkg w-100" title="{% trans 'Edit' %}">
+
+
{% else %}
{% endif %}
{% endif %}
- {% if request.user.employee_get == instance.employee_id or perms.base.add_worktyperequest or request.user|is_reportingmanager %}
+ {% if request.user.employee_get == instance.employee_id or can_add or can_manage %}
@@ -23,7 +25,7 @@
{% endif %}
- {% if request.user.employee_get == instance.employee_id or perms.base.delete_worktyperequest or request.user|is_reportingmanager %}
+ {% if request.user.employee_get == instance.employee_id or can_delete or can_manage %}
{% if instance.approved == False and instance.canceled == False %}
{% endif %}
+{% endwith %}
diff --git a/base/templates/cbv/work_type_request/confirmation.html b/base/templates/cbv/work_type_request/confirmation.html
index e0f3486c0..1bd84661f 100644
--- a/base/templates/cbv/work_type_request/confirmation.html
+++ b/base/templates/cbv/work_type_request/confirmation.html
@@ -4,48 +4,32 @@
display: none;
}
-
-{% if perms.base.change_worktyperequest or request.user|is_reportingmanager %}
+{% is_manager_of request.user instance as can_manage %}
+{% if perms.base.change_worktyperequest or can_manage %}
{% if instance.approved or instance.canceled %}
-
+ {% trans 'Approve' %}
{% else %}
-
+ class="oh-btn oh-btn--success w-50">
{% trans 'Approve' %}
{% endif %}
{% if instance.canceled %}
-
+ {% trans 'Reject' %}
{% else %}
-
+ class="oh-btn oh-btn--danger w-50">
{% trans 'Reject' %}
diff --git a/base/templates/cbv/work_type_request/note.html b/base/templates/cbv/work_type_request/note.html
index 912cd1d26..f0d2bcaec 100644
--- a/base/templates/cbv/work_type_request/note.html
+++ b/base/templates/cbv/work_type_request/note.html
@@ -1,11 +1,14 @@
{% load basefilters %}
-{% if request.user.employee_get == instance.employee_id or perms.base.view_worktyperequestcomment or request.user|is_reportingmanager %}
-
-
-
-
-
+{% is_manager_of request.user instance as can_manage %}
+{% with is_owner=request.user.employee_get|equals:instance.employee_id or can_view=perms.base.view_worktyperequestcomment %}
+{% if is_owner or can_view or can_manage %}
+