[FIX] PMS: Filter in dashboard, Group By for self objective
This commit is contained in:
@@ -28,7 +28,7 @@ if (objectiveChart != null) {
|
||||
let datasetLabel = e.chart.data.datasets[datasetIndex].label;
|
||||
let value = e.chart.data.datasets[datasetIndex].data[dataIndex];
|
||||
let label = e.chart.data.labels[dataIndex];
|
||||
let params = "?status=" + label + "&archive=false";
|
||||
let params = "?status=" + label + "&archive=false" + "&dashboard=True";
|
||||
|
||||
$.ajax({
|
||||
url: "/pms/objective-list-search" + params,
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
{% load attendancefilters %} {% load basefilters %} {% load static %}
|
||||
{% load i18n %} {% include 'filter_tags.html' %}
|
||||
|
||||
|
||||
|
||||
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
{% load basefilters %}
|
||||
<!-- filter items showing here -->
|
||||
{% include 'filter_tags.html' %}
|
||||
<div class="d-flex flex-row-reverse">
|
||||
<span class="m-3 review_ongoing" hx-get="{% url "objective-list-search" %}?{{pd}}&status=At Risk" hx-target="#objective_list" style="cursor: pointer">
|
||||
<span class="oh-dot oh-dot--small me-1" style="background-color:red"></span>
|
||||
@@ -77,150 +70,182 @@
|
||||
<!-- own objective-->
|
||||
<div class="oh-tabs__content" id="tab_1">
|
||||
{% if own_objectives.object_list %}
|
||||
<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" style="width:10px;">
|
||||
<div class="centered-div">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="own-objects oh-input oh-input__checkbox"
|
||||
id = "Ownobjectives"
|
||||
title='{% trans "Select All" %}'
|
||||
/>
|
||||
<div class="oh-card">
|
||||
{% dynamic_regroup own_objectives.object_list by field as okr_grouper %}
|
||||
{% for okr_list in okr_grouper %}
|
||||
<div class="oh-accordion-meta">
|
||||
<div class="oh-accordion-meta__item">
|
||||
<div
|
||||
class="oh-accordion-meta__header"
|
||||
onclick='$(this).toggleClass("oh-accordion-meta__header--show");'
|
||||
>
|
||||
<span class="oh-accordion-meta__title pt-3 pb-3">
|
||||
<div class="oh-tabs__input-badge-container">
|
||||
<span
|
||||
class="oh-badge oh-badge--secondary oh-badge--small oh-badge--round mr-1"
|
||||
>
|
||||
{{okr_list.list|length}}
|
||||
</span>
|
||||
{{okr_list.grouper}}
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-accordion-meta__body d-none">
|
||||
<div class="oh-sticky-table oh-sticky-table--no-overflow mb-5">
|
||||
|
||||
<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" style="width:10px;">
|
||||
<div class="centered-div">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="own-objects oh-input oh-input__checkbox"
|
||||
id = "Ownobjectives"
|
||||
title='{% trans "Select All" %}'
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Owner" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Objective" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Due In" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Status" %}</div>
|
||||
<div class="oh-sticky-table__th"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__tbody">
|
||||
{% for own_objective in own_objectives.object_list %}
|
||||
<div class="oh-sticky-table__tr" draggable="true">
|
||||
<div class="oh-sticky-table__sd {% if own_objective.status == 'Closed' %}row-status--blue
|
||||
{% elif own_objective.status == 'On Track' %}row-status--yellow {% elif own_objective.status == 'Not Started' %}row-status--gray
|
||||
{% elif own_objective.status == 'Behind' %}row-status--orange {% elif own_objective.status == 'At Risk' %}row-status--red{% endif %}">
|
||||
<div class="centered-div">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="{{own_objective.id}}"
|
||||
value="{{own_objective.id}}"
|
||||
onchange="highlightRow($(this))"
|
||||
class="oh-input objective-checkbox oh-input__checkbox own-objects-row"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<a class="oh-sticky-table__td" style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=own_objective.id %} ">
|
||||
<div class="oh-profile oh-profile--md">
|
||||
<div class="oh-profile__avatar mr-1">
|
||||
<img
|
||||
src="{{own_objective.employee_id.get_avatar}}"
|
||||
class="oh-profile__image"
|
||||
/>
|
||||
</div>
|
||||
<span class="oh-profile__name oh-text--dark">{{own_objective.employee_id}}</span>
|
||||
</div>
|
||||
</a>
|
||||
<a
|
||||
style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=own_objective.id %} "
|
||||
class="oh-sticky-table__td"
|
||||
>{{own_objective.objective}}</a
|
||||
>
|
||||
<a
|
||||
style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=own_objective.id %} "
|
||||
class="oh-sticky-table__td"
|
||||
>
|
||||
{{ current_date|timesince:own_objective.end_date }}
|
||||
</a>
|
||||
<a
|
||||
style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=own_objective.id %} "
|
||||
class="oh-sticky-table__td"
|
||||
>
|
||||
<div class="d-flex align-items-center">
|
||||
<span
|
||||
class="oh-dot oh-dot--small me-1 oh-dot--color{{own_objective.status}}"
|
||||
></span
|
||||
><span>{{own_objective.get_status_display}}</span>
|
||||
</div>
|
||||
</a>
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="oh-btn-group">
|
||||
{% if own_objective.archive %}
|
||||
<form
|
||||
action="{%url 'objective-archive' id=own_objective.id %}?{{pg}}"
|
||||
onsubmit="return confirm('{% trans "Do you want un-archive this OKR ?" %}')"
|
||||
method="post"
|
||||
style="display: contents"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button
|
||||
class="oh-btn oh-btn--danger-outline w-100"
|
||||
title="{% trans 'Un-archive' %}"
|
||||
>
|
||||
<ion-icon
|
||||
name="archive-sharp"
|
||||
role="img"
|
||||
class="md hydrated"
|
||||
aria-label="archive sharp"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form
|
||||
action="{%url 'objective-archive' id=own_objective.id %}?{{pg}}"
|
||||
onsubmit="return confirm('{% trans "Do you want archive this OKR ?" %}')"
|
||||
method="post"
|
||||
style="display: contents"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button
|
||||
class="oh-btn oh-btn--danger-outline w-100"
|
||||
title="{% trans 'Archive' %}"
|
||||
>
|
||||
<ion-icon
|
||||
name="archive-sharp"
|
||||
role="img"
|
||||
class="md hydrated"
|
||||
aria-label="archive sharp"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
{% endif %} {% if perms.pms.delete_employeeobjective %}
|
||||
<form
|
||||
action="{% url 'objective-delete' obj_id=own_objective.id %}"
|
||||
onsubmit="return confirm('{% trans "Do you want Delete this OKR ?" %}')"
|
||||
method="post"
|
||||
style="display: contents"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button
|
||||
class="oh-btn oh-btn--danger-outline w-100"
|
||||
title="{% trans 'Delete' %}"
|
||||
>
|
||||
<ion-icon
|
||||
name="trash-outline"
|
||||
role="img"
|
||||
class="md hydrated"
|
||||
aria-label="trash outline"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Owner" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Objective" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Due In" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Status" %}</div>
|
||||
<div class="oh-sticky-table__th"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__tbody">
|
||||
{% for own_objective in own_objectives.object_list %}
|
||||
<div class="oh-sticky-table__tr" draggable="true">
|
||||
<div class="oh-sticky-table__sd {% if own_objective.status == 'Closed' %}row-status--blue
|
||||
{% elif own_objective.status == 'On Track' %}row-status--yellow {% elif own_objective.status == 'Not Started' %}row-status--gray
|
||||
{% elif own_objective.status == 'Behind' %}row-status--orange {% elif own_objective.status == 'At Risk' %}row-status--red{% endif %}">
|
||||
<div class="centered-div">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="{{own_objective.id}}"
|
||||
value="{{own_objective.id}}"
|
||||
onchange="highlightRow($(this))"
|
||||
class="oh-input objective-checkbox oh-input__checkbox own-objects-row"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<a class="oh-sticky-table__td" style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=own_objective.id %} ">
|
||||
<div class="oh-profile oh-profile--md">
|
||||
<div class="oh-profile__avatar mr-1">
|
||||
<img
|
||||
src="{{own_objective.employee_id.get_avatar}}"
|
||||
class="oh-profile__image"
|
||||
/>
|
||||
</div>
|
||||
<span class="oh-profile__name oh-text--dark">{{own_objective.employee_id}}</span>
|
||||
</div>
|
||||
</a>
|
||||
<a
|
||||
style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=own_objective.id %} "
|
||||
class="oh-sticky-table__td"
|
||||
>{{own_objective.objective}}</a
|
||||
>
|
||||
<a
|
||||
style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=own_objective.id %} "
|
||||
class="oh-sticky-table__td"
|
||||
>
|
||||
{{ current_date|timesince:own_objective.end_date }}
|
||||
</a>
|
||||
<a
|
||||
style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=own_objective.id %} "
|
||||
class="oh-sticky-table__td"
|
||||
>
|
||||
<div class="d-flex align-items-center">
|
||||
<span
|
||||
class="oh-dot oh-dot--small me-1 oh-dot--color{{own_objective.status}}"
|
||||
></span
|
||||
><span>{{own_objective.get_status_display}}</span>
|
||||
</div>
|
||||
</a>
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="oh-btn-group">
|
||||
{% if own_objective.archive %}
|
||||
<form
|
||||
action="{%url 'objective-archive' id=own_objective.id %}?{{pg}}"
|
||||
onsubmit="return confirm('{% trans "Do you want un-archive this OKR ?" %}')"
|
||||
method="post"
|
||||
style="display: contents"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button
|
||||
class="oh-btn oh-btn--danger-outline w-100"
|
||||
title="{% trans 'Un-archive' %}"
|
||||
>
|
||||
<ion-icon
|
||||
name="archive-sharp"
|
||||
role="img"
|
||||
class="md hydrated"
|
||||
aria-label="archive sharp"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form
|
||||
action="{%url 'objective-archive' id=own_objective.id %}?{{pg}}"
|
||||
onsubmit="return confirm('{% trans "Do you want archive this OKR ?" %}')"
|
||||
method="post"
|
||||
style="display: contents"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button
|
||||
class="oh-btn oh-btn--danger-outline w-100"
|
||||
title="{% trans 'Archive' %}"
|
||||
>
|
||||
<ion-icon
|
||||
name="archive-sharp"
|
||||
role="img"
|
||||
class="md hydrated"
|
||||
aria-label="archive sharp"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
{% endif %} {% if perms.pms.delete_employeeobjective %}
|
||||
<form
|
||||
action="{% url 'objective-delete' obj_id=own_objective.id %}"
|
||||
onsubmit="return confirm('{% trans "Do you want Delete this OKR ?" %}')"
|
||||
method="post"
|
||||
style="display: contents"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button
|
||||
class="oh-btn oh-btn--danger-outline w-100"
|
||||
title="{% trans 'Delete' %}"
|
||||
>
|
||||
<ion-icon
|
||||
name="trash-outline"
|
||||
role="img"
|
||||
class="md hydrated"
|
||||
aria-label="trash outline"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- pagination start -->
|
||||
<div class="oh-pagination">
|
||||
<span
|
||||
@@ -284,252 +309,261 @@
|
||||
</nav>
|
||||
</div>
|
||||
<!-- end of pagination -->
|
||||
<!-- end of own objective -->
|
||||
{% else %}
|
||||
<div class="d-flex justify-content-center align-items-center" style="height:60vh">
|
||||
<h5 class="oh-404__subtitle">{% trans "There are no Objectives available." %}</h5>
|
||||
</div>
|
||||
<div class="d-flex flex-column justify-content-center align-items-center" style="height:60vh; text-align: center;">
|
||||
<img style="display: block; width: 100px; margin: 20px auto;" src="{% static 'images/ui/goal.png' %}" class="" alt="Page not found. 404." /><br>
|
||||
<h5 class="oh-404__subtitle">{% trans "There are no Objectives available." %}</h5>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<!-- end of own objective -->
|
||||
|
||||
<div class="oh-tabs__content" id="tab_2">
|
||||
<!-- all objectives -->
|
||||
<div class="oh-card">
|
||||
{% dynamic_regroup all_objectives.object_list by field as okr_grouper %}
|
||||
{% for okr_list in okr_grouper %}
|
||||
<div class="oh-accordion-meta">
|
||||
<div class="oh-accordion-meta__item">
|
||||
<div
|
||||
class="oh-accordion-meta__header"
|
||||
onclick='$(this).toggleClass("oh-accordion-meta__header--show");'
|
||||
>
|
||||
<span class="oh-accordion-meta__title pt-3 pb-3">
|
||||
<div class="oh-tabs__input-badge-container">
|
||||
<span
|
||||
class="oh-badge oh-badge--secondary oh-badge--small oh-badge--round mr-1"
|
||||
>
|
||||
{{okr_list.list|length}}
|
||||
</span>
|
||||
{{okr_list.grouper}}
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-accordion-meta__body d-none">
|
||||
<div class="oh-sticky-table oh-sticky-table--no-overflow mb-5">
|
||||
|
||||
<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" style="width:10px;">
|
||||
<div class="centered-div">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="all-objects oh-input oh-input__checkbox"
|
||||
id = "Allobjectives"
|
||||
title='{% trans "Select All" %}'
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Owner" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Objective" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Due In" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Status" %}</div>
|
||||
<div class="oh-sticky-table__th"></div>
|
||||
</div>
|
||||
<!-- all objectives -->
|
||||
{% if all_objectives %}
|
||||
<div class="oh-card">
|
||||
{% dynamic_regroup all_objectives.object_list by field as okr_grouper %}
|
||||
{% for okr_list in okr_grouper %}
|
||||
<div class="oh-accordion-meta">
|
||||
<div class="oh-accordion-meta__item">
|
||||
<div
|
||||
class="oh-accordion-meta__header"
|
||||
onclick='$(this).toggleClass("oh-accordion-meta__header--show");'
|
||||
>
|
||||
<span class="oh-accordion-meta__title pt-3 pb-3">
|
||||
<div class="oh-tabs__input-badge-container">
|
||||
<span
|
||||
class="oh-badge oh-badge--secondary oh-badge--small oh-badge--round mr-1"
|
||||
>
|
||||
{{okr_list.list|length}}
|
||||
</span>
|
||||
{{okr_list.grouper}}
|
||||
</div>
|
||||
<div class="oh-sticky-table__tbody">
|
||||
{% for all_objective in okr_list.list %}
|
||||
<div class="oh-sticky-table__tr" draggable="true">
|
||||
<div class="oh-sticky-table__sd {% if all_objective.status == 'Closed' %}row-status--blue
|
||||
{% elif all_objective.status == 'On Track' %}row-status--yellow {% elif all_objective.status == 'Not Started' %}row-status--gray
|
||||
{% elif all_objective.status == 'Behind' %}row-status--orange {% elif all_objective.status == 'At Risk' %}row-status--red{% endif %}">
|
||||
<div class="centered-div">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="{{all_objective.id}}"
|
||||
value="{{all_objective.id}}"
|
||||
onchange="highlightRow($(this))"
|
||||
class="oh-input objective-checkbox oh-input__checkbox all-objects-row"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<a class="oh-sticky-table__td" style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=all_objective.id %} "
|
||||
>
|
||||
<div class="oh-profile oh-profile--md">
|
||||
<div class="oh-profile__avatar mr-1">
|
||||
<img
|
||||
src="{{all_objective.employee_id.get_avatar}}"
|
||||
class="oh-profile__image"
|
||||
</span>
|
||||
</div>
|
||||
<div class="oh-accordion-meta__body d-none">
|
||||
<div class="oh-sticky-table oh-sticky-table--no-overflow mb-5">
|
||||
|
||||
<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" style="width:10px;">
|
||||
<div class="centered-div">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="all-objects oh-input oh-input__checkbox"
|
||||
id = "Allobjectives"
|
||||
title='{% trans "Select All" %}'
|
||||
/>
|
||||
</div>
|
||||
<span class="oh-profile__name oh-text--dark">{{all_objective.employee_id}}</span>
|
||||
</div>
|
||||
</a>
|
||||
<a
|
||||
style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=all_objective.id %} "
|
||||
class="oh-sticky-table__td"
|
||||
>{{all_objective.objective}}</a
|
||||
>
|
||||
<a
|
||||
style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=all_objective.id %} "
|
||||
class="oh-sticky-table__td"
|
||||
>
|
||||
{{ current_date|timesince:all_objective.end_date }}</a
|
||||
>
|
||||
<a
|
||||
style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=all_objective.id %} "
|
||||
class="oh-sticky-table__td"
|
||||
>
|
||||
<div class="d-flex align-items-center">
|
||||
<span
|
||||
class="oh-dot oh-dot--small me-1 oh-dot--color{{all_objective.status}}"
|
||||
></span
|
||||
><span>{{all_objective.get_status_display}}</span>
|
||||
</div>
|
||||
</a>
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="oh-btn-group">
|
||||
{% if all_objective.archive %}
|
||||
<form
|
||||
action="{%url 'objective-archive' id=all_objective.id %}?{{pg}}"
|
||||
onsubmit="return confirm('{% trans "Do you want un-archive this OKR ?" %}')"
|
||||
method="post"
|
||||
style="display: contents"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button
|
||||
class="oh-btn oh-btn--danger-outline w-100"
|
||||
title="{% trans 'Un-archive' %}"
|
||||
>
|
||||
<ion-icon
|
||||
name="archive-sharp"
|
||||
role="img"
|
||||
class="md hydrated"
|
||||
aria-label="archive sharp"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form
|
||||
action="{%url 'objective-archive' id=all_objective.id %}?{{pg}}"
|
||||
onsubmit="return confirm('{% trans "Do you want archive this OKR ?" %}')"
|
||||
method="post"
|
||||
style="display: contents"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button
|
||||
class="oh-btn oh-btn--danger-outline w-100"
|
||||
title="{% trans 'Archive' %}"
|
||||
>
|
||||
<ion-icon
|
||||
name="archive-sharp"
|
||||
role="img"
|
||||
class="md hydrated"
|
||||
aria-label="archive sharp"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
{% endif %} {% if perms.pms.delete_employeeobjective %}
|
||||
<form
|
||||
action="{% url 'objective-delete' obj_id=all_objective.id %}"
|
||||
onsubmit="return confirm('{% trans "Do you want delete this OKR ?" %}')"
|
||||
method="post"
|
||||
style="display: contents"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button
|
||||
class="oh-btn oh-btn--danger-outline w-100"
|
||||
title="{% trans 'Delete' %}"
|
||||
>
|
||||
<ion-icon
|
||||
name="trash-outline"
|
||||
role="img"
|
||||
class="md hydrated"
|
||||
aria-label="trash outline"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Owner" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Objective" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Due In" %}</div>
|
||||
<div class="oh-sticky-table__th">{% trans "Status" %}</div>
|
||||
<div class="oh-sticky-table__th"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oh-sticky-table__tbody">
|
||||
{% for all_objective in okr_list.list %}
|
||||
<div class="oh-sticky-table__tr" draggable="true">
|
||||
<div class="oh-sticky-table__sd {% if all_objective.status == 'Closed' %}row-status--blue
|
||||
{% elif all_objective.status == 'On Track' %}row-status--yellow {% elif all_objective.status == 'Not Started' %}row-status--gray
|
||||
{% elif all_objective.status == 'Behind' %}row-status--orange {% elif all_objective.status == 'At Risk' %}row-status--red{% endif %}">
|
||||
<div class="centered-div">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="{{all_objective.id}}"
|
||||
value="{{all_objective.id}}"
|
||||
onchange="highlightRow($(this))"
|
||||
class="oh-input objective-checkbox oh-input__checkbox all-objects-row"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<a class="oh-sticky-table__td" style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=all_objective.id %} "
|
||||
>
|
||||
<div class="oh-profile oh-profile--md">
|
||||
<div class="oh-profile__avatar mr-1">
|
||||
<img
|
||||
src="{{all_objective.employee_id.get_avatar}}"
|
||||
class="oh-profile__image"
|
||||
/>
|
||||
</div>
|
||||
<span class="oh-profile__name oh-text--dark">{{all_objective.employee_id}}</span>
|
||||
</div>
|
||||
</a>
|
||||
<a
|
||||
style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=all_objective.id %} "
|
||||
class="oh-sticky-table__td"
|
||||
>{{all_objective.objective}}</a
|
||||
>
|
||||
<a
|
||||
style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=all_objective.id %} "
|
||||
class="oh-sticky-table__td"
|
||||
>
|
||||
{{ current_date|timesince:all_objective.end_date }}</a
|
||||
>
|
||||
<a
|
||||
style="color: inherit; text-decoration: none"
|
||||
href="{% url 'objective-detailed-view' emp_obj_id=all_objective.id %} "
|
||||
class="oh-sticky-table__td"
|
||||
>
|
||||
<div class="d-flex align-items-center">
|
||||
<span
|
||||
class="oh-dot oh-dot--small me-1 oh-dot--color{{all_objective.status}}"
|
||||
></span
|
||||
><span>{{all_objective.get_status_display}}</span>
|
||||
</div>
|
||||
</a>
|
||||
<div class="oh-sticky-table__td">
|
||||
<div class="oh-btn-group">
|
||||
{% if all_objective.archive %}
|
||||
<form
|
||||
action="{%url 'objective-archive' id=all_objective.id %}?{{pg}}"
|
||||
onsubmit="return confirm('{% trans "Do you want un-archive this OKR ?" %}')"
|
||||
method="post"
|
||||
style="display: contents"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button
|
||||
class="oh-btn oh-btn--danger-outline w-100"
|
||||
title="{% trans 'Un-archive' %}"
|
||||
>
|
||||
<ion-icon
|
||||
name="archive-sharp"
|
||||
role="img"
|
||||
class="md hydrated"
|
||||
aria-label="archive sharp"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form
|
||||
action="{%url 'objective-archive' id=all_objective.id %}?{{pg}}"
|
||||
onsubmit="return confirm('{% trans "Do you want archive this OKR ?" %}')"
|
||||
method="post"
|
||||
style="display: contents"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button
|
||||
class="oh-btn oh-btn--danger-outline w-100"
|
||||
title="{% trans 'Archive' %}"
|
||||
>
|
||||
<ion-icon
|
||||
name="archive-sharp"
|
||||
role="img"
|
||||
class="md hydrated"
|
||||
aria-label="archive sharp"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
{% endif %} {% if perms.pms.delete_employeeobjective %}
|
||||
<form
|
||||
action="{% url 'objective-delete' obj_id=all_objective.id %}"
|
||||
onsubmit="return confirm('{% trans "Do you want delete this OKR ?" %}')"
|
||||
method="post"
|
||||
style="display: contents"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button
|
||||
class="oh-btn oh-btn--danger-outline w-100"
|
||||
title="{% trans 'Delete' %}"
|
||||
>
|
||||
<ion-icon
|
||||
name="trash-outline"
|
||||
role="img"
|
||||
class="md hydrated"
|
||||
aria-label="trash outline"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="oh-pagination">
|
||||
<span
|
||||
class="oh-pagination__page"
|
||||
data-toggle="modal"
|
||||
data-target="#addEmployeeModal"
|
||||
></span>
|
||||
<nav class="oh-pagination__nav">
|
||||
<div class="oh-pagination__input-container me-3">
|
||||
<span class="oh-pagination__label me-1">{% trans "Page" %}</span>
|
||||
<input
|
||||
type="number"
|
||||
name="page"
|
||||
class="oh-pagination__input"
|
||||
value="{{all_objectives.number }}"
|
||||
min="1"
|
||||
hx-get="{% url 'objective-list-search' %}?{{pg}}"
|
||||
hx-target="#objective_list"
|
||||
/>
|
||||
<span class="oh-pagination__label"
|
||||
>{% trans "of" %} {{ all_objectives.paginator.num_pages }}</span
|
||||
>
|
||||
</div>
|
||||
<ul class="oh-pagination__items">
|
||||
{% if all_objectives.has_previous %}
|
||||
<li class="oh-pagination__item oh-pagination__item--wide">
|
||||
<a
|
||||
hx-get="{% url 'objective-list-search' %}?{{pg}}&page=1"
|
||||
class="oh-pagination__link"
|
||||
hx-target="#objective_list"
|
||||
>{% trans "First" %}</a
|
||||
>
|
||||
</li>
|
||||
<li class="oh-pagination__item oh-pagination__item--wide">
|
||||
<a
|
||||
hx-get="{% url 'objective-list-search' %}?{{pg}}&page={{ all_objectives.previous_page_number }}"
|
||||
class="oh-pagination__link"
|
||||
hx-target="#objective_list"
|
||||
>{% trans "Previous" %}</a
|
||||
>
|
||||
</li>
|
||||
{%endif %} {% if all_objectives.has_next %}
|
||||
<li class="oh-pagination__item oh-pagination__item--wide">
|
||||
<a
|
||||
hx-get="{% url 'objective-list-search' %}?{{pg}}&page={{ all_objectives.next_page_number }}"
|
||||
class="btn btn-outline-secondary"
|
||||
hx-target="#objective_list"
|
||||
>{% trans "Next" %}</a
|
||||
>
|
||||
</li>
|
||||
<li class="oh-pagination__item oh-pagination__item--wide">
|
||||
<a
|
||||
hx-get="{% url 'objective-list-search' %}?{{pg}}&page={{ all_objectives.paginator.num_pages }}"
|
||||
hx-target="#objective_list"
|
||||
class="oh-pagination__link"
|
||||
>{% trans "Last" %}</a
|
||||
>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="oh-pagination">
|
||||
<span
|
||||
class="oh-pagination__page"
|
||||
data-toggle="modal"
|
||||
data-target="#addEmployeeModal"
|
||||
></span>
|
||||
<nav class="oh-pagination__nav">
|
||||
<div class="oh-pagination__input-container me-3">
|
||||
<span class="oh-pagination__label me-1">{% trans "Page" %}</span>
|
||||
<input
|
||||
type="number"
|
||||
name="page"
|
||||
class="oh-pagination__input"
|
||||
value="{{all_objectives.number }}"
|
||||
min="1"
|
||||
hx-get="{% url 'objective-list-search' %}?{{pg}}"
|
||||
hx-target="#objective_list"
|
||||
/>
|
||||
<span class="oh-pagination__label"
|
||||
>{% trans "of" %} {{ all_objectives.paginator.num_pages }}</span
|
||||
>
|
||||
{% else %}
|
||||
<div class="d-flex flex-column justify-content-center align-items-center" style="height:60vh; text-align: center;">
|
||||
<img style="display: block; width: 100px; margin: 20px auto;" src="{% static 'images/ui/goal.png' %}" class="" alt="Page not found. 404." /><br>
|
||||
<h5 class="oh-404__subtitle">{% trans "There are no Objectives available." %}</h5>
|
||||
</div>
|
||||
<ul class="oh-pagination__items">
|
||||
{% if all_objectives.has_previous %}
|
||||
<li class="oh-pagination__item oh-pagination__item--wide">
|
||||
<a
|
||||
hx-get="{% url 'objective-list-search' %}?{{pg}}&page=1"
|
||||
class="oh-pagination__link"
|
||||
hx-target="#objective_list"
|
||||
>{% trans "First" %}</a
|
||||
>
|
||||
</li>
|
||||
<li class="oh-pagination__item oh-pagination__item--wide">
|
||||
<a
|
||||
hx-get="{% url 'objective-list-search' %}?{{pg}}&page={{ all_objectives.previous_page_number }}"
|
||||
class="oh-pagination__link"
|
||||
hx-target="#objective_list"
|
||||
>{% trans "Previous" %}</a
|
||||
>
|
||||
</li>
|
||||
{%endif %} {% if all_objectives.has_next %}
|
||||
<li class="oh-pagination__item oh-pagination__item--wide">
|
||||
<a
|
||||
hx-get="{% url 'objective-list-search' %}?{{pg}}&page={{ all_objectives.next_page_number }}"
|
||||
class="btn btn-outline-secondary"
|
||||
hx-target="#objective_list"
|
||||
>{% trans "Next" %}</a
|
||||
>
|
||||
</li>
|
||||
<li class="oh-pagination__item oh-pagination__item--wide">
|
||||
<a
|
||||
hx-get="{% url 'objective-list-search' %}?{{pg}}&page={{ all_objectives.paginator.num_pages }}"
|
||||
hx-target="#objective_list"
|
||||
class="oh-pagination__link"
|
||||
>{% trans "Last" %}</a
|
||||
>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
{% trans "On Track" %}
|
||||
</span>
|
||||
</div>
|
||||
{% if not request.GET.dashboard %}
|
||||
<!-- start of selection buttons -->
|
||||
<div
|
||||
class="oh-checkpoint-badge text-success mb-2"
|
||||
@@ -49,6 +50,7 @@
|
||||
</div> {% endcomment %}
|
||||
<div class="oh-checkpoint-badge text-danger mb-2" id="selectedShowObjectives" style="display: none"></div>
|
||||
<!-- end of selection buttons -->
|
||||
{% endif %}
|
||||
|
||||
<div class="oh-tabs" >
|
||||
|
||||
@@ -279,9 +281,10 @@
|
||||
<!-- end of pagination -->
|
||||
<!-- end of own objective -->
|
||||
{% else %}
|
||||
<div class="d-flex justify-content-center align-items-center" style="height:60vh">
|
||||
<h5 class="oh-404__subtitle">{% trans "There are no Objectives available." %}</h5>
|
||||
</div>
|
||||
<div class="d-flex flex-column justify-content-center align-items-center" style="height:60vh; text-align: center;">
|
||||
<img style="display: block; width: 100px; margin: 20px auto;" src="{% static 'images/ui/goal.png' %}" class="" alt="Page not found. 404." /><br>
|
||||
<h5 class="oh-404__subtitle">{% trans "There are no Objectives available." %}</h5>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -497,9 +500,11 @@
|
||||
<!-- end of pagination -->
|
||||
<!-- end of all objectives -->
|
||||
{% else %}
|
||||
<div class="d-flex justify-content-center align-items-center" style="height:60vh">
|
||||
<div class="d-flex flex-column justify-content-center align-items-center" style="height:60vh; text-align: center;">
|
||||
<img style="display: block; width: 100px; margin: 20px auto;" src="{% static 'images/ui/goal.png' %}" class="" alt="Page not found. 404." /><br>
|
||||
<h5 class="oh-404__subtitle">{% trans "There are no Objectives available." %}</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -316,7 +316,7 @@ def objective_list_search(request):
|
||||
search_val = request.GET.get("search")
|
||||
if search_val is None:
|
||||
search_val = ""
|
||||
|
||||
|
||||
user = request.user
|
||||
employee = Employee.objects.filter(employee_user_id=user).first()
|
||||
is_manager = Employee.objects.filter(
|
||||
@@ -422,7 +422,7 @@ def objective_detailed_view(request, emp_obj_id, **kwargs):
|
||||
# progress of objective calculation
|
||||
total_kr = key_results_all.count()
|
||||
try:
|
||||
progress = round(sum(kr.progress_percentage for kr in key_results_all) / (total_kr), 2)
|
||||
progress = int(sum(kr.progress_percentage for kr in key_results_all) / (total_kr))
|
||||
except (ZeroDivisionError, TypeError):
|
||||
progress = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user