diff --git a/pms/filters.py b/pms/filters.py index dbee266da..95b42d095 100644 --- a/pms/filters.py +++ b/pms/filters.py @@ -302,6 +302,7 @@ class EmployeeObjectiveFilter(FilterSet): 'start_date', 'end_date', 'employee_id', + 'status', ] def search_method(self, queryset, _, value: str): diff --git a/pms/static/src/dashboard/pmsChart.js b/pms/static/src/dashboard/pmsChart.js index 7a1c4ad0f..2d9cb0de7 100644 --- a/pms/static/src/dashboard/pmsChart.js +++ b/pms/static/src/dashboard/pmsChart.js @@ -30,20 +30,20 @@ if (objectiveChart != null) { let label = e.chart.data.labels[dataIndex]; let params = "?status=" + label + "&archive=false" + "&dashboard=True"; - // $.ajax({ - // url: "/pms/objective-list-search" + params, - // type: "GET", - // headers: { - // "X-Requested-With": "XMLHttpRequest", - // }, - // success: (response) => { - // $("#dashboard").html(response); - // }, - // error: (error) => { - // console.log("Error", error); - // }, - // }); - // $("#back_button").removeClass("d-none"); + $.ajax({ + url: "/pms/objective-dashboard-view" + params, + type: "GET", + headers: { + "X-Requested-With": "XMLHttpRequest", + }, + success: (response) => { + $("#dashboard").html(response); + }, + error: (error) => { + console.log("Error", error); + }, + }); + $("#back_button").removeClass("d-none"); }, }, plugins: [{ diff --git a/pms/templates/okr/emp_objective/emp_objective_dashboard_view.html b/pms/templates/okr/emp_objective/emp_objective_dashboard_view.html new file mode 100644 index 000000000..f174a7816 --- /dev/null +++ b/pms/templates/okr/emp_objective/emp_objective_dashboard_view.html @@ -0,0 +1,239 @@ +{% load static i18n %} +{% load i18n %} +{% load widget_tweaks %} {% load basefilters %} {% load pmsfilters %} +{% comment %}
{% endcomment %} +
+

+ {% trans "Employee Objectives" %} +

+
+{% comment %}
{% endcomment %} +{% comment %}
{% endcomment %} + {% comment %}
{% endcomment %} +
+ {% for emp_objective in emp_objectives %} + {% if perms.pms.view_employeeobjective or emp_objective|is_manager_or_owner:request.user %} +
+
+
+
+
+
+ + {{emp_objective.employee_key_result.all|length}} + + {{emp_objective}} +
+ {% if emp_objective.employee_key_result.first %} +
+
+
+
+
{{emp_objective.progress_percentage}} %
+
+ {% endif %} +
+
+ {% comment %}
{% endcomment %} + +
+ {% comment %} {% if request.user|is_reportingmanager or perms.pms.view_employeekeyresult %} {% endcomment %} + + + + {% comment %} {% endif %} {% endcomment %} + {% if request.user|is_reportingmanager or perms.pms.view_employeekeyresult %} + + + + {% endif %} + {% if request.user|is_reportingmanager or perms.pms.add_employeekeyresult %} + + {% endif %} + {% if request.user|is_reportingmanager or perms.pms.add_employeeobjective %} + +
+
+ + +
+
+ {% endif %} + + +
+
+
+
+
+ +
+
+
+ +
+ {% endif %} + {% endfor %} +
+ {% comment %}
{% endcomment %} +
+
+
+
+{% comment %}
{% endcomment %} + + + \ No newline at end of file diff --git a/pms/templates/okr/emp_objective/emp_objective_list.html b/pms/templates/okr/emp_objective/emp_objective_list.html index 97e0e012c..f26f07353 100644 --- a/pms/templates/okr/emp_objective/emp_objective_list.html +++ b/pms/templates/okr/emp_objective/emp_objective_list.html @@ -2,6 +2,15 @@ {% load i18n %} {% load widget_tweaks %} {% load basefilters %} {% load pmsfilters %} {% include "filter_tags.html" %} +{% if messages %} +
+ {% for message in messages %} +
+ {{ message }} +
+ {% endfor %} +
+{% endif %} {% for emp_objective in emp_objectives %} {% if perms.pms.view_employeeobjective or emp_objective|is_manager_or_owner:request.user %}
@@ -91,7 +100,7 @@ {% trans "Edit" %} @@ -100,22 +109,18 @@
  • {% trans "Unarchive" %}
  • {% else %}
  • {% trans "Archive" %}
  • {% endif %} @@ -126,10 +131,10 @@ {% trans "Delete" %} {% endif %} diff --git a/pms/templates/okr/emp_objective/emp_objective_nav.html b/pms/templates/okr/emp_objective/emp_objective_nav.html index 8ae19112b..5a50d0b2f 100644 --- a/pms/templates/okr/emp_objective/emp_objective_nav.html +++ b/pms/templates/okr/emp_objective/emp_objective_nav.html @@ -102,6 +102,10 @@ {{emp_obj_form.form.end_date_till}}
    +
    + + {{emp_obj_form.form.status}} +
    diff --git a/pms/templates/okr/emp_objective_form.html b/pms/templates/okr/emp_objective_form.html index 81d482848..b540cdaee 100644 --- a/pms/templates/okr/emp_objective_form.html +++ b/pms/templates/okr/emp_objective_form.html @@ -5,7 +5,7 @@

    {% trans "Update Employee Objective" %}

    - diff --git a/pms/templates/okr/key_result/kr_dashboard_view.html b/pms/templates/okr/key_result/kr_dashboard_view.html new file mode 100644 index 000000000..59f627b70 --- /dev/null +++ b/pms/templates/okr/key_result/kr_dashboard_view.html @@ -0,0 +1,301 @@ +{% load static i18n %} +{% load i18n %} +{% load widget_tweaks %} {% load basefilters %} {% load pmsfilters %} +{% comment %}
    {% endcomment %} +
    +

    + {% trans "Employee Key Results" %} +

    +
    +{% comment %}
    {% endcomment %} +{% comment %}
    +
    {% endcomment %} +
    + {% for krs_list in krs %} +
    +
    +
    + +
    + + {{krs_list.list.paginator.count}} + + {{krs_list.grouper}} +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    {% trans "Title" %}
    +
    {% trans "Start Value" %}
    +
    {% trans "Current Value" %}
    +
    {% trans "Target Value" %}
    +
    {% trans "Progress Percentage" %}
    +
    {% trans "Start Date" %}
    +
    {% trans "End Date" %}
    +
    {% trans "Status" %}
    + {% if perms.pms.change_employeeobjective or emp_objective|is_manager:request.user %} +
    {% trans "Actions" %}
    + {% endif %} +
    +
    +
    + {% for kr in krs_list.list %} +
    +
    +
    + +
    +
    +
    + + {{kr.key_result_id}} + {% comment %} {% endcomment %} + + + {% comment %} {% endcomment %} + +
    +
    {{kr.start_value}}
    +
    + +
    +
    {{kr.target_value}}
    +
    {{kr.progress_percentage}}%
    +
    {{kr.start_date}}
    +
    {{kr.end_date}}
    +
    {{kr.get_status_display}} + {% comment %} {% endcomment %} +
    + {% if perms.pms.change_employeeobjective or emp_objective|is_manager:request.user %} +
    +
    + +
    + + {% csrf_token %} + +
    +
    +
    + {% endif %} +
    + {% endfor %} +
    +
    +
    + {% comment %}
    + + {% trans "Page" %} {{ krs_list.list.number }} {% trans "of" %} {{ krs_list.list.paginator.num_pages }}. + + +
    +
    {% endcomment %} +
    +
    + {% endfor %} +
    + {% comment %}
    {% endcomment %} +{% comment %}
    {% endcomment %} + + + \ No newline at end of file diff --git a/pms/templates/okr/objective_creation.html b/pms/templates/okr/objective_creation.html index 5b5c032fa..400de2115 100644 --- a/pms/templates/okr/objective_creation.html +++ b/pms/templates/okr/objective_creation.html @@ -44,7 +44,7 @@ {% endif %} - @@ -52,13 +52,13 @@ {% if update %}
    {% else %} {% endif %} diff --git a/pms/templates/okr/okr_detailed_view.html b/pms/templates/okr/okr_detailed_view.html index 41059a290..ede73aea3 100644 --- a/pms/templates/okr/okr_detailed_view.html +++ b/pms/templates/okr/okr_detailed_view.html @@ -91,7 +91,7 @@ {% if perms.pms.change_objective %} {% endif %} {% if perms.pms.add_employeeobjective %} diff --git a/pms/templates/okr/okr_list.html b/pms/templates/okr/okr_list.html index 39ad93451..a9124703a 100644 --- a/pms/templates/okr/okr_list.html +++ b/pms/templates/okr/okr_list.html @@ -251,7 +251,7 @@ {% if perms.pms.change_objective %} {% endif %} {% comment %} {% endcomment %} @@ -487,7 +487,7 @@ {% if perms.pms.change_objective %} {% endif %} {% if perms.pms.delete_objective %} diff --git a/pms/templates/okr/okr_nav.html b/pms/templates/okr/okr_nav.html index 031c3e6ca..55b4ce522 100644 --- a/pms/templates/okr/okr_nav.html +++ b/pms/templates/okr/okr_nav.html @@ -217,9 +217,9 @@