[UPDT] ASSET: HTMX atttributes for asset request rejection
This commit is contained in:
@@ -84,7 +84,7 @@ function emptyAssetAvialabeChart(assetAvailableChartChart, args, options) {
|
||||
var noDataImage = new Image();
|
||||
noDataImage.src = assetAvailableChartChart.data.emptyImageSrc
|
||||
? assetAvailableChartChart.data.emptyImageSrc
|
||||
: staticUrl + "images/ui/joiningchart.png";
|
||||
: staticUrl + "images/ui/no_records.svg";
|
||||
|
||||
message = assetAvailableChartChart.data.message
|
||||
? assetAvailableChartChart.data.message
|
||||
|
||||
@@ -90,15 +90,9 @@
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Asset Requests To Approve" %}</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body" id="assetRequest" style="height:330px;overflow-y:auto">
|
||||
{% if asset_requests %}
|
||||
{% include "asset/dashboard_asset_requests.html" %}
|
||||
{% else %}
|
||||
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%;">
|
||||
<img style="display: block; width: 8%; margin: 20px auto;" src="{% static 'images/ui/asset.png' %}" class="" alt="Page not found. 404." />
|
||||
<h5 class="oh-404__subtitle">{% trans "There is no asset request to approve." %}</h5>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="oh-card-dashboard__body" id="dashboardAssetRequests" style="height:330px;overflow-y:auto"
|
||||
hx-get="{% url 'asset-dashboard-requests' %}" hx-trigger="load">
|
||||
<div class="animated-background"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -119,16 +113,10 @@
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Allocated Assets" %}</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body" id="leaveRequest" style="height:350px;overflow-y:auto">
|
||||
{% if asset_allocations %}
|
||||
{% include "asset/dashboard_allocated_assets.html" %}
|
||||
{% else %}
|
||||
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%;">
|
||||
<img style="display: block; width:10%; margin: 20px auto;" src="{% static 'images/ui/asset.png' %}" class="" alt="Page not found. 404." />
|
||||
<h5 class="oh-404__subtitle">{% trans "There is no asset allocation at this moment." %}</h5>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
<div class="oh-card-dashboard__body" id="dashboardAssetAllocates" style="height:350px;overflow-y:auto">
|
||||
<span hx-get="{% url 'asset-dashboard-allocates' %}" hx-trigger="load" hx-swap="outerHTML">
|
||||
<div class="animated-background"></div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,47 +1,41 @@
|
||||
{% load i18n %}
|
||||
|
||||
<div class="oh-sticky-table">
|
||||
<div class="oh-sticky-table__table">
|
||||
<div class="oh-sticky-table__thead">
|
||||
<div class="oh-sticky-table__tr">
|
||||
<div class="oh-sticky-table__th">{% trans "Allocated User" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Asset" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Assigned Date" %}</div>
|
||||
{% load static %}
|
||||
{% if asset_allocations %}
|
||||
<div class="oh-sticky-table">
|
||||
<div class="oh-sticky-table__table">
|
||||
<div class="oh-sticky-table__thead">
|
||||
<div class="oh-sticky-table__tr">
|
||||
<div class="oh-sticky-table__th">{% trans "Allocated User" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Asset" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Assigned Date" %}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__tbody">
|
||||
{% for asset_allocation in asset_allocations %}
|
||||
<div class="oh-sticky-table__tr"
|
||||
>
|
||||
<div
|
||||
class="oh-sticky-table__sd"
|
||||
>
|
||||
<div class="oh-profile oh-profile--md">
|
||||
<div class="oh-profile__avatar mr-1">
|
||||
<img
|
||||
src="{{asset_allocation.assigned_to_employee_id.get_avatar}}"
|
||||
class="oh-profile__image"
|
||||
alt=""
|
||||
/>
|
||||
<div class="oh-sticky-table__tbody">
|
||||
{% for asset_allocation in asset_allocations %}
|
||||
<div class="oh-sticky-table__tr">
|
||||
<div class="oh-sticky-table__sd">
|
||||
<div class="oh-profile oh-profile--md">
|
||||
<div class="oh-profile__avatar mr-1">
|
||||
<img src="{{asset_allocation.assigned_to_employee_id.get_avatar}}" class="oh-profile__image" alt="" />
|
||||
</div>
|
||||
<span class="oh-profile__name oh-text--dark">{{asset_allocation.assigned_to_employee_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__td">
|
||||
{{asset_allocation.asset_id}}
|
||||
</div>
|
||||
<div class="oh-sticky-table__td dateformat_changer">
|
||||
{{asset_allocation.assigned_date}}
|
||||
</div>
|
||||
<span class="oh-profile__name oh-text--dark"
|
||||
>{{asset_allocation.assigned_to_employee_id}}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="oh-sticky-table__td"
|
||||
>
|
||||
{{asset_allocation.asset_id}}
|
||||
</div>
|
||||
<div
|
||||
class="oh-sticky-table__td dateformat_changer"
|
||||
>
|
||||
{{asset_allocation.assigned_date}}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%;">
|
||||
<img style="display: block; width:10%; margin: 20px auto;" src="{% static 'images/ui/asset.png' %}" class=""
|
||||
alt="Page not found. 404." />
|
||||
<h5 class="oh-404__subtitle">{% trans "There is no asset allocation at this moment." %}</h5>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,91 +1,105 @@
|
||||
{% load i18n %}
|
||||
<div class="oh-sticky-table">
|
||||
<div class="oh-sticky-table__table">
|
||||
<div class="oh-sticky-table__thead">
|
||||
<div class="oh-sticky-table__tr">
|
||||
<div class="oh-sticky-table__th">{% trans "Request User" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Asset Category" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Request Date" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Status" %}</div>
|
||||
{% if perms.asset.add_assetassignment %}
|
||||
<div class="oh-sticky-table__th"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__tbody">
|
||||
<div id="assetRequestAllocationTarget"></div>
|
||||
{% for asset_request in asset_requests %}
|
||||
<!-- asset request looping -->
|
||||
<div
|
||||
class="oh-sticky-table__tr"
|
||||
draggable="true"
|
||||
data-toggle="oh-modal-toggle"
|
||||
data-target="#objectDetailsModalW25"
|
||||
hx-get="{% url 'asset-request-individual-view' asset_request.id %}?requests_ids={{requests_ids}}"
|
||||
hx-target="#objectDetailsModalW25Target"
|
||||
>
|
||||
<div class="oh-sticky-table__sd">
|
||||
<div class="oh-profile oh-profile--md">
|
||||
<div class="oh-profile__avatar mr-1">
|
||||
<img
|
||||
src="{{asset_request.requested_employee_id.get_avatar}}"
|
||||
class="oh-profile__image"
|
||||
alt="Mary Magdalene"
|
||||
/>
|
||||
</div>
|
||||
<span class="oh-profile__name oh-text--dark"
|
||||
>{{asset_request.requested_employee_id}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__td">
|
||||
{{asset_request.asset_category_id}}
|
||||
</div>
|
||||
<div class="oh-sticky-table__td dateformat_changer">
|
||||
{{ asset_request.asset_request_date }}
|
||||
</div>
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="d-flex align-items-center">
|
||||
<span
|
||||
class="oh-dot oh-dot--small me-1 oh-dot--color {% if asset_request.asset_request_status == 'Approved' %} oh-dot--success {% elif asset_request.asset_request_status == 'Rejected' %} oh-dot--danger {% elif asset_request.asset_request_status == 'Requested' %} oh-dot--info {% endif %}"
|
||||
></span
|
||||
><span
|
||||
class="{% if asset_request.asset_request_status == 'Approved' %} link-success {% elif asset_request.asset_request_status == 'Rejected' %} link-danger {% elif asset_request.asset_request_status == 'Requested' %} link-info {% endif %}"
|
||||
>{% trans asset_request.asset_request_status %}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
{% if perms.asset.add_assetassignment %}
|
||||
{% if asset_request.asset_request_status == 'Requested' %}
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="oh-btn-group">
|
||||
<a
|
||||
class="oh-btn oh-btn--success w-50"
|
||||
role="button"
|
||||
onclick="event.stopPropagation()"
|
||||
data-toggle="oh-modal-toggle"
|
||||
data-target="#objectCreateModal"
|
||||
hx-get="{% url 'asset-request-approve' req_id=asset_request.id %}"
|
||||
hx-target="#objectCreateModalTarget"
|
||||
title="Approve request"
|
||||
>
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
</a>
|
||||
<form action="{% url 'asset-request-reject' req_id=asset_request.id %}"
|
||||
onsubmit="event.stopPropagation();return confirm('{% trans "Do you want to reject this request?" %}')"
|
||||
method="post" title="{% trans 'Reject request' %}" class="w-50"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger w-100" onclick="event.stopPropagation()">
|
||||
<ion-icon name="close-circle-outline"></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% load static %}
|
||||
{% if messages %}
|
||||
<script>reloadMessage();</script>
|
||||
{% endif %}
|
||||
{% if asset_requests %}
|
||||
<div class="oh-sticky-table h-100">
|
||||
<div class="oh-sticky-table__table">
|
||||
<div class="oh-sticky-table__thead">
|
||||
<div class="oh-sticky-table__tr">
|
||||
<div class="oh-sticky-table__th">{% trans "Request User" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Asset Category" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Request Date" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Status" %}</div>
|
||||
{% if perms.asset.add_assetassignment %}
|
||||
<div class="oh-sticky-table__th"></div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__tbody">
|
||||
<div id="assetRequestAllocationTarget"></div>
|
||||
{% for asset_request in asset_requests %}
|
||||
<!-- asset request looping -->
|
||||
<div
|
||||
class="oh-sticky-table__tr"
|
||||
draggable="true"
|
||||
data-toggle="oh-modal-toggle"
|
||||
data-target="#objectDetailsModalW25"
|
||||
hx-get="{% url 'asset-request-individual-view' asset_request.id %}?requests_ids={{requests_ids}}"
|
||||
hx-target="#objectDetailsModalW25Target"
|
||||
>
|
||||
<div class="oh-sticky-table__sd">
|
||||
<div class="oh-profile oh-profile--md">
|
||||
<div class="oh-profile__avatar mr-1">
|
||||
<img
|
||||
src="{{asset_request.requested_employee_id.get_avatar}}"
|
||||
class="oh-profile__image"
|
||||
alt="Mary Magdalene"
|
||||
/>
|
||||
</div>
|
||||
<span class="oh-profile__name oh-text--dark"
|
||||
>{{asset_request.requested_employee_id}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__td">
|
||||
{{asset_request.asset_category_id}}
|
||||
</div>
|
||||
<div class="oh-sticky-table__td dateformat_changer">
|
||||
{{ asset_request.asset_request_date }}
|
||||
</div>
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="d-flex align-items-center">
|
||||
<span
|
||||
class="oh-dot oh-dot--small me-1 oh-dot--color {% if asset_request.asset_request_status == 'Approved' %} oh-dot--success {% elif asset_request.asset_request_status == 'Rejected' %} oh-dot--danger {% elif asset_request.asset_request_status == 'Requested' %} oh-dot--info {% endif %}"
|
||||
></span
|
||||
><span
|
||||
class="{% if asset_request.asset_request_status == 'Approved' %} link-success {% elif asset_request.asset_request_status == 'Rejected' %} link-danger {% elif asset_request.asset_request_status == 'Requested' %} link-info {% endif %}"
|
||||
>{% trans asset_request.asset_request_status %}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
{% if perms.asset.add_assetassignment %}
|
||||
{% if asset_request.asset_request_status == 'Requested' %}
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="oh-btn-group">
|
||||
<a
|
||||
class="oh-btn oh-btn--success w-50"
|
||||
role="button"
|
||||
onclick="event.stopPropagation()"
|
||||
data-toggle="oh-modal-toggle"
|
||||
data-target="#objectCreateModal"
|
||||
hx-get="{% url 'asset-request-approve' req_id=asset_request.id %}"
|
||||
hx-target="#objectCreateModalTarget"
|
||||
title="Approve request"
|
||||
>
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
</a>
|
||||
<form hx-confirm="{% trans 'Do you want to reject this request?' %}"
|
||||
hx-post="{% url 'asset-request-reject' req_id=asset_request.id %}"
|
||||
hx-target="#dashboardAssetRequests"
|
||||
class="w-50"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger w-100" onclick="event.stopPropagation()">
|
||||
<ion-icon name="close-circle-outline"></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="oh-empty h-100">
|
||||
<p class="oh-empty__message">
|
||||
<img style="display: block;width: 70px;margin: 20px auto ;" src="{% static "/images/ui/no_records.svg" %}" class="" alt=""/>
|
||||
{% trans "No records available at the moment." %}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -237,9 +237,11 @@
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
|
||||
</a>
|
||||
<form onsubmit="return confirm('{% trans "Do you want to reject this asset request?" %}')"
|
||||
action="{% url 'asset-request-reject' req_id=asset_request.id %}"
|
||||
method="post" title="{% trans 'Reject' %}" class='w-50'>
|
||||
<form hx-confirm="{% trans 'Do you want to reject this asset request?' %}"
|
||||
hx-post="{% url 'asset-request-reject' req_id=asset_request.id %}"
|
||||
hx-target="#asset_request_allocation_list"
|
||||
class='w-50'
|
||||
title="{% trans 'Reject' %}">
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger w-100" onclick="event.stopPropagation();">
|
||||
<ion-icon name="close-outline"></ion-icon>
|
||||
@@ -480,21 +482,20 @@
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var activeTab = localStorage.getItem("activeTabAsset");
|
||||
if (activeTab != null) {
|
||||
var tab = $(`[data-target="${activeTab}"]`);
|
||||
var tabContent = $(activeTab);
|
||||
$(tab).attr("class", "oh-tabs__tab oh-tabs__tab--active");
|
||||
$(tabContent).attr(
|
||||
"class",
|
||||
"oh-tabs__content oh-tabs__content--active"
|
||||
);
|
||||
var tab, tabContent;
|
||||
|
||||
if (activeTab) {
|
||||
tab = $(`[data-target="${activeTab}"]`);
|
||||
tabContent = $(activeTab);
|
||||
} else {
|
||||
$('[data-target="#tab_1"]').attr(
|
||||
"class",
|
||||
"oh-tabs__tab oh-tabs__tab--active"
|
||||
);
|
||||
$("#tab_1").attr("class", "oh-tabs__content oh-tabs__content--active");
|
||||
tab = $('[data-target="#tab_1"]');
|
||||
tabContent = $("#tab_1");
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
tab.addClass("oh-tabs__tab--active");
|
||||
tabContent.addClass("oh-tabs__content--active");
|
||||
}, 50);
|
||||
$(".oh-tabs__tab").click(function (e) {
|
||||
var activeTab = $(this).attr("data-target");
|
||||
localStorage.setItem("activeTabAsset", activeTab);
|
||||
|
||||
@@ -184,9 +184,9 @@
|
||||
<form
|
||||
action="{% url 'asset-request-reject' req_id=asset_request.id %}"
|
||||
class="w-50" method="post"
|
||||
onclick="event.stopPropagation(); return confirm('{% trans " Do you want to reject this request?" %}')">
|
||||
onsubmit="return confirm('{% trans " Do you want to reject this request?" %}')">
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger w-100" title="{% trans 'Reject' %}">
|
||||
<button class="oh-btn oh-btn--danger w-100" title="{% trans 'Reject' %}" onclick="event.stopPropagation();">
|
||||
<ion-icon name="close-outline"></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
{% load static %} {% load i18n %}
|
||||
{% if messages %}
|
||||
<script>reloadMessage();</script>
|
||||
{% if dashboard %}
|
||||
<span hx-get="{% url 'asset-dashboard-requests' %}" hx-trigger="load" hx-target="#dashboardAssetRequests"></span>
|
||||
{% else %}
|
||||
<span hx-get="{% url 'asset-request-allocation-view-search-filter' %}" hx-target="#asset_request_allocation_list" hx-trigger="load"></span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<div class="oh-modal__dialog oh-modal__dialog--navigation m-0 p-0">
|
||||
<button
|
||||
@@ -104,16 +112,14 @@
|
||||
data-toggle="oh-modal-toggle"
|
||||
data-target="#objectCreateModal"
|
||||
hx-get="{% url 'asset-request-approve' req_id=asset_request.id %}"
|
||||
hx-target="#objectCreateModalTarget"
|
||||
hx-target="##objectDetailsModalW25Target"
|
||||
>
|
||||
<ion-icon name="checkmark-outline"></ion-icon>{% trans 'Approve' %}
|
||||
</a>
|
||||
<form
|
||||
action="{% url 'asset-request-reject' req_id=asset_request.id %}"
|
||||
onsubmit="event.stopPropagation(); return confirm('{% trans "Do you want to reject this request?" %}')"
|
||||
method="post"
|
||||
class="w-100"
|
||||
>
|
||||
<form hx-confirm="{% trans 'Do you want to reject this request?' %}"
|
||||
hx-post="{% url 'asset-request-reject' req_id=asset_request.id %}?requests_ids={{requests_ids}}"
|
||||
hx-target="#objectDetailsModalW25Target" class="w-100"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger w-100" onclick="event.stopPropagation();">
|
||||
<ion-icon name="close-outline"></ion-icon> {% trans 'Reject' %}
|
||||
|
||||
@@ -155,6 +155,16 @@ urlpatterns = [
|
||||
name="add-asset-report",
|
||||
),
|
||||
path("dashboard/", views.asset_dashboard, name="asset-dashboard"),
|
||||
path(
|
||||
"asset-dashboard-requests/",
|
||||
views.asset_dashboard_requests,
|
||||
name="asset-dashboard-requests",
|
||||
),
|
||||
path(
|
||||
"asset-dashboard-allocates/",
|
||||
views.asset_dashboard_allocates,
|
||||
name="asset-dashboard-allocates",
|
||||
),
|
||||
path(
|
||||
"asset-available-chart/",
|
||||
views.asset_available_chart,
|
||||
@@ -190,8 +200,8 @@ urlpatterns = [
|
||||
name="asset-request-tab",
|
||||
),
|
||||
path(
|
||||
"dashboard-asset-request-approve",
|
||||
views.dashboard_asset_request_approve,
|
||||
name="dashboard-asset-request-approve",
|
||||
"main-dashboard-asset-requests",
|
||||
views.asset_dashboard_requests,
|
||||
name="main-dashboard-asset-requests",
|
||||
),
|
||||
]
|
||||
|
||||
100
asset/views.py
100
asset/views.py
@@ -55,10 +55,10 @@ from base.methods import (
|
||||
filtersubordinates,
|
||||
get_key_instances,
|
||||
get_pagination,
|
||||
paginator_qry,
|
||||
sortby,
|
||||
)
|
||||
from base.models import Company
|
||||
from base.views import paginator_qry
|
||||
from employee.models import Employee, EmployeeWorkInformation
|
||||
from horilla import settings
|
||||
from horilla.decorators import (
|
||||
@@ -634,7 +634,7 @@ def asset_request_reject(request, req_id):
|
||||
asset_request = AssetRequest.objects.get(id=req_id)
|
||||
asset_request.asset_request_status = "Rejected"
|
||||
asset_request.save()
|
||||
messages.info(request, _("Asset request rejected"))
|
||||
messages.info(request, _("Asset request has been rejected."))
|
||||
notify.send(
|
||||
request.user.employee_get,
|
||||
recipient=asset_request.requested_employee_id.employee_user_id,
|
||||
@@ -648,6 +648,27 @@ def asset_request_reject(request, req_id):
|
||||
&asset_request_status={asset_request.asset_request_status}",
|
||||
icon="bag-check",
|
||||
)
|
||||
if request.META.get("HTTP_HX_REQUEST"):
|
||||
if request.META.get("HTTP_HX_TARGET") == "objectDetailsModalW25Target":
|
||||
requests_ids_json = request.GET.get("requests_ids", "[]")
|
||||
try:
|
||||
requests_ids = json.loads(requests_ids_json)
|
||||
except json.JSONDecodeError:
|
||||
requests_ids = []
|
||||
return redirect(
|
||||
reverse(
|
||||
"asset-request-individual-view", kwargs={"asset_request_id": req_id}
|
||||
)
|
||||
+ f"?requests_ids={requests_ids}"
|
||||
)
|
||||
|
||||
referrer = request.META.get("HTTP_REFERER", "")
|
||||
referrer = "/" + "/".join(referrer.split("/")[3:])
|
||||
|
||||
if referrer.endswith("/asset/dashboard/") or referrer == "/":
|
||||
return redirect(reverse("asset-dashboard-requests"))
|
||||
|
||||
return redirect("asset-request-allocation-view-search-filter")
|
||||
return HttpResponseRedirect(request.META.get("HTTP_REFERER", "/"))
|
||||
|
||||
|
||||
@@ -999,9 +1020,13 @@ def asset_request_individual_view(request, asset_request_id):
|
||||
Returns:
|
||||
HttpResponse: The rendered 'individual_request.html' template with the context data.
|
||||
"""
|
||||
dashboard = not request.META.get("HTTP_HX_CURRENT_URL", "").endswith(
|
||||
"asset-request-allocation-view/"
|
||||
)
|
||||
asset_request = AssetRequest.objects.get(id=asset_request_id)
|
||||
context = {
|
||||
"asset_request": asset_request,
|
||||
"dashboard": dashboard,
|
||||
}
|
||||
requests_ids_json = request.GET.get("requests_ids")
|
||||
if requests_ids_json:
|
||||
@@ -1491,21 +1516,47 @@ def asset_dashboard(request):
|
||||
"""
|
||||
assets = Asset.objects.all()
|
||||
asset_in_use = Asset.objects.filter(asset_status="In use")
|
||||
|
||||
context = {
|
||||
"assets": assets,
|
||||
"asset_in_use": asset_in_use,
|
||||
}
|
||||
return render(request, "asset/dashboard.html", context)
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required(perm="asset.view_assetrequest")
|
||||
def asset_dashboard_requests(request):
|
||||
"""
|
||||
Handles the asset request approval dashboard view.
|
||||
|
||||
This view fetches and filters asset requests that are currently in the
|
||||
"Requested" status and belong to employees who are active.
|
||||
|
||||
The filtered asset requests are then passed to the template for rendering,
|
||||
along with a JSON-encoded list of the request IDs.
|
||||
"""
|
||||
asset_requests = AssetRequest.objects.filter(
|
||||
asset_request_status="Requested", requested_employee_id__is_active=True
|
||||
)
|
||||
requests_ids = json.dumps([instance.id for instance in asset_requests])
|
||||
context = {
|
||||
"asset_requests": asset_requests,
|
||||
"requests_ids": requests_ids,
|
||||
}
|
||||
return render(request, "asset/dashboard_asset_requests.html", context)
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required(perm="asset.view_assetassignment")
|
||||
def asset_dashboard_allocates(request):
|
||||
asset_allocations = AssetAssignment.objects.filter(
|
||||
asset_id__asset_status="In use", assigned_to_employee_id__is_active=True
|
||||
)
|
||||
context = {
|
||||
"assets": assets,
|
||||
"asset_requests": asset_requests,
|
||||
"requests_ids": requests_ids,
|
||||
"asset_in_use": asset_in_use,
|
||||
"asset_allocations": asset_allocations,
|
||||
}
|
||||
return render(request, "asset/dashboard.html", context)
|
||||
return render(request, "asset/dashboard_allocated_assets.html", context)
|
||||
|
||||
|
||||
@login_required
|
||||
@@ -1746,38 +1797,3 @@ def asset_request_tab(request, emp_id):
|
||||
assets_requests = employee.requested_employee.all()
|
||||
context = {"asset_requests": assets_requests, "emp_id": emp_id}
|
||||
return render(request, "tabs/asset-request-tab.html", context=context)
|
||||
|
||||
|
||||
@login_required
|
||||
def dashboard_asset_request_approve(request):
|
||||
"""
|
||||
Handles the asset request approval dashboard view.
|
||||
|
||||
This view fetches and filters asset requests that are currently in the
|
||||
"Requested" status and belong to employees who are active. It further filters
|
||||
the asset requests based on the subordinates of the logged-in user and the
|
||||
specific permission 'asset.change_assetrequest'.
|
||||
|
||||
The filtered asset requests are then passed to the template for rendering,
|
||||
along with a JSON-encoded list of the request IDs.
|
||||
"""
|
||||
|
||||
asset_requests = AssetRequest.objects.filter(
|
||||
asset_request_status="Requested", requested_employee_id__is_active=True
|
||||
)
|
||||
asset_requests = filtersubordinates(
|
||||
request,
|
||||
asset_requests,
|
||||
"asset.change_assetrequest",
|
||||
field="requested_employee_id",
|
||||
)
|
||||
requests_ids = json.dumps([instance.id for instance in asset_requests])
|
||||
|
||||
return render(
|
||||
request,
|
||||
"request_and_approve/asset_requests_approve.html",
|
||||
{
|
||||
"asset_requests": asset_requests,
|
||||
"requests_ids": requests_ids,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
{% load i18n static %}
|
||||
{% if asset_requests %}
|
||||
<div class="oh-sticky-table h-100">
|
||||
<div class="oh-sticky-table__table">
|
||||
<div class="oh-sticky-table__thead">
|
||||
<div class="oh-sticky-table__tr">
|
||||
<div class="oh-sticky-table__th">{% trans "Request User" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Asset Category" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Request Date" %}</div>
|
||||
<div class="oh-sticky-table__th" align="center">{% trans "Actions" %}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__tbody">
|
||||
<div id="assetRequestAllocationTarget"></div>
|
||||
{% for asset_request in asset_requests %}
|
||||
<!-- asset request looping -->
|
||||
<div
|
||||
class="oh-sticky-table__tr"
|
||||
draggable="true"
|
||||
data-toggle="oh-modal-toggle"
|
||||
data-target="#objectDetailsModalW25"
|
||||
hx-get="{% url 'asset-request-individual-view' asset_request.id %}?requests_ids={{requests_ids}}"
|
||||
hx-target="#objectDetailsModalW25Target"
|
||||
>
|
||||
<div class="oh-sticky-table__sd">
|
||||
<div class="oh-profile oh-profile--md">
|
||||
<div class="oh-profile__avatar mr-1">
|
||||
<img
|
||||
src="{{asset_request.requested_employee_id.get_avatar}}"
|
||||
class="oh-profile__image"
|
||||
alt="Mary Magdalene"
|
||||
/>
|
||||
</div>
|
||||
<span class="oh-profile__name oh-text--dark"
|
||||
>{{asset_request.requested_employee_id}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__td">
|
||||
{{asset_request.asset_category_id}}
|
||||
</div>
|
||||
<div class="oh-sticky-table__td dateformat_changer">
|
||||
{{ asset_request.asset_request_date }}
|
||||
</div>
|
||||
{% if asset_request.asset_request_status == 'Requested' %}
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="oh-btn-group">
|
||||
<a
|
||||
class="oh-btn oh-btn--success w-50"
|
||||
role="button"
|
||||
onclick="event.stopPropagation()"
|
||||
data-toggle="oh-modal-toggle"
|
||||
data-target="#objectCreateModal"
|
||||
hx-get="{% url 'asset-request-approve' req_id=asset_request.id %}"
|
||||
hx-target="#objectCreateModalTarget"
|
||||
title="Approve request"
|
||||
>
|
||||
<ion-icon name="checkmark-outline"></ion-icon>
|
||||
</a>
|
||||
<form
|
||||
action="{% url 'asset-request-reject' req_id=asset_request.id %}"
|
||||
method="post"
|
||||
onsubmit="event.stopPropagation();return confirm('{% trans "Do you want to reject this request?" %}')"
|
||||
title="Reject request"
|
||||
class="w-50"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button class="oh-btn oh-btn--danger w-100" onclick="event.stopPropagation()">
|
||||
<ion-icon name="close-circle-outline"></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div style="height: 380px; display:flex;align-items: center;justify-content: center;" class="">
|
||||
<div style="" class="">
|
||||
<img style="display: block;width: 70px;margin: 20px auto ;" src="{% static "images/ui/joiningchart.png" %}" class="" alt=""/>
|
||||
<h3 style="font-size:16px" class="oh-404__subtitle">{% trans "No data Found..." %}</h3>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -185,464 +185,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="oh-dashboard__movable-cards row mt-4" id="tileContainer">
|
||||
{% if "attendance"|app_installed %}
|
||||
{% if not 'offline_employees' in charts %}
|
||||
{% if perms.employee.view_employee or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="notInYetId" hx-get="{% url 'not-in-yet' %}" hx-trigger="load">
|
||||
{% include "dashboard/not_in_yet.html" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if not 'online_employees' in charts %}
|
||||
{% if perms.employee.view_employee or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="notoutYetdd" hx-get="{% url 'not-out-yet' %}" hx-trigger="load">
|
||||
{% include "dashboard/not_out_yet.html" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if "leave"|app_installed and not 'overall_leave_chart' in charts %}
|
||||
{% if perms.leave.view_leaverequest %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 oh-card-dashboard--moveable dashboardChart"
|
||||
id="movable1">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Overall Leave" %}</span>
|
||||
<span class="float-end chart_close_button ms-3" role="button"
|
||||
data-chart="overall_leave_chart"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=overall_leave_chart"
|
||||
hx-target="#movable1" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
<select class="oh-select oh-select--sm float-end" name="" id="overAllLeaveSelect">
|
||||
<option value="today" selected>{% trans "Today" %}</option>
|
||||
<option value="week">{% trans "This Week" %}</option>
|
||||
<option value="month">{% trans "This Month" %}</option>
|
||||
<option value="year">{% trans "This Year" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body">
|
||||
<canvas id="overAllLeave" style="cursor: pointer" height='300' width="350"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if "recruitment"|app_installed and perms.recruitment.view_candidate or request.user|is_stagemanager %}
|
||||
{% if not 'hired_candidates' in charts %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="movable2">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Hired Candidates" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="hired_candidates"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=hired_candidates"
|
||||
hx-target="#movable2" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body">
|
||||
<canvas id="hiredCandidate" style="cursor: pointer"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if "onboarding"|app_installed and not 'onboarding_candidates' in charts %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="movable3">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Candidates Started Onboarding" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="onboarding_candidates"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=onboarding_candidates"
|
||||
hx-target="#movable3" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body">
|
||||
<canvas id="onboardCandidate" style="cursor: pointer"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if "recruitment"|app_installed and not 'recruitment_analytics' in charts %}
|
||||
{% if request.user|is_stagemanager or perms.recruitment.view_recruitment %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="movable8">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Recruitment Analytics" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="recruitment_analytics"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=recruitment_analytics"
|
||||
hx-target="#movable8" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body">
|
||||
<canvas id="recruitmentChart1" style="cursor: pointer"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if "attendance"|app_installed and not 'attendance_analytic' in charts %}
|
||||
{% if request.user|is_reportingmanager or perms.attendance.view_attendance %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="movable4">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider"
|
||||
id="attendance_header">
|
||||
<div class="oh-card-dashboard__title mb-2">
|
||||
{% trans "Attendance Analytics" %}
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="attendance_analytic"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=attendance_analytic"
|
||||
hx-target="#movable4" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<select id="type" class="oh-select" name="type" onchange="changeView(this)"
|
||||
style="width: 150px; padding: 3px; color: #5e5c5c">
|
||||
<option value="day">{% trans "Day" %}</option>
|
||||
<option value="weekly">{% trans "Weekly" %}</option>
|
||||
<option value="monthly">{% trans "Monthly" %}</option>
|
||||
<option value="date_range">{% trans "Date range" %}</option>
|
||||
</select>
|
||||
<span id="day_input">
|
||||
<input type="date" class="mb-2 float-end pointer oh-select"
|
||||
id="attendance_month" onchange="changeMonth()"
|
||||
style="width: 100px; color: #5e5c5c" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body">
|
||||
<canvas id="dailyAnalytic" style="cursor: pointer"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if "attendance"|app_installed and not 'hours_chart' in charts %}
|
||||
{% if request.user|is_reportingmanager or perms.attendance.view_attendance %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="pendingHours">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider"
|
||||
id="pendingHoursHeader">
|
||||
<div class="oh-card-dashboard__title mb-2">
|
||||
{% trans "Hours Chart" %}
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="hours_chart"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=hours_chart"
|
||||
hx-target="#pendingHours" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<input type="month" class="mb-2 float-end pointer oh-select"
|
||||
id="hourAccountMonth" onchange="dynamicMonth($(this))"
|
||||
style="width: 100px; color: #5e5c5c" />
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body" style="height:300px">
|
||||
<canvas id="pendingHoursCanvas" style="cursor: pointer"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if not 'employees_chart' in charts %}
|
||||
{% if 'employees_chart'|feature_is_accessible:request or perms.employee.view_employee or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 oh-card-dashboard--moveable dashboardChart"
|
||||
id="movable5">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Employees Chart" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="employees_chart"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=employees_chart"
|
||||
hx-target="#movable5" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body">
|
||||
<canvas id="totalEmployees" style="cursor: pointer"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if not 'department_chart' in charts %}
|
||||
{% if 'department_chart'|feature_is_accessible:request or perms.employee.view_employee or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 oh-card-dashboard--moveable dashboardChart"
|
||||
id="movable6">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Department Chart" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="department_chart"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=department_chart"
|
||||
hx-target="#movable6" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body">
|
||||
<canvas id="departmentChart" style="cursor: pointer"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if not 'gender_chart' in charts %}
|
||||
{% if 'gender_chart'|feature_is_accessible:request or perms.employee.view_employee or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 oh-card-dashboard--moveable dashboardChart"
|
||||
id="movable7">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Gender Chart" %}</span>
|
||||
<span class="float-end chart_close_button " role="button" data-chart="gender_chart"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=gender_chart"
|
||||
hx-target="#movable7" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body">
|
||||
<canvas id="genderChart" style="cursor: pointer"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if not 'objective_status' in charts and "pms"|app_installed %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 oh-card-dashboard--moveable dashboardChart"
|
||||
id="movable9">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Objective Status" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="objective_status"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=objective_status"
|
||||
hx-target="#movable9" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body">
|
||||
<canvas id="objectiveChart" style="cursor: pointer"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if "pms"|app_installed and not 'key_result_status' in charts %}
|
||||
{% if perms.pms.view_employeekeyresult or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 oh-card-dashboard--moveable dashboardChart"
|
||||
id="movable10">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Key Result Status" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="key_result_status"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=key_result_status"
|
||||
hx-target="#movable10" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body">
|
||||
<canvas id="keyResultChart" style="cursor: pointer"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if "pms"|app_installed and not 'feedback_status' in charts %}
|
||||
{% if perms.pms.view_feedback or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 oh-card-dashboard--moveable dashboardChart"
|
||||
id="movable11">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Feedback Status" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="feedback_status"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=feedback_status"
|
||||
hx-target="#movable11" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body">
|
||||
<div class="oh-card-dashboard__body">
|
||||
<canvas id="feedbackChart" style="cursor: pointer"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if not 'shift_request_approve' in charts %}
|
||||
{% if perms.base.change_shiftrequest or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="shiftRequestApprove">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent"
|
||||
style="height:425px">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Shift Requests To Approve" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="shift_request_approve"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=shift_request_approve"
|
||||
hx-target="#shiftRequestApprove" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body" id="shiftRequestApproveBody" hx-get="{% url 'dashboard-shift-request' %}" hx-trigger="load" style="height:80%">
|
||||
{% include "request_and_approve/shift_request.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if not 'work_type_request_approve' in charts %}
|
||||
{% if perms.base.change_worktyperequest or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="WorkTypeRequestApprove">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent"
|
||||
style="height:425px">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Work Type Requests To Approve" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="work_type_request_approve"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=work_type_request_approve"
|
||||
hx-target="#WorkTypeRequestApprove" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body" id="WorkTypeRequestApproveBody"
|
||||
hx-get="{% url 'dashboard-work-type-request' %}" hx-trigger="load" style="height:80%">
|
||||
{% include "request_and_approve/work_type_request.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if "attendance"|app_installed and not 'overtime_approve' in charts %}
|
||||
{% if perms.attendance.change_attendance or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="OTApprove">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent"
|
||||
hx-get="{% url 'dashboard-overtime-approve' %}" hx-trigger="load" style="height:425px"
|
||||
id="OTApproveTarget">
|
||||
{% include "request_and_approve/overtime_approve.html" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if "attendance"|app_installed %}
|
||||
{% if not 'attendance_validate' in charts %}
|
||||
{% if perms.attendance.change_attendance or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart" id="AttendanceValidate">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent"
|
||||
style="height:425px" hx-get="{% url 'dashboard-attendance-validate' %}"
|
||||
hx-trigger="load" id="AttendanceValidateTarget">
|
||||
{% include "request_and_approve/attendance_validate.html" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if "leave"|app_installed and not 'leave_request_approve' in charts %}
|
||||
{% if perms.leave.change_leaverequest or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="LeaveApprove">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent"
|
||||
style="height:425px">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Leave Requests To Approve" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="leave_request_approve"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=leave_request_approve"
|
||||
hx-target="#LeaveApprove" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body" id="LeaveApproveBody"
|
||||
hx-get='{% url "leave-request-and-approve" %}' hx-trigger="load" style="height:80%">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if "leave"|app_installed and not 'leave_allocation_approve' in charts %}
|
||||
{% if perms.leave.change_leaveallocationrequest or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="LeaveAllocationApprove">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent"
|
||||
style="height:425px">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Leave Allocation Request To Approve" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="leave_allocation_approve"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=leave_allocation_approve"
|
||||
hx-target="#LeaveAllocationApprove" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body" id="LeaveAllocationApproveBody"
|
||||
hx-get='{% url "leave-allocation-approve" %}' hx-trigger="load" style="height:80%">
|
||||
{% include "request_and_approve/leave_request_approve.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if "pms"|app_installed and not 'feedback_answer' in charts %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="feedbackAnswer">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent"
|
||||
style="height:425px">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Feedback To Answers" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="feedback_answer"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=feedback_answer"
|
||||
hx-target="#feedbackAnswer" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body" id="feedbackAnswerBody"
|
||||
hx-get="{% url 'dashboard-feedback-answer' %}" hx-trigger="load" style="height:80%">
|
||||
{% include "request_and_approve/feedback_answer.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if "asset"|app_installed and not 'asset_request_approve' in charts %}
|
||||
{% if perms.asset.change_assetrequest or request.user|is_reportingmanager %}
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-6 oh-card-dashboard--moveable dashboardChart"
|
||||
id="assetRequestApprove">
|
||||
<div class="oh-card-dashboard oh-card-dashboard--no-scale oh-card-dashboard--transparent"
|
||||
style="height:425px">
|
||||
<div class="oh-card-dashboard__header oh-card-dashboard__header--divider">
|
||||
<span class="oh-card-dashboard__title">{% trans "Asset Requests To Approve" %}</span>
|
||||
<span class="float-end chart_close_button " role="button"
|
||||
data-chart="asset_request_approve"
|
||||
hx-post="{% url 'employee-charts' %}?chart_id=asset_request_approve"
|
||||
hx-target="#assetRequestApprove" hx-swap="outerHTML">
|
||||
<i class="material-icons fw-lighter fs-5">close</i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-card-dashboard__body" id="assetRequestApproveBody"
|
||||
hx-get='{% url "dashboard-asset-request-approve" %}' hx-trigger="load"
|
||||
style="height:80%">
|
||||
{% include "request_and_approve/asset_requests_approve.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% include "dashboard_tile_container.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -665,7 +208,7 @@
|
||||
justify-content: center;
|
||||
width: 50px;
|
||||
height: 28px;" class="oh-btn oh-btn--secondary-outline float-end ms-3"
|
||||
hx-get='{% url "create-announcement" %}' hx-target="#objectCreateModalTarget"
|
||||
hx-get="{% url 'create-announcement' %}" hx-target="#objectCreateModalTarget"
|
||||
hx-swap="innerHTML" data-toggle="oh-modal-toggle" data-target="#objectCreateModal"
|
||||
title='{% trans "Create Announcement." %}'>
|
||||
<ion-icon name="add-outline" class="m-0"></ion-icon>
|
||||
@@ -889,7 +432,7 @@
|
||||
localStorage.setItem("tileOrder", JSON.stringify(
|
||||
[
|
||||
"notInYetId", "LeaveApprove", "shiftRequestApprove", "WorkTypeRequestApprove", "AttendanceValidate", "OTApprove",
|
||||
"LeaveAllocationApprove", "feedbackAnswer", "assetRequestApprove", "movable8", "pendingHours", "notoutYetdd",
|
||||
"LeaveAllocationApprove", "feedbackAnswer", "assetRequestApprove", "movable8", "pendingHours", "notoutYetId",
|
||||
"movable2", "movable3", "movable4", "movable1", "movable5", "movable6", "movable7", "movable9", "movable10", "movable11"
|
||||
]
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user