From 80e45828ae143338f69cc73db198a4e0dd6d4503 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 21 Nov 2022 17:42:53 +0530 Subject: [PATCH] fix: ux for project view on web --- .../includes/projects/project_tasks.html | 56 ++++++- erpnext/templates/pages/projects.html | 140 ++++++------------ 2 files changed, 101 insertions(+), 95 deletions(-) diff --git a/erpnext/templates/includes/projects/project_tasks.html b/erpnext/templates/includes/projects/project_tasks.html index 2b07a5f0d0..4069d3dcca 100644 --- a/erpnext/templates/includes/projects/project_tasks.html +++ b/erpnext/templates/includes/projects/project_tasks.html @@ -1,5 +1,57 @@ +{% macro task_row(task, indent) %} +
+ +
{{ task.status }}
+
+ {% if task.exp_end_date %} + {{ task.exp_end_date }} + {% else %} + -- + {% endif %} +
+
+ {% if task["_assign"] %} + {% set assigned_users = json.loads(task["_assign"])%} + {% for user in assigned_users %} + {% set user_details = frappe.db.get_value("User", user, + ["full_name", "user_image"], + as_dict = True)%} + {% if user_details.user_image %} + + + + {% else %} + +
+ {{ frappe.utils.get_abbr(user_details.full_name) }} +
+
+ {% endif %} + {% endfor %} + {% endif %} +
+
+ {{ frappe.utils.pretty_date(task.modified) }} +
+
+{% if task.children %} + {% for child in task.children %} + {{ task_row(child, indent + 30) }} + {% endfor %} +{% endif %} +{% endmacro %} + {% for task in doc.tasks %}
- {{ task_row(task, 0) }} + {{ task_row(task, 0) }}
-{% endfor %} +{% endfor %} \ No newline at end of file diff --git a/erpnext/templates/pages/projects.html b/erpnext/templates/pages/projects.html index 6d366c5ffe..cfe1cc8ff6 100644 --- a/erpnext/templates/pages/projects.html +++ b/erpnext/templates/pages/projects.html @@ -9,7 +9,7 @@ {% endblock %} {% block header %} -

{{ doc.project_name }}

+

{{ doc.project_name }}

{% endblock %} {% block style %} @@ -21,57 +21,58 @@ {% endblock %} {% block page_content %} - - {{ progress_bar(doc.percent_complete) }} - -
-

Status:

-

Progress: - {{ doc.percent_complete }} - % -

-

Hours Spent: - {{ doc.actual_time }} -

+
+
+
Status: {{ doc.status }}
+
Progress: {{ doc.percent_complete }}%
+
Hours Spent: {{ doc.actual_time | round }}
+
{{ progress_bar(doc.percent_complete) }} +
+ {% if doc.tasks %} -
-
-
-
-

Tasks

-

Status

-

End Date

-

Assigned To

- -
-
- {% include "erpnext/templates/includes/projects/project_tasks.html" %} -
+
+ + +
+
+
+
+
+
Tasks
+
Status
+
End Date
+
Assignment
+
Modified On
+
+
+ {% include "erpnext/templates/includes/projects/project_tasks.html" %} +
+
{% else %}

{{ _("No Tasks") }}

{% endif %} {% if doc.timesheets %} +
-
-

Timesheets

-

Status

-

From

-

To

-

Modified By

-

Modified On

+
+
Timesheet
+
Status
+
From
+
To
+
Modified By
+
Modified On
- {% include "erpnext/templates/includes/projects/project_timesheets.html" %} + {% include "erpnext/templates/includes/projects/project_timesheets.html" %}
{% else %} @@ -104,70 +105,23 @@
+ { % include "frappe/public/js/frappe/provide.js" % } + { % include "frappe/public/js/frappe/form/formatters.js" % } + {% endblock %} {% macro progress_bar(percent_complete) %} {% if percent_complete %} -
-
+ Project Progress: +
+
+
{% else %}
{% endif %} {% endmacro %} - -{% macro task_row(task, indent) %} -
- -
{{ task.status }}
-
- {% if task.exp_end_date %} - {{ task.exp_end_date }} - {% else %} - -- - {% endif %} -
-
- {% if task["_assign"] %} - {% set assigned_users = json.loads(task["_assign"])%} - {% for user in assigned_users %} - {% set user_details = frappe.db.get_value("User", user, - ["full_name", "user_image"], - as_dict = True)%} - {% if user_details.user_image %} - - - - {% else %} - -
- {{ frappe.utils.get_abbr(user_details.full_name) }} -
-
- {% endif %} - {% endfor %} - {% endif %} -
-
- {{ frappe.utils.pretty_date(task.modified) }} -
-
-{% if task.children %} - {% for child in task.children %} - {{ task_row(child, indent + 30) }} - {% endfor %} -{% endif %} -{% endmacro %}