Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 1 | {% extends "templates/web.html" %} |
| 2 | |
Jannat Patel | 5a42511 | 2021-07-01 17:17:34 +0530 | [diff] [blame] | 3 | {% block title %} |
| 4 | {{ doc.project_name }} |
| 5 | {% endblock %} |
| 6 | |
| 7 | {% block head_include %} |
| 8 | <link rel="stylesheet" href="/assets/frappe/css/font-awesome.css"> |
| 9 | {% endblock %} |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 10 | |
Kanchan Chauhan | 239b351 | 2016-05-02 11:43:44 +0530 | [diff] [blame] | 11 | {% block header %} |
Jannat Patel | 5a42511 | 2021-07-01 17:17:34 +0530 | [diff] [blame] | 12 | <h1>{{ doc.project_name }}</h1> |
Kanchan Chauhan | 2ad801c | 2016-03-22 16:00:41 +0530 | [diff] [blame] | 13 | {% endblock %} |
| 14 | |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 15 | {% block style %} |
Jannat Patel | 5a42511 | 2021-07-01 17:17:34 +0530 | [diff] [blame] | 16 | <style> |
| 17 | { |
| 18 | % include "templates/includes/projects.css"% |
| 19 | } |
| 20 | </style> |
Rushabh Mehta | b2269dd | 2016-03-23 18:28:50 +0530 | [diff] [blame] | 21 | {% endblock %} |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 22 | |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 23 | {% block page_content %} |
Rushabh Mehta | df7e523 | 2016-03-30 11:00:42 +0530 | [diff] [blame] | 24 | |
Jannat Patel | 5a42511 | 2021-07-01 17:17:34 +0530 | [diff] [blame] | 25 | {{ progress_bar(doc.percent_complete) }} |
Rushabh Mehta | b2269dd | 2016-03-23 18:28:50 +0530 | [diff] [blame] | 26 | |
Jannat Patel | 5a42511 | 2021-07-01 17:17:34 +0530 | [diff] [blame] | 27 | <div class="d-flex mt-5 mb-5 justify-content-between"> |
| 28 | <h4>Status:</h4> |
| 29 | <h4>Progress: |
| 30 | <span>{{ doc.percent_complete }} |
| 31 | %</span> |
| 32 | </h4> |
| 33 | <h4>Hours Spent: |
| 34 | <span>{{ doc.actual_time }}</span> |
| 35 | </h4> |
| 36 | </div> |
Rushabh Mehta | c20c536 | 2016-03-25 17:19:28 +0530 | [diff] [blame] | 37 | |
Jannat Patel | 5a42511 | 2021-07-01 17:17:34 +0530 | [diff] [blame] | 38 | {{ progress_bar(doc.percent_complete) }} |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 39 | |
Jannat Patel | 5a42511 | 2021-07-01 17:17:34 +0530 | [diff] [blame] | 40 | {% if doc.tasks %} |
| 41 | <div class="website-list"> |
| 42 | <div class="result"> |
| 43 | <div class="web-list-item transaction-list-item"> |
| 44 | <div class="row"> |
| 45 | <h3 class="col-xs-4">Tasks</h3> |
| 46 | <h3 class="col-xs-2">Status</h3> |
| 47 | <h3 class="col-xs-2">End Date</h3> |
| 48 | <h3 class="col-xs-2">Assigned To</h3> |
| 49 | <div class="col-xs-2 text-right"> |
| 50 | <a class="btn btn-secondary btn-light btn-sm" href='/tasks?new=1&project={{ doc.project_name }}'>{{ _("New task") }}</a> |
| 51 | </div> |
| 52 | </div> |
| 53 | </div> |
| 54 | {% include "erpnext/templates/includes/projects/project_tasks.html" %} |
| 55 | </div> |
| 56 | </div> |
| 57 | {% else %} |
| 58 | <p class="font-weight-bold">{{ _("No Tasks") }}</p> |
| 59 | {% endif %} |
Rushabh Mehta | b2269dd | 2016-03-23 18:28:50 +0530 | [diff] [blame] | 60 | |
Jannat Patel | 5a42511 | 2021-07-01 17:17:34 +0530 | [diff] [blame] | 61 | {% if doc.timesheets %} |
| 62 | <div class="website-list"> |
| 63 | <div class="result"> |
| 64 | <div class="web-list-item transaction-list-item"> |
| 65 | <div class="row"> |
| 66 | <h3 class="col-xs-2">Timesheets</h3> |
| 67 | <h3 class="col-xs-2">Status</h3> |
| 68 | <h3 class="col-xs-2">From</h3> |
| 69 | <h3 class="col-xs-2">To</h3> |
| 70 | <h3 class="col-xs-2">Modified By</h3> |
| 71 | <h3 class="col-xs-2 text-right">Modified On</h3> |
| 72 | </div> |
| 73 | </div> |
| 74 | {% include "erpnext/templates/includes/projects/project_timesheets.html" %} |
| 75 | </div> |
| 76 | </div> |
| 77 | {% else %} |
| 78 | <p class="font-weight-bold mt-5">{{ _("No Timesheets") }}</p> |
| 79 | {% endif %} |
Rushabh Mehta | b2269dd | 2016-03-23 18:28:50 +0530 | [diff] [blame] | 80 | |
Jannat Patel | 5a42511 | 2021-07-01 17:17:34 +0530 | [diff] [blame] | 81 | {% if doc.attachments %} |
| 82 | <div class='padding'></div> |
Rushabh Mehta | b2269dd | 2016-03-23 18:28:50 +0530 | [diff] [blame] | 83 | |
Jannat Patel | 5a42511 | 2021-07-01 17:17:34 +0530 | [diff] [blame] | 84 | <h4>{{ _("Attachments") }}</h4> |
| 85 | <div class="project-attachments"> |
| 86 | {% for attachment in doc.attachments %} |
| 87 | <div class="attachment"> |
| 88 | <a class="no-decoration attachment-link" href="{{ attachment.file_url }}" target="blank"> |
| 89 | <div class="row"> |
| 90 | <div class="col-xs-9"> |
| 91 | <span class="indicator red file-name"> |
| 92 | {{ attachment.file_name }}</span> |
| 93 | </div> |
| 94 | <div class="col-xs-3"> |
| 95 | <span class="pull-right file-size">{{ attachment.file_size }}</span> |
| 96 | </div> |
| 97 | </div> |
| 98 | </a> |
| 99 | </div> |
| 100 | {% endfor %} |
| 101 | </div> |
| 102 | {% endif %} |
JodeQ | 10dfd4a | 2018-09-10 13:40:43 +0200 | [diff] [blame] | 103 | |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 104 | </div> |
| 105 | |
| 106 | <script> |
Jannat Patel | 5a42511 | 2021-07-01 17:17:34 +0530 | [diff] [blame] | 107 | { % include "frappe/public/js/frappe/provide.js" % |
| 108 | } { % include "frappe/public/js/frappe/form/formatters.js" % |
| 109 | } |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 110 | </script> |
| 111 | |
Kanchan Chauhan | e14389e | 2016-03-23 14:14:38 +0530 | [diff] [blame] | 112 | {% endblock %} |
Jannat Patel | 5a42511 | 2021-07-01 17:17:34 +0530 | [diff] [blame] | 113 | |
| 114 | {% macro progress_bar(percent_complete) %} |
| 115 | {% if percent_complete %} |
| 116 | <div class="progress progress-hg" style="height: 5px;"> |
| 117 | <div class="progress-bar progress-bar-{{ 'warning' if percent_complete|round < 100 else 'success' }} active" role="progressbar" aria-valuenow="{{ percent_complete|round|int }}" aria-valuemin="0" aria-valuemax="100" style="width:{{ percent_complete|round|int }}%;"></div> |
| 118 | </div> |
| 119 | {% else %} |
| 120 | <hr> |
| 121 | {% endif %} |
| 122 | {% endmacro %} |
| 123 | |
| 124 | {% macro task_row(task, indent) %} |
| 125 | <div class="row mt-5 {% if task.children %} font-weight-bold {% endif %}"> |
| 126 | <div class="col-xs-4"> |
| 127 | <a class="nav-link " style="color: inherit; {% if task.parent_task %} margin-left: {{ indent }}px {% endif %}" href="/tasks?name={{ task.name | urlencode }}"> |
| 128 | {% if task.parent_task %} |
| 129 | <span class=""> |
| 130 | <i class="fa fa-level-up fa-rotate-90"></i> |
| 131 | </span> |
| 132 | {% endif %} |
| 133 | {{ task.subject }}</a> |
| 134 | </div> |
| 135 | <div class="col-xs-2">{{ task.status }}</div> |
| 136 | <div class="col-xs-2"> |
| 137 | {% if task.exp_end_date %} |
| 138 | {{ task.exp_end_date }} |
| 139 | {% else %} |
| 140 | -- |
| 141 | {% endif %} |
| 142 | </div> |
| 143 | <div class="col-xs-2"> |
| 144 | {% if task["_assign"] %} |
| 145 | {% set assigned_users = json.loads(task["_assign"])%} |
| 146 | {% for user in assigned_users %} |
| 147 | {% set user_details = frappe.db.get_value("User", user, |
| 148 | ["full_name", "user_image"], |
| 149 | as_dict = True)%} |
| 150 | {% if user_details.user_image %} |
| 151 | <span class="avatar avatar-small" style="width:32px; height:32px;" title="{{ user_details.full_name }}"> |
| 152 | <img src="{{ user_details.user_image }}"> |
| 153 | </span> |
| 154 | {% else %} |
| 155 | <span class="avatar avatar-small" style="width:32px; height:32px;" title="{{ user_details.full_name }}"> |
| 156 | <div class='standard-image' style='background-color: #F5F4F4; color: #000;'> |
| 157 | {{ frappe.utils.get_abbr(user_details.full_name) }} |
| 158 | </div> |
| 159 | </span> |
| 160 | {% endif %} |
| 161 | {% endfor %} |
| 162 | {% endif %} |
| 163 | </div> |
| 164 | <div class="col-xs-2 text-right"> |
| 165 | {{ frappe.utils.pretty_date(task.modified) }} |
| 166 | </div> |
| 167 | </div> |
| 168 | {% if task.children %} |
| 169 | {% for child in task.children %} |
| 170 | {{ task_row(child, indent + 30) }} |
| 171 | {% endfor %} |
| 172 | {% endif %} |
| 173 | {% endmacro %} |