diff --git a/erpnext/templates/includes/projects.css b/erpnext/templates/includes/projects.css index 6ad324624a..eede4e2d7c 100644 --- a/erpnext/templates/includes/projects.css +++ b/erpnext/templates/includes/projects.css @@ -85,7 +85,7 @@ float: right;*/ .timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon { - margin-top:10px; + margin-top:14px; background: #fff; color: #737881; display: block; diff --git a/erpnext/templates/includes/projects/macros.html b/erpnext/templates/includes/projects/macros.html index eb2b8dbfaf..a4abc94bb6 100644 --- a/erpnext/templates/includes/projects/macros.html +++ b/erpnext/templates/includes/projects/macros.html @@ -1 +1,2 @@ {% macro back_link(doc) %}&back-to=/projects?project={{ doc.name }}|{{ doc.project_name }}{% endmacro %} + diff --git a/erpnext/templates/includes/projects/project_issues.html b/erpnext/templates/includes/projects/project_issues.html index 0d569d86b0..5f9d26f811 100644 --- a/erpnext/templates/includes/projects/project_issues.html +++ b/erpnext/templates/includes/projects/project_issues.html @@ -4,7 +4,7 @@
-
- {% if issue.status != "Closed" %} - - {% endif %} -
-{% endfor %} +{% endfor %} \ No newline at end of file diff --git a/erpnext/templates/includes/projects/project_tasks.html b/erpnext/templates/includes/projects/project_tasks.html index a9517120d1..78cd9b6d3f 100644 --- a/erpnext/templates/includes/projects/project_tasks.html +++ b/erpnext/templates/includes/projects/project_tasks.html @@ -21,11 +21,6 @@ {% endif %} -
- {% if task.status != "Closed" %} - - {% endif %} -
diff --git a/erpnext/templates/pages/projects.html b/erpnext/templates/pages/projects.html index b348674cec..e32f56292a 100644 --- a/erpnext/templates/pages/projects.html +++ b/erpnext/templates/pages/projects.html @@ -43,6 +43,7 @@ {% if doc.timelines|length > 9 %}

{{ _("More") }}

{% endif %} + {% endif %}

@@ -51,47 +52,48 @@ {% if doc.tasks %}
-
- - +
+
+ + +
+
+ New task +
{% include "erpnext/templates/includes/projects/project_tasks.html" %}
- - {% if doc.tasks|length > 9 %} -

{{ _("More") }}

- {% endif %} +

{% else %}

No tasks

{% endif %} -

Add a new task

{{ _("Issues") }}

{% if doc.issues %}
-
- - +
+
+ + +
+
+ New issue +
- {% include "erpnext/templates/includes/projects/project_issues.html" %} + {% include "erpnext/templates/includes/projects/project_issues.html" %}
- - {% if doc.issues|length > 9 %} -

{{ _("More") }}

- {% endif %} +

{% else %}

No Issues

{% endif %} -

Add a new issue

-

{{ _("Time Logs") }}

diff --git a/erpnext/templates/pages/projects.js b/erpnext/templates/pages/projects.js index 331c2d4a18..0a296af5c4 100644 --- a/erpnext/templates/pages/projects.js +++ b/erpnext/templates/pages/projects.js @@ -59,8 +59,13 @@ frappe.ready(function() { }, dataType: "json", success: function(data) { + + console.log(data.message); + if(typeof data.message == 'undefined') { + $('.project-'+ item).html("No "+ item_status +" "+ item); + $(".more-"+ item).toggle(false); + } $('.project-'+ item).html(data.message); - $('.project-'+ item +'-section .btn-group .bold').removeClass('bold'); $('.btn-'+ item_status +'-'+ item).addClass( "bold" ); $(".more-"+ item).toggle(true); @@ -72,7 +77,7 @@ frappe.ready(function() { var more_items = function(item, item_status){ if(item_status) { - var item_status = $('.project-'+ item +'-section .btn-group .btn-primary').hasClass('btn-closed-'+ item) + var item_status = $('.project-'+ item +'-section .btn-group .bold').hasClass('btn-closed-'+ item) ? 'closed' : 'open'; } $.ajax({ @@ -87,6 +92,7 @@ frappe.ready(function() { }, dataType: "json", success: function(data) { + $(data.message).appendTo('.project-'+ item); if(typeof data.message == 'undefined') { $(".more-"+ item).toggle(false); diff --git a/erpnext/templates/pages/projects.py b/erpnext/templates/pages/projects.py index 8cec2b75c4..39648e390b 100644 --- a/erpnext/templates/pages/projects.py +++ b/erpnext/templates/pages/projects.py @@ -70,7 +70,7 @@ def get_tasks(project, start=0, search=None, item_status=None): if search: filters["subject"] = ("like", "%{0}%".format(search)) if item_status: - filters = {"status": item_status} + filters["status"] = item_status tasks = frappe.get_all("Task", filters=filters, fields=["name", "subject", "status", "exp_start_date", "exp_end_date", "priority"], limit_start=start, limit_page_length=10) @@ -97,7 +97,7 @@ def get_issues(project, start=0, search=None, item_status=None): if search: filters["subject"] = ("like", "%{0}%".format(search)) if item_status: - filters = {"status": item_status} + filters["status"] = item_status issues = frappe.get_all("Issue", filters=filters, fields=["name", "subject", "status", "opening_date", "resolution_date", "resolution_details"], order_by='modified desc',