Skip to content

Commit

Permalink
Merge branch 'main' into anonymous-reporters
Browse files Browse the repository at this point in the history
  • Loading branch information
DonnieBLT authored Jan 6, 2024
2 parents df84274 + c11e348 commit e8b959d
Show file tree
Hide file tree
Showing 8 changed files with 429 additions and 574 deletions.
861 changes: 315 additions & 546 deletions company/templates/company/company_analytics.html

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions website/templates/_bug.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<path d="M16.0815 18.6604H7.46693H3.78564V9.4572H7.46693L12.2485 3.87867C12.7023 3.34933 13.4161 3.12177 14.0925 3.29086L14.1362 3.3018C15.3711 3.61052 15.9274 5.04941 15.2214 6.10849L12.9889 9.4572H17.1859C18.3474 9.4572 19.2186 10.5198 18.9908 11.6588L17.8864 17.1807C17.7143 18.0411 16.9589 18.6604 16.0815 18.6604Z" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
</button>
{% 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 %}
<script>
$(document).ready(function () {
Expand All @@ -61,7 +61,7 @@
<path d="M4.06152 3.93531H18.7867L14.1851 8.53692L18.7867 13.1385H4.06152" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
{% with user_issue_flagged_list=bug.user.userprofile.issue_flagged.all %}
{% with user_issue_flagged_list=user.userprofile.issue_flaged.all %}
{% if user_issue_flagged_list and bug in user_issue_flagged_list %}
<script>
$(document).ready(function () {
Expand All @@ -76,16 +76,16 @@
<path d="M10.6283 8.53688C10.6283 9.55346 9.80425 10.3775 8.78766 10.3775C7.7711 10.3775 6.94702 9.55346 6.94702 8.53688C6.94702 7.52032 7.7711 6.69624 8.78766 6.69624C9.80425 6.69624 10.6283 7.52032 10.6283 8.53688Z" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.21252 17.1226L7.7288 13.6063C8.35464 13.0587 9.26994 12.9987 9.96185 13.4601L10.4305 13.7724C11.0973 14.217 11.9754 14.1789 12.6013 13.6782L15.0384 11.7285C15.6596 11.2315 16.5249 11.1925 17.1853 11.6185C17.2584 11.6657 17.3236 11.7242 17.3852 11.7857L18.9129 13.3135" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<a
target="_blank"
href="https://twitter.com/intent/tweet?text=Bug Found on @{{ bug.domain_title }} - {{ bug.description }} Report: https://{% env 'FQDN' %}/issue2/{{ bug.id }}"
class="flex items-center px-10 h-14 rounded-xl font-extrabold hover:text-red-500 hover:bg-gray-100 m-5 xl:m-0"><svg class="scale-125 m-3 ms-1" width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.3375 5.77593C19.3375 7.30077 18.1014 8.5369 16.5765 8.5369C15.0516 8.5369 13.8156 7.30077 13.8156 5.77593C13.8156 4.2511 15.0516 3.01497 16.5765 3.01497C18.1014 3.01497 19.3375 4.2511 19.3375 5.77593Z" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658"/>
<path d="M8.00513 10.0626L14.1051 7.0126" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658"/>
<path d="M8.29475 11.2979C8.29475 12.8227 7.05863 14.0588 5.53379 14.0588C4.00896 14.0588 2.77283 12.8227 2.77283 11.2979C2.77283 9.77298 4.00896 8.5369 5.53379 8.5369C7.05863 8.5369 8.29475 9.77298 8.29475 11.2979Z" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658"/>
<path d="M14.1071 15.5846L8.01294 12.5375" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658"/>
<path d="M19.3375 16.8198C19.3375 18.3447 18.1014 19.5808 16.5765 19.5808C15.0516 19.5808 13.8156 18.3447 13.8156 16.8198C13.8156 15.2949 15.0516 14.0588 16.5765 14.0588C18.1014 14.0588 19.3375 15.2949 19.3375 16.8198Z" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658"/>
</svg>
<a class="w-fit"
target="_blank"
href="https://twitter.com/intent/tweet?text=Bug Found on @{{ bug.domain_title }} - {{ bug.description }} Report: https://{% env 'FQDN' %}/issue2/{{ bug.id }}"
class="flex items-center px-10 h-14 rounded-xl font-extrabold hover:text-red-500 hover:bg-gray-100 m-5 xl:m-0"><svg class="scale-125 m-3 ms-1" width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.3375 5.77593C19.3375 7.30077 18.1014 8.5369 16.5765 8.5369C15.0516 8.5369 13.8156 7.30077 13.8156 5.77593C13.8156 4.2511 15.0516 3.01497 16.5765 3.01497C18.1014 3.01497 19.3375 4.2511 19.3375 5.77593Z" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658"/>
<path d="M8.00513 10.0626L14.1051 7.0126" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658"/>
<path d="M8.29475 11.2979C8.29475 12.8227 7.05863 14.0588 5.53379 14.0588C4.00896 14.0588 2.77283 12.8227 2.77283 11.2979C2.77283 9.77298 4.00896 8.5369 5.53379 8.5369C7.05863 8.5369 8.29475 9.77298 8.29475 11.2979Z" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658"/>
<path d="M14.1071 15.5846L8.01294 12.5375" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658"/>
<path d="M19.3375 16.8198C19.3375 18.3447 18.1014 19.5808 16.5765 19.5808C15.0516 19.5808 13.8156 18.3447 13.8156 16.8198C13.8156 15.2949 15.0516 14.0588 16.5765 14.0588C18.1014 14.0588 19.3375 15.2949 19.3375 16.8198Z" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658"/>
</svg>
</a>
</div>
</div>
71 changes: 71 additions & 0 deletions website/templates/_leaderboard_widget.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{% load gravatar %}
{% load humanize %}

<div class="row-start-1 bug-container leaderboard-widget flex flex-col p-5 pt-3 bg-[white] m-1 w-[100%] row-span-2 rounded-[2.5rem] border-[#e8e8e8] border-2 font-['Inter'] h-[630px]">

<div class="font-['Barlow_Semi_Condensed'] font-semibold text-[black] text-[35px] text-center mb-2">LEADERBOARD</div>

<div class="bg-[#EAEAEA] font-semibold p-3 mt- rounded-2xl">
The 1st Place Hunter for will receive
<div class="bg-white p-2 text-[1.35rem] rounded-xl border-[#BF1919] border-2">
No sponsored prizes this month<br>
<div class="my-2 mt-3">
<a href="/sponsor" class="bg-red-500 text-white px-4 py-2 rounded text-xl border border-[#ac2925] hover:bg-[#c9302c] hover:border-[#761c19] hover:text-[#e8e8e8] rounded-lg"> Sponsor a Prize</a>
</div>
</div>
</div>

<div class="users-all h-full max-h-full overflow-y-auto my-3 font-['Barlow']">
{% if not leaderboard %}
Leaderboard has been reset for {% now "F" %}, be the first to find issues!
{% endif %}
{% for leader in leaderboard %}

<a href="/profile/{{ leader.username }}" class="flex flex-row h-[4rem] items-center my-2 mx-1 hover:bg-[#e8e8e8] rounded-2xl">

<span class="h-full w-[8rem] flex justify-center items-center scale-[0.65]">
{% if leader.userprofile.avatar %}
<img src="{{ leader.userprofile.avatar }}" class="profileimage object-cover">
{% elif user.socialaccount_set.all.0.get_avatar_url %}
<img src="{{ leader.socialaccount_set.all.0.get_avatar_url }}" class="profileimage object-cover">
{% else %}
<img src="{% gravatar_url leader.email 50 %}" class="profileimage object-cover">
{% endif %}
</span>

<span class="w-full overflow-clip font-semibold text-[#500000bd] text-[18px] mb-2"> {{ leader.username }} </span>

<span class="rank me-2 w-[5.5rem] flex flex-row items-end text-black font-semibold h-[2rem] rounded-full
{% if forloop.counter == 1 %}bg-[gold]{% endif %}
{% if forloop.counter == 2 %}bg-[#CDCDCD]{% endif %}
{% if forloop.counter == 3 %}bg-[#F8BF95]{% endif %}
">
<span class="ms-auto text-[15px] mb-[-1.1px]"> {{ forloop.counter }} </span>
<span class="me-auto text-[10px] mb-[0.8px]">{{ forloop.counter|ordinal|slice:"1:" }}</span>
</span>

</a>
{% endfor %}
</div>

<div class="">
<a href="/leaderboard" class="btn btn-default btn-block submit_button p-2 rounded-2xl"> View All</a>
<a href="/leaderboard/monthly" class="btn btn-default btn-block submit_button p-2 rounded-2xl"> Filter Monthly</a>
<a href="/leaderboard/each-month" class="btn btn-default btn-block submit_button p-2 rounded-2xl"> View Monthly</a>
</div>

</div>

{% comment %} positions the leaderboard rightmost {% endcomment %}
<script>
document.addEventListener('DOMContentLoaded', function() {
const grid = document.querySelector('.hero-bugs-container');
const child = document.querySelector('.leaderboard-widget');

if (grid && child) {
const columns = getComputedStyle(grid).gridTemplateColumns.split(' ').length;

child.style.gridColumn = columns;
}
});
</script>
4 changes: 2 additions & 2 deletions website/templates/base_new.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Inter' rel='stylesheet'>
<link href='https://fonts.googleapis.com/css?family=Barlow:500' rel='stylesheet'>
<link href="https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:wght@600&family=Barlow:wght@500;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans" rel="stylesheet">
<link href="{% static 'css/main.css' %}" rel="stylesheet" type="text/css">
<link href="{% static 'css/text-slider.css' %}" rel="stylesheet" type="text/css">
Expand All @@ -60,7 +60,7 @@

</head>

<body class="relative min-h-[100vh] flex flex-col bg-[#F7F7F7] font-['Ubuntu']">
<body class="relative min-h-[100vh] flex flex-col bg-[#F7F7F7] font-['Inter']">

{% comment %} navigation {% endcomment %}
{% include "includes/header.html" %}
Expand Down
6 changes: 3 additions & 3 deletions website/templates/leaderboard_eachmonth.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<h1 class="page-header">Monthly Leaderboard</h1>
</div>
</div>
<div class="row">
<div class="row" style="display: flex;justify-content: center; align-items: center;">
<div class="col-lg-9">
<div class="list-group">
{%if not leaderboard%}
Expand All @@ -67,9 +67,9 @@ <h1 class="page-header">Monthly Leaderboard</h1>
{% if month.user.userprofile.avatar %}
<img src="{{ month.user.userprofile.avatar }}" class="img-responsive img-thumbnail profileimage">
{% elif user.socialaccount_set.all.0.get_avatar_url %}
<img src="{{ month.user.socialaccount_set.all.0.get_avatar_url }}" class="profileimage">
<img src="{{ month.user.socialaccount_set.all.0.get_avatar_url }}" class="img-responsive img-thumbnail profileimage">
{% else %}
<img src="{% gravatar_url month.user.email 50 %}" class="profileimage">
<img src="{% gravatar_url month.user.email 50 %}" class="img-responsive img-thumbnail profileimage">
{% endif %}
<a href="/profile/{{ month.user.username }}">{{ month.user.username }}</a>
<span class="pull-right badge">{{ month.user.total_score }} Points</span>
Expand Down
20 changes: 15 additions & 5 deletions website/templates/leaderboard_global.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -48,13 +58,13 @@
{% endblock %}

{% block content %}
<div class="row container-min-height">
<div class="row container-min-height" style="display:flex;justify-content:center">
<div class="col-lg-6" style="display: flex; justify-content: center; align-items: center;">
<h1 class="page-header">Global Leaderboard</h1>
</div>
</div>
<div class="row">
<div class="col-lg-9">
<div class="row" style="display:flex;justify-content:center">
<div class="col-md-8">
<div class="list-group">
{%if not leaderboard%}
<p style="color: red;">No data for this month</p>
Expand All @@ -64,9 +74,9 @@ <h1 class="page-header">Global Leaderboard</h1>
{% if leader.userprofile.avatar %}
<img src="{{ leader.userprofile.avatar }}" class="img-responsive img-thumbnail profileimage">
{% elif leader.socialaccount_set.all.0.get_avatar_url %}
<img src="{{ leader.socialaccount_set.all.0.get_avatar_url }}" class="profileimage">
<img src="{{ leader.socialaccount_set.all.0.get_avatar_url }}" class="img-responsive img-thumbnail profileimage">
{% else %}
<img src="{% gravatar_url leader.email 50 %}" class="profileimage">
<img src="{% gravatar_url leader.email 50 %}" class="img-responsive img-thumbnail profileimage">
{% endif %}
<a href="/profile/{{ leader.username }}">{{ leader.username }}</a>
<span class="pull-right badge">{{ leader.total_score }} Points</span>
Expand Down
7 changes: 6 additions & 1 deletion website/templates/new_home.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
}
</style>
<div class="font-['Barlow'] text-[#2B2B2B] text-5xl tracking-wide font-semibold mb-0 mt-10 ms-[4.3%]">Find bugs, earn points, prize and cash!</div>
<div class="hero-bugs-container mx-[4%] my-[2.5rem] grid grid-flow-row gap-[25px]">
<div class="hero-bugs-container mx-[4%] my-[2.5rem] grid grid-rows-2 gap-[25px]">

{% include '_report_widget.html' %}

{% include '_leaderboard_widget.html' %}

{% for bug in bugs %}
{% include '_bug.html' %}

{% endfor %}
</div>

Expand Down
10 changes: 5 additions & 5 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e8b959d

Please sign in to comment.