diff --git a/company/templates/company/company_analytics.html b/company/templates/company/company_analytics.html index 216320693..a681749f8 100644 --- a/company/templates/company/company_analytics.html +++ b/company/templates/company/company_analytics.html @@ -1,24 +1,21 @@ -{% extends 'company/company_dashboard_base.html' %} -{% load static %} -{% block title %} Company Analytics {% endblock title %} +{% extends 'company/company_dashboard_base.html' %} +{% load static %} +{% block title %} Company Analytics {% endblock title %} {% block body %} -
+

Dashboard

- -
+ +
+ class="flex justify-center items-center bg-white w-[340px] h-[172px] rounded-xl hover:scale-110 transition-all">
-
+
@@ -32,12 +29,9 @@
+ class="flex flex-wrap justify-center items-center bg-white w-[340px] h-[172px] rounded-xl hover:scale-110 transition-all">
-
+
@@ -51,12 +45,9 @@
+ class="flex flex-wrap justify-center items-center bg-white w-[340px] h-[172px] rounded-xl hover:scale-110 transition-all">
-
+
@@ -70,12 +61,9 @@
+ class="flex flex-wrap justify-center items-center bg-white w-[340px] h-[172px] rounded-xl hover:scale-110 transition-all">
-
+
@@ -89,10 +77,10 @@
-
-
-
-
+
+
+
+

Bug Reported Type

@@ -100,7 +88,7 @@

Bug Reported Type

-
+

Reported on Domains

@@ -110,238 +98,101 @@

Reported on Domains

-
-
-

Monthly Reports

-
- - - - - 2023 - - - - -
+
+

Monthly Reports

+
+ + + + + 2023 + + + +
-
-
+
+

Total Reported

{% if bug_rate_increase_descrease_weekly.is_increasing %} - + - - + + {% else %} - + - - + + {% endif %}

- {{bug_rate_increase_descrease_weekly.this_week_issue_count}}Bugs + {{bug_rate_increase_descrease_weekly.this_week_issue_count}}Bugs

- + {{bug_rate_increase_descrease_weekly.percent_increase}}% {% if bug_rate_increase_descrease_weekly.is_increasing %} Increasing {% else %} Decreasing {% endif %} compared to last week

-
+

Accepted Bugs

{% if accepted_bug_rate_increase_descrease_weekly.is_increasing %} - + - - + + {% else %} - + - - + + {% endif %}

- {{accepted_bug_rate_increase_descrease_weekly.this_week_issue_count}}Accepted Bugs + {{accepted_bug_rate_increase_descrease_weekly.this_week_issue_count}}Accepted + Bugs

- + {{accepted_bug_rate_increase_descrease_weekly.percent_increase}}% {% if accepted_bug_rate_increase_descrease_weekly.is_increasing %} @@ -471,359 +322,277 @@

Transaction History

-->
- -
-
-
-

Your balance

- - - - - -
-

- $120,435.00(USD) -

-

From Jan 01, 2022 to Jan 31, 2022

-
- -
+

+ $120,435.00(USD) +

+

From Jan 01, 2022 to Jan 31, 2022

+
+ + +
+
+
+
+

Spent On Bug Types

+ + d="M5 10.4166C3.9 10.4166 3 11.3541 3 12.5C3 13.6458 3.9 14.5833 5 14.5833C6.1 14.5833 7 13.6458 7 12.5C7 11.3541 6.1 10.4166 5 10.4166Z" + stroke="#1A202C" stroke-width="1.5" /> + d="M19 10.4166C17.9 10.4166 17 11.3541 17 12.5C17 13.6458 17.9 14.5833 19 14.5833C20.1 14.5833 21 13.6458 21 12.5C21 11.3541 20.1 10.4166 19 10.4166Z" + stroke="#1A202C" stroke-width="1.5" /> + d="M12 10.4166C10.9 10.4166 10 11.3541 10 12.5C10 13.6458 10.9 14.5833 12 14.5833C13.1 14.5833 14 13.6458 14 12.5C14 11.3541 13.1 10.4166 12 10.4166Z" + stroke="#1A202C" stroke-width="1.5" /> - Transfer - -
-
-
-
-

Spent On Bug Types

- - - - - -
-
- -
+
+
+ +
-
-

Total Spent

- ${{ total_info.total_money_distributed }} -
-
- {% for bugtype, money_spent in spent_on_bugtypes.zipped_data %} +
+

Total Spent

+ ${{ total_info.total_money_distributed }} +
+
+ {% for bugtype, money_spent in spent_on_bugtypes.zipped_data %}
-
+
{{ bugtype }} -
- ${{ money_spent }} +
+ ${{ money_spent }}
- {% endfor %} + {% endfor %} +
-
{% endblock body %} {% block js %} - + - - -{% endblock %} + }, + }, + }, + }); + } + + function populateSpentOnBugTypes() { + const ctx2 = document.getElementById("spentOnBugTypes"); + + new Chart(ctx2, { + type: "doughnut", + data: { + labels: JSON.parse('{{ spent_on_bugtypes.labels | safe }}'), + datasets: [ + { + data: JSON.parse('{{ spent_on_bugtypes.data | safe }}'), + borderRadius: 5, + cutout: 80, + backgroundColor: [ + "rgb(235, 124, 166)", + "rgb(255, 172, 200)", + "rgb(204, 111, 248)", + "rgb(124, 92, 252)", + "rgb(92, 175, 252)", + "rgb(161, 169, 254)", + "rgb(161, 169, 254)", + "rgb(161, 169, 254)", + ], + hoverOffset: 4, + spacing: 8, + }, + ], + }, + options: { + plugins: { + legend: { + display: false, + }, + }, + }, + }); + } + + populateSpentOnBugTypes(); + populateMonthlyReportBarChart(); + populateReportOnDomainsPie(); + populateBugTypePie(); + + +{% endblock %} \ No newline at end of file diff --git a/website/templates/_bug.html b/website/templates/_bug.html index cd62fe9e5..700a4c045 100644 --- a/website/templates/_bug.html +++ b/website/templates/_bug.html @@ -46,7 +46,7 @@ - {% with user_issue_upvoted_list=bug.user.userprofile.issue_upvoted.all %} + {% with user_issue_upvoted_list=user.userprofile.issue_upvoted.all %} {% if user_issue_upvoted_list and bug in user_issue_upvoted_list %} diff --git a/website/templates/base_new.html b/website/templates/base_new.html index b966816f7..bdab8a870 100644 --- a/website/templates/base_new.html +++ b/website/templates/base_new.html @@ -33,7 +33,7 @@ - + @@ -60,7 +60,7 @@ - + {% comment %} navigation {% endcomment %} {% include "includes/header.html" %} diff --git a/website/templates/leaderboard_eachmonth.html b/website/templates/leaderboard_eachmonth.html index c3660a566..aa56eaf0d 100644 --- a/website/templates/leaderboard_eachmonth.html +++ b/website/templates/leaderboard_eachmonth.html @@ -50,7 +50,7 @@

Monthly Leaderboard

-
+
{%if not leaderboard%} @@ -67,9 +67,9 @@

Monthly Leaderboard

{% if month.user.userprofile.avatar %} {% elif user.socialaccount_set.all.0.get_avatar_url %} - + {% else %} - + {% endif %} {{ month.user.username }} {{ month.user.total_score }} Points diff --git a/website/templates/leaderboard_global.html b/website/templates/leaderboard_global.html index 50578262a..c69c13fbe 100644 --- a/website/templates/leaderboard_global.html +++ b/website/templates/leaderboard_global.html @@ -20,6 +20,16 @@ margin-left: 10px; } + @media (min-height: 800px) and (min-width: 992px) { + .col-md-8 { + width: 66.66666667%; + }} + @media (min-height: 800px) and (min-width: 360px) { + .col-md-8 { + width: 90%; + font-size: small; + }} + .silver { background-color: lightblue; color: #333; @@ -48,13 +58,13 @@ {% endblock %} {% block content %} -
+

Global Leaderboard

-
-
+
+
{%if not leaderboard%}

No data for this month

@@ -64,9 +74,9 @@

Global Leaderboard

{% if leader.userprofile.avatar %} {% elif leader.socialaccount_set.all.0.get_avatar_url %} - + {% else %} - + {% endif %} {{ leader.username }} {{ leader.total_score }} Points diff --git a/website/templates/new_home.html b/website/templates/new_home.html index 19daf5e00..3075b3bd4 100644 --- a/website/templates/new_home.html +++ b/website/templates/new_home.html @@ -7,10 +7,15 @@ }
Find bugs, earn points, prize and cash!
-
+
+ {% include '_report_widget.html' %} + + {% include '_leaderboard_widget.html' %} + {% for bug in bugs %} {% include '_bug.html' %} + {% endfor %}
diff --git a/website/views.py b/website/views.py index 671856889..78b1f2f51 100644 --- a/website/views.py +++ b/website/views.py @@ -194,7 +194,7 @@ def newhome(request, template="new_home.html"): for bug in bugs: bugs_screenshots[bug] = IssueScreenshot.objects.filter(issue=bug)[0:3] - paginator = Paginator(bugs, 7) + paginator = Paginator(bugs, 9) page_number = request.GET.get('page') page_obj = paginator.get_page(page_number) @@ -246,10 +246,10 @@ def newhome(request, template="new_home.html"): # "server_url": request.build_absolute_uri('/'), # "activities": activities, # "hunts": Hunt.objects.exclude(txn_id__isnull=True)[:4], - # "leaderboard": User.objects.filter( - # points__created__month=datetime.now().month, - # points__created__year=datetime.now().year, - # ) + "leaderboard": User.objects.filter( + points__created__month=datetime.now().month, + points__created__year=datetime.now().year, + ) # .annotate(total_score=Sum("points__score")) # .order_by("-total_score")[:10], # "bug_count": bug_count,