[fix] back links from project web view
diff --git a/erpnext/templates/includes/projects/macros.html b/erpnext/templates/includes/projects/macros.html
new file mode 100644
index 0000000..eb2b8db
--- /dev/null
+++ b/erpnext/templates/includes/projects/macros.html
@@ -0,0 +1 @@
+{% 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 34f6633..0d569d8 100644
--- a/erpnext/templates/includes/projects/project_issues.html
+++ b/erpnext/templates/includes/projects/project_issues.html
@@ -1,10 +1,12 @@
+{%- from "templates/includes/projects/macros.html" import back_link -%}
+
{% for issue in doc.issues %}
<div class='issue'>
<div class='row project-item'>
<div class='col-xs-9'>
- <a class="no-decoration" href="/issues-view?name={{ issue.name}}">
+ <a class="no-decoration" href="/issues?name={{ issue.name}}{{ back_link(doc) }}">
<span class="indicator {{ "red" if issue.status=="Open" else "green" }}">
- {% if issue.status == "Closed" %}
+ {% if issue.status == "Closed" %}
{{ issue.subject }} resolved {{ frappe.utils.pretty_date(issue.resolution_date) }}
{% else %}
{{ issue.subject }} raised on {{ issue.opening_date }}
@@ -14,17 +16,17 @@
</div>
<div class='col-xs-3'>
<div class='pull-right'>
- {% if issue.todo %}
+ {% if issue.todo %}
<span class="avatar avatar-small" title="{{ issue.todo.owner }}"> <img src="{{ issue.todo.user_image }}"></span>
{% else %}
<span class="avatar avatar-small avatar-empty"></span>
{% endif %}
</div>
<div class='pull-right' style='padding-right:10px;'>
- {% if issue.status != "Closed" %}
+ {% if issue.status != "Closed" %}
<span class="text-extra-muted "> <i class="octicon octicon-x issue-x" title="Close" id = "{{issue.name}}"></i> </span>
{% endif %}
- </div>
+ </div>
</div>
</div>
</div>
diff --git a/erpnext/templates/includes/projects/project_tasks.html b/erpnext/templates/includes/projects/project_tasks.html
index b2be27b..a951712 100644
--- a/erpnext/templates/includes/projects/project_tasks.html
+++ b/erpnext/templates/includes/projects/project_tasks.html
@@ -1,8 +1,10 @@
+{%- from "templates/includes/projects/macros.html" import back_link -%}
+
{% for task in doc.tasks %}
<div class='task'>
<div class='row project-item'>
<div class='col-xs-9'>
- <a class="no-decoration" href="/tasks-view?name={{ task.name}}">
+ <a class="no-decoration" href="/tasks?name={{ task.name }}{{ back_link(doc) }}">
<span class="indicator {{ "orange" if task.status=="Open" else "green" }}">
{% if task.status == "Closed" %}
{{ task.subject }} completed on {{ task.closing_date }}
diff --git a/erpnext/templates/includes/projects/project_timelogs.html b/erpnext/templates/includes/projects/project_timelogs.html
index 4934032..7b5913b 100644
--- a/erpnext/templates/includes/projects/project_timelogs.html
+++ b/erpnext/templates/includes/projects/project_timelogs.html
@@ -1,12 +1,14 @@
+{%- from "templates/includes/projects/macros.html" import back_link -%}
+
{% for timelog in doc.timelogs %}
<div class='timelog'>
<div class='row project-item'>
<div class='col-xs-9'>
<a class="no-decoration" href="/timelog_info?timelog={{ timelog.name}}">
<span class="indicator {{ "green" if timelog.status=="Draft" else "blue" if timelog.status=="Submitted" else "darkgrey"}}">
-
+
{{ timelog.title }}: From {{ frappe.format_date(timelog.from_time) }} to {{ frappe.format_date(timelog.to_time) }}
-
+
</span>
</a>
</div>