-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.html
More file actions
250 lines (208 loc) · 10.7 KB
/
Copy pathtask.html
File metadata and controls
250 lines (208 loc) · 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
{% include 'links.html'%}
{%if session['role'] == 'PROJECT MANAGER' %}
{% include 'phome.html' %}
{% endif %}
{%if session['role'] == 'Team Member' %}
{% include 'thome.html' %}
{% endif %}
{% if session['role'] == 'admin' %}
{% include 'ahead.html' %}
{% endif %}
<style>
.discussion-container {
margin-top: 10px;
}
.discussion-scroll {
max-height: 250px; /* adjust as needed */
overflow-y: auto;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
background-color: #f9f9f9;
}
</style>
<div class="row-1">
{%if session['role'] == 'PROJECT MANAGER' %}
<div class="coll-4">
<form method="POST" action="/add_task_action" enctype="multipart/form-data">
<input type="hidden" name="project_id" value="{{project_id}}">
<label for="task_title" class="form-label-1">Task Title</label>
<input type="text" class="form-control" id="task_title" name="task_title" required>
<label for="description" class="form-label-1">Description</label>
<textarea class="form-control" id="description" name="description" rows="3" required></textarea>
<label for="expected_completed_date" class="form-label-1">Expected Completion Date</label>
<input type="datetime-local" class="form-control" id="expected_completed_date" name="expected_completed_date" required>
<label for="assigned_to_member_id" class="form-label-1">Assigned To Member</label>
<select class="form-select-1" name="assigned_to_member_id" required>
<option value="">Select a member</option>
{% for member in team_members %}
<option value="{{ member._id }}">{{ member.first_name }} {{ member.last_name }}</option>
{% endfor %}
</select>
<label class="form-label-1" for="files">Choose files to upload:</label>
<input type="file" id="files" name="files" multiple>
<label for="assigned_by_role" class="form-label-1">Assigned By Role</label>
<select class="form-select-1" name="assigned_by_role" required>
<option value="Developer">Developer</option>
<option value="Tester">Tester</option>
<option value="Front-End Developer">Front-End Developer</option>
</select>
<input type="hidden" name="assigned_by_member_id" value="{{ session['user_id'] }}">
<button type="submit" class="btn-primary mt-3">Create Task</button>
</form>
</div>
{% endif %}
{%if session['role'] == 'PROJECT MANAGER' %}
<div class="coll-8">
<div class="project-grid">
{% for task in tasks %}
<div class="project-card">
<div class="card-body">
{% set project_managers=get_project_manager_name_by_project_manager_id(task['assigned_by_member_id']) %}
<h5 class="card-title " style="text-align: center; font-size: 25px;" >{{task['task_title'] }}</h5>
<div class="row p-15" >
<div class="card-section ml-21 ">
<strong>Assigned To:</strong>
{{ get_user_details_by_id(task['assigned_to_member_id'])['name'] }}
</div>
<div class="card-section ml-21" >
<strong>Assigned By:</strong>{{project_managers['first_name']}}
</div>
<div class="card-section ml-21">
<strong>Assigned On:</strong> {{ task.assigned_date.strftime('%Y-%m-%d %H:%M') if task.assigned_date else 'Not Available' }}
</div>
</div>
<p class="card-text">{{ task['description'] }}</p>
<div class="card-section">
<strong>Expected Completion:</strong> {{ task.expected_completed_date }}
</div>
<div class="card-section">
<strong>Status:</strong> {{ task['status'] }}
</div>
<div class="row">
<div class="card-footer" style="width:20%">
<a href="/sub_task?task_id={{task['_id']}}&assigned_by_member_id={{ task['assigned_by_member_id']}}&assigned_to_member_id={{ task['assigned_to_member_id'] }}" class="task-btn">SUB TASK</a>
</div>
<div class="card-footer ml-20" style="width:20%">
<a href="/discussion?task_id={{task['_id']}}&assigned_by_member_id={{ task['assigned_by_member_id']}}&assigned_to_member_id={{ task['assigned_to_member_id'] }}" class="task-btn">DISCUSSION</a>
</div>
</div>
</div>
</div>
{% if session['role'] == 'Team Member' %}
{% if task['status'] != 'Completed' %}
{% if task['status'] == 'Assigned' %}
<a href="/to_do?task_id={{ task['_id'] }}" class="task-btn">TO DO</a>
{% endif %}
{% if task['status'] == 'To Do' %}
<a href="/complete?task_id={{ task['_id'] }}" class="task-btn complete-btn">Complete</a>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
{% if session['role'] == 'Team Member' or session['role']=='admin'%}
<div class="col-12">
<div class="row project-grid">
{% for task in tasks %}
<div class="row project-card p-20">
<div class="col-6">
<div class="card-body p-20">
<h5 class="card-title text-center" style="font-size: 25px;">{{ task['task_title'] }}</h5>
<div class="card-section">
<strong>Assigned To:</strong>
{{ get_user_details_by_id(task['assigned_to_member_id'])['name'] }}
</div>
<div class="card-section">
<strong>Assigned By:</strong>
{{ get_project_manager_name_by_project_manager_id(task['assigned_by_member_id'])['first_name'] }}
</div>
<div class="card-section">
<strong>Assigned On:</strong>
{{ task.assigned_date.strftime('%Y-%m-%d %H:%M') if task.assigned_date else 'Not Available' }}
</div>
<p class="card-text">{{ task['description'] }}</p>
<div class="card-section">
<strong>Expected Completion:</strong> {{ task.expected_completed_date }}
</div>
<div class="card-section">
<strong>Status:</strong> {{ task['status'] }}
</div>
{% if task['task_resources'] %}
{% for file in task['task_resources'] %}
<a href="{{ url_for('static', filename='files/' ~ file) }}" target="_blank">View Resources</a><br>
{% endfor %}
{% else %}
<p>No files uploaded.</p>
{% endif %}
<div class="card-footer mt-2">
<a href="/sub_task?task_id={{task['_id']}}&assigned_by_member_id={{ task['assigned_by_member_id']}}&assigned_to_member_id={{ task['assigned_to_member_id'] }}" class="task-btn" style="width:25%">SUB TASK</a>
</div>
{% if session['role'] == 'Team Member' and session['team_member_id'] == str(task['assigned_to_member_id']) %}
{% if task['status'] != 'Completed' %}
{% if task['status'] == 'Assigned' %}
<a href="/to_do?task_id={{ task['_id'] }}&project_id={{project_id}}" class="task-btn mt-10" style="width:25%">TO DO</a>
{% endif %}
{% if task['status'] == 'To Do' %}
<a href="/complete?task_id={{ task['_id'] }}&project_id={{project_id}}" class="task-btn complete-btn mt-10" style="width:25%">Complete</a>
{% endif %}
{% endif %}
{% endif %}
</div>
</div>
<div class="col-6">
<div class="card p-10">
<form action="add_comment_action" method="post">
<input type="hidden" name="task_id" value="{{task['_id']}}">
<div class="row info-container p-20">
<div class="col-4 p-10">
<div class="form-group">
<label for="bug_comment" class="form-label-1">BUG COMMENT</label>
<input type="text" class="form-control" id="bug_comment" name="bug_comment" style="height:40px" >
</div>
</div>
<div class="col-3 ml-10 p-10" >
<div class="form-group">
<label for="discussion" class="form-label-1">DISCUSSION</label>
<textarea class="form-control" id="discussion" name="discussion" style="height:40px" ></textarea>
</div>
</div>
<div class="col-4 ml-10 mt-5 p-10">
<div class="form-group mt-20">
<input type="submit" class="task-btn btn-primary mt-10" style="width:50%" value="Add Comment">
</div>
</div>
</div>
</form>
<hr>
<div class="discussion-container">
<div class="ver" style="text-align:center">Discussions</div>
<div class="discussion-scroll">
{% for task_discussion in task.task_discussions %}
<div class="row">
<div class="col-6">
<div class="card-section ml-21" style="font-size:10px">Comment by</div>
<div class="card-section ml-21" > <strong>{{ task_discussion['message_by_name'] }}</strong> <p style="font-size:10px"> ({{ task_discussion['date'].strftime("%Y-%m-%d %I%:%m %p") }})</p></div>
</div>
<div class="col-6">
<div class="card-section ml-21" style="font-size:10px">Bug Comment</div>
<div class="card-section ml-21" > <strong>{{ task_discussion['bug_comment'] }}</strong></div>
</div>
<div class="card-section ml-20">
<strong>Discussion:</strong> {{ task_discussion['discussion'] }}
</div>
</div>
<hr>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
</div>