blob: 76eaf75cf3087b4c78327324b91ad2c23bc5d41d [file] [log] [blame]
Kanchan Chauhanb3fe6a42016-03-16 18:01:22 +05301{% extends "templates/web.html" %}
2
Jannat Patel5a425112021-07-01 17:17:34 +05303{% 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 Chauhanb3fe6a42016-03-16 18:01:22 +053010
Kanchan Chauhan239b3512016-05-02 11:43:44 +053011{% block header %}
Jannat Patel5a425112021-07-01 17:17:34 +053012 <h1>{{ doc.project_name }}</h1>
Kanchan Chauhan2ad801c2016-03-22 16:00:41 +053013{% endblock %}
14
Kanchan Chauhanb3fe6a42016-03-16 18:01:22 +053015{% block style %}
Jannat Patel5a425112021-07-01 17:17:34 +053016 <style>
17 {
18 % include "templates/includes/projects.css"%
19 }
20 </style>
Rushabh Mehtab2269dd2016-03-23 18:28:50 +053021{% endblock %}
Kanchan Chauhanb3fe6a42016-03-16 18:01:22 +053022
Kanchan Chauhanb3fe6a42016-03-16 18:01:22 +053023{% block page_content %}
Rushabh Mehtadf7e5232016-03-30 11:00:42 +053024
Jannat Patel5a425112021-07-01 17:17:34 +053025 {{ progress_bar(doc.percent_complete) }}
Rushabh Mehtab2269dd2016-03-23 18:28:50 +053026
Jannat Patel5a425112021-07-01 17:17:34 +053027 <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 Mehtac20c5362016-03-25 17:19:28 +053037
Jannat Patel5a425112021-07-01 17:17:34 +053038 {{ progress_bar(doc.percent_complete) }}
Kanchan Chauhanb3fe6a42016-03-16 18:01:22 +053039
Jannat Patel5a425112021-07-01 17:17:34 +053040 {% 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 Mehtab2269dd2016-03-23 18:28:50 +053060
Jannat Patel5a425112021-07-01 17:17:34 +053061 {% 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 Mehtab2269dd2016-03-23 18:28:50 +053080
Jannat Patel5a425112021-07-01 17:17:34 +053081 {% if doc.attachments %}
82 <div class='padding'></div>
Rushabh Mehtab2269dd2016-03-23 18:28:50 +053083
Jannat Patel5a425112021-07-01 17:17:34 +053084 <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 %}
JodeQ10dfd4a2018-09-10 13:40:43 +0200103
Kanchan Chauhanb3fe6a42016-03-16 18:01:22 +0530104</div>
105
106<script>
Jannat Patel5a425112021-07-01 17:17:34 +0530107 { % include "frappe/public/js/frappe/provide.js" %
108 } { % include "frappe/public/js/frappe/form/formatters.js" %
109 }
Kanchan Chauhanb3fe6a42016-03-16 18:01:22 +0530110</script>
111
Kanchan Chauhane14389e2016-03-23 14:14:38 +0530112{% endblock %}
Jannat Patel5a425112021-07-01 17:17:34 +0530113
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 %}