Skip to content

Commit ee6c361

Browse files
committed
integrate bugs List in company dashboard
1 parent 3a62413 commit ee6c361

File tree

2 files changed

+62
-18
lines changed

2 files changed

+62
-18
lines changed

company/templates/company/company_manage_bugs.html

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,59 @@
33
Manage Bugs
44
{% endblock title %}
55
{% block body %}
6-
<style>
7-
.bottom-right {
8-
position: absolute;
9-
bottom: 10px;
10-
right: 15px;
11-
}
12-
</style>
13-
<div class="bottom-right">
14-
<a href="https://github.com/OWASP-BLT/BLT/blob/main/company/templates/company/company_manage_bugs.html">
15-
<i class="fab fa-github"></i>
16-
</a>
17-
<a href="https://www.figma.com/file/s0xuxeU6O2guoWEfA9OElZ/Design?node-id=3%3A76&t=pqxWpF3hcYxjEDrs-1">
18-
<i class="fab fa-figma"></i>
19-
</a>
6+
<div class="bg-[#F3F5F7] w-full h-full flex flex-col items-center">
7+
<div class="flex items-center md:justify-between w-full md:h-max mt-5 flex-col md:flex-row">
8+
<p class="text-red-700 font-satoshi font-bold text-[35px] px-8">Manage Bugs</p>
9+
<div class="w-full md:w-[15%] flex justify-center md:justify-end mr-10">
10+
<a href="{% url 'report' %}"
11+
class="flex items-center justify-center md:justify-center px-16 py-7 bg-[#DC4654] rounded-xl hover:bg-red-600 transition-all">
12+
<i class="fa-sharp fa-solid fa-plus fa-xl text-white"></i>
13+
</a>
14+
</div>
2015
</div>
21-
<div class="bg-[#F3F5F7]">
22-
<div class="w-full mt-5">
23-
<p class="text-[#464255] font-satoshi font-bold text-[35px] px-5">Manage Bugs</p>
16+
<div class="w-[96%] h-[70vh] overflow-y-scroll flow-root my-10">
17+
<div class="relative overflow-x-auto shadow-md sm:rounded-lg h-full bg-white">
18+
<table class="w-full text-sm text-left text-gray-500">
19+
<caption class="p-5 text-xl font-semibold text-left text-gray-900 bg-white">
20+
<div class="flex w-full justify-between">
21+
<h2 class="mt-1 text-xl font-extrabold text-gray-500">Bugs</h2>
22+
</div>
23+
</caption>
24+
<thead class="text-gray-700 uppercase bg-gray-50">
25+
<tr>
26+
<th scope="col" class="px-6 py-3 text-[1rem]">Description</th>
27+
<th scope="col" class="px-6 py-3 text-[1rem]">Created On</th>
28+
<th scope="col" class="px-6 py-3 text-[1rem]">Bug Type</th>
29+
<th scope="col" class="px-6 py-3 text-[1rem]">Status</th>
30+
<th scope="col" class="px-6 py-3 text-[1rem]"><span class="sr-only">View</span></th>
31+
</tr>
32+
</thead>
33+
<tbody>
34+
{% if issues %}
35+
{% for issue in issues %}
36+
<tr class="bg-white border-b">
37+
<th scope="row" class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap">{{ issue.description|slice:":25" }}...</th>
38+
<td class="px-6 py-4">{{ issue.created|date:"F j, Y" }}</td>
39+
<td class="px-6 py-4">{{ issue.get_label_display }}</td>
40+
<td class="px-6 py-4">
41+
{% if issue.status == 'open' %}
42+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Open</span>
43+
{% else %}
44+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">Closed</span>
45+
{% endif %}
46+
</td>
47+
<td class="px-6 py-4 text-right"><a href="{% url 'issue_view2' issue.pk %}" class="font-medium text-blue-600 hover:underline">View</a></td>
48+
</tr>
49+
{% endfor %}
50+
{% else %}
51+
<tr class="bg-white border-b">
52+
<th scope="row"
53+
class="px-6 py-4 font-medium text-red-500 whitespace-nowrap">No Issues Found</th>
54+
</tr>
55+
{% endif %}
56+
</tbody>
57+
</table>
2458
</div>
2559
</div>
60+
</div>
2661
{% endblock body %}

company/views.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,19 @@ def get(self, request, id, *args, **kwargs):
365365
.distinct()
366366
)
367367

368+
company_obj = Company.objects.filter(id=id).first()
369+
370+
# get all domains of this company
371+
domains = Domain.objects.filter(company_id=id)
372+
373+
# get all issues where the url is in the domains in descending order
374+
issues = Issue.objects.filter(domain__in=domains).order_by("-created")
375+
368376
context = {
369377
"company": id,
370378
"companies": companies,
371-
"company_obj": Company.objects.filter(id=id).first(),
379+
"company_obj": company_obj,
380+
"issues": issues,
372381
}
373382
return render(request, "company/company_manage_bugs.html", context=context)
374383

0 commit comments

Comments
 (0)