diff --git a/pms/static/src/dashboard/pmsChart.js b/pms/static/src/dashboard/pmsChart.js index cbac71966..4c8def50d 100644 --- a/pms/static/src/dashboard/pmsChart.js +++ b/pms/static/src/dashboard/pmsChart.js @@ -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, diff --git a/pms/templates/okr/group_by.html b/pms/templates/okr/group_by.html index 1fc82d56c..dec922dcc 100644 --- a/pms/templates/okr/group_by.html +++ b/pms/templates/okr/group_by.html @@ -1,14 +1,7 @@ {% load attendancefilters %} {% load basefilters %} {% load static %} {% load i18n %} {% include 'filter_tags.html' %} - - - -{% load i18n %} -{% load static %} -{% load basefilters %} -{% include 'filter_tags.html' %}
@@ -77,150 +70,182 @@
{% if own_objectives.object_list %} -
-
-
-
-
-
- +
+ {% dynamic_regroup own_objectives.object_list by field as okr_grouper %} + {% for okr_list in okr_grouper %} +
+
+
+ +
+ + {{okr_list.list|length}} + + {{okr_list.grouper}} +
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+
{% trans "Owner" %}
+
{% trans "Objective" %}
+
{% trans "Due In" %}
+
{% trans "Status" %}
+
+
+
+
+ {% for own_objective in own_objectives.object_list %} +
+
+
+ +
+
+ +
+
+ +
+ {{own_objective.employee_id}} +
+
+ {{own_objective.objective}} + + {{ current_date|timesince:own_objective.end_date }} + + +
+ {{own_objective.get_status_display}} +
+
+
+
+ {% if own_objective.archive %} +
+ {% csrf_token %} + +
+ {% else %} +
+ {% csrf_token %} + +
+ {% endif %} {% if perms.pms.delete_employeeobjective %} +
+ {% csrf_token %} + +
+ {% endif %} +
+
+
+ {% endfor %} +
+
+
+
+
+
-
-
{% trans "Owner" %}
-
{% trans "Objective" %}
-
{% trans "Due In" %}
-
{% trans "Status" %}
-
-
-
-
- {% for own_objective in own_objectives.object_list %} -
-
-
- -
-
- -
-
- -
- {{own_objective.employee_id}} -
-
- {{own_objective.objective}} - - {{ current_date|timesince:own_objective.end_date }} - - -
- {{own_objective.get_status_display}} -
-
-
-
- {% if own_objective.archive %} -
- {% csrf_token %} - -
- {% else %} -
- {% csrf_token %} - -
- {% endif %} {% if perms.pms.delete_employeeobjective %} -
- {% csrf_token %} - -
- {% endif %} -
-
-
{% endfor %} -
-
+ + +
- {% else %} -
-
{% trans "There are no Objectives available." %}
-
+
+ Page not found. 404.
+
{% trans "There are no Objectives available." %}
+
{% endif %}
+
- -
- {% dynamic_regroup all_objectives.object_list by field as okr_grouper %} - {% for okr_list in okr_grouper %} -
-
-
- -
- - {{okr_list.list|length}} - - {{okr_list.grouper}} -
-
-
-
-
- -
-
-
-
-
-
- -
-
-
{% trans "Owner" %}
-
{% trans "Objective" %}
-
{% trans "Due In" %}
-
{% trans "Status" %}
-
-
+ + {% if all_objectives %} +
+ {% dynamic_regroup all_objectives.object_list by field as okr_grouper %} + {% for okr_list in okr_grouper %} +
+
+
+ +
+ + {{okr_list.list|length}} + + {{okr_list.grouper}}
-
- {% for all_objective in okr_list.list %} -
-
-
- -
-
- -
-
- +
+
+
+ +
+
+
+
+
+
+
- {{all_objective.employee_id}} -
-
- {{all_objective.objective}} - - {{ current_date|timesince:all_objective.end_date }} - -
- {{all_objective.get_status_display}} -
-
-
-
- {% if all_objective.archive %} -
- {% csrf_token %} - -
- {% else %} -
- {% csrf_token %} - -
- {% endif %} {% if perms.pms.delete_employeeobjective %} -
- {% csrf_token %} - -
- {% endif %} +
+
{% trans "Owner" %}
+
{% trans "Objective" %}
+
{% trans "Due In" %}
+
{% trans "Status" %}
+
+
+ {% for all_objective in okr_list.list %} +
+
+
+ +
+
+ +
+
+ +
+ {{all_objective.employee_id}} +
+
+ {{all_objective.objective}} + + {{ current_date|timesince:all_objective.end_date }} + +
+ {{all_objective.get_status_display}} +
+
+
+
+ {% if all_objective.archive %} +
+ {% csrf_token %} + +
+ {% else %} +
+ {% csrf_token %} + +
+ {% endif %} {% if perms.pms.delete_employeeobjective %} +
+ {% csrf_token %} + +
+ {% endif %} +
+
+
+ {% endfor %} +
- {% endfor %}
+
-
+ {% endfor %} +
+
+ +
- {% endfor %} -
-
- - -
+ {% endif %} +
diff --git a/pms/templates/okr/objective_list.html b/pms/templates/okr/objective_list.html index 489c1c5d5..a330ac7c4 100644 --- a/pms/templates/okr/objective_list.html +++ b/pms/templates/okr/objective_list.html @@ -25,6 +25,7 @@ {% trans "On Track" %}
+{% if not request.GET.dashboard %}
{% endcomment %} +{% endif %}
@@ -279,9 +281,10 @@ {% else %} -
-
{% trans "There are no Objectives available." %}
-
+
+ Page not found. 404.
+
{% trans "There are no Objectives available." %}
+
{% endif %}
@@ -497,9 +500,11 @@ {% else %} -
+
+ Page not found. 404.
{% trans "There are no Objectives available." %}
-
+
+ {% endif %}
diff --git a/pms/views.py b/pms/views.py index 73a156788..923c3d9dd 100644 --- a/pms/views.py +++ b/pms/views.py @@ -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