Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display actual data in the bugs on the new home page #1628

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions website/templates/_bug.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{% load gravatar %}
{% load static %}

<div class="bug-container flex flex-col p-5 bg-white m-1 w-[100%] h-[290px] rounded-[2.5rem] border-[#e8e8e8] border-2">
<div class="bug-author bg-red font-medium font-['Inter'] text-[#656565] flex flex-row items-center gap-[0.8rem]">
{% if bug.user.userprofile.avatar %}
<img src="{{ bug.user.userprofile.avatar }}" width="30" class="h-[30px] object-cover img-responsive rounded-full" loading="lazy">
{% elif bug.user.socialaccount_set.all.0.get_avatar_url %}
<img src="{{ bug.user.socialaccount_set.all.0.get_avatar_url }}" width="30"
class="h-[30px] object-cover img-responsive rounded-full" loading="lazy">
{% elif bug.user.email %}
<img src="{% gravatar_url bug.user.email 30 %}" width="30" class="h-[30px] object-cover img-responsive rounded-full" loading="lazy">
{% else %}
<img src="{% static 'images/dummy-user.png' %}" width="30"
class="h-[30px] object-cover img-responsive rounded-full" loading="lazy">
{% endif %}
<span class="whitespace-nowrap overflow-clip"> {{bug.user}} </span>
<div class="bug-type bg-[#0097ED] border-[#005AAD] ms-auto me-2 border-[1px] tracking-wider px-3 py-[1px] rounded-full font-['Nunito_Sans'] font-bold text-lg text-white">
{{bug.get_label_display}}
</div>
</div>
<div class="bug-desc py-2 h-[100%] font-['Barlow'] font-medium text-[#774343] text-3xl leading-10 overflow-clip">
{{bug.description}}
</div>
<div class="bug-images h-[50px] flex flex-row justify-between px-3 my-2">
{% for bug_key, bug_screenshots in bugs_screenshots.items %}
{% if bug == bug_key%}
{% for bug_screenshot in bug_screenshots %}
<img class="bug-img h-[100%] w-[70px] object-contain" src="{{bug_screenshot.image.url}}" alt="">
{% endfor %}
{% endif %}
{% endfor %}
</div>
<div class="bug-actions h-[45px] flex flex-row">
<svg class="scale-125 m-3" width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.46692 9.45723V18.6604" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658" stroke-linecap="round" stroke-linejoin="round"/>
<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"/>
</svg>
<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="M4.06152 19.5808V13.1385V3.93531" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658" stroke-linecap="round" stroke-linejoin="round"/>
<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>
<svg class="scale-125 m-3 ms-auto" width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.15" d="M4.18701 4.85562C4.18701 4.34735 4.59906 3.9353 5.10733 3.9353H17.9918C18.5001 3.9353 18.9122 4.34735 18.9122 4.85562V17.7401C18.9122 18.2484 18.5001 18.6604 17.9918 18.6604H5.10733C4.59906 18.6604 4.18701 18.2484 4.18701 17.7401V4.85562Z" fill="#8C0000" fill-opacity="0.74"/>
<path d="M17.0715 3.9353H6.02765C5.01109 3.9353 4.18701 4.75939 4.18701 5.77595V16.8198C4.18701 16.923 4.1955 17.0241 4.2118 17.1226C4.35621 17.995 5.11424 18.6604 6.02765 18.6604H17.0715C18.0881 18.6604 18.9122 17.8364 18.9122 16.8198V13.3135V5.77595C18.9122 4.75939 18.0881 3.9353 17.0715 3.9353Z" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658" stroke-linecap="round" stroke-linejoin="round"/>
<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>
<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>
</div>
</div>
2 changes: 1 addition & 1 deletion website/templates/includes/sidenav.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div>
<ul class="space-y-3 font-medium text-3xl mt-6 mb-0">
<li>
<a href="/all_activity" class=""><span class="">Issues</span></a>
<a href="/" class=""><span class="">Issues</span></a>
</li>
<li>
<a href="/companies" class=""><span class="">Companies</span></a>
Expand Down
47 changes: 2 additions & 45 deletions website/templates/new_home.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{% extends "base_new.html" %}

{% load gravatar %}


{% block hero %}
<style>
.hero-bugs-container {
Expand All @@ -11,48 +8,8 @@
</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]">
{% for i in '................................'|make_list %}
<div class="bug-container flex flex-col p-5 bg-white m-1 w-[100%] h-[290px] rounded-[2.5rem] border-[#e8e8e8] border-2">
<div class="bug-author bg-red font-medium font-['Inter'] text-[#656565] flex flex-row items-center gap-[0.8rem]">
{% gravatar request.user.email 30 '' 'gravatar rounded-full' %}
<span class="whitespace-nowrap overflow-clip"> Bug Author </span>
<div class="bug-type bg-[#0097ED] border-[#005AAD] ms-auto me-2 border-[1px] tracking-wider px-3 py-[1px] rounded-full font-['Nunito_Sans'] font-bold text-lg text-white">
Design
</div>
</div>
<div class="bug-desc py-2 h-[100%] font-['Barlow'] font-medium text-[#774343] text-3xl leading-10 overflow-clip">
{% comment %} Bug found 404 and missing information. Longer Desc. No image. Attached pictures. Bug Type Tag and many more to come. Bug Type Tag and many more to come {% endcomment %}
Bug found 404 and missing information
</div>
<div class="bug-images h-[50px] flex flex-row justify-between px-3 my-2">
<img class="bug-img h-[100%] w-[70px] object-contain" src="https://img.freepik.com/free-vector/camera-view-finder-display-frame_1017-36685.jpg" alt="">
<img class="bug-img h-[100%] w-[70px] object-contain" src="https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1024&h=1280&q=80" alt="">
<img class="bug-img h-[100%] w-[70px] object-contain" src="https://opengraph.githubassets.com/ddc640f0af969815383e29b7c829020f4ed4095c9cd541e98dafa8f69a25fbcd/tailwindlabs/tailwindcss/discussions/2727" alt="">
</div>
<div class="bug-actions h-[45px] flex flex-row">
<svg class="scale-125 m-3" width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.46692 9.45723V18.6604" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658" stroke-linecap="round" stroke-linejoin="round"/>
<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"/>
</svg>
<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="M4.06152 19.5808V13.1385V3.93531" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658" stroke-linecap="round" stroke-linejoin="round"/>
<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>
<svg class="scale-125 m-3 ms-auto" width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.15" d="M4.18701 4.85562C4.18701 4.34735 4.59906 3.9353 5.10733 3.9353H17.9918C18.5001 3.9353 18.9122 4.34735 18.9122 4.85562V17.7401C18.9122 18.2484 18.5001 18.6604 17.9918 18.6604H5.10733C4.59906 18.6604 4.18701 18.2484 4.18701 17.7401V4.85562Z" fill="#8C0000" fill-opacity="0.74"/>
<path d="M17.0715 3.9353H6.02765C5.01109 3.9353 4.18701 4.75939 4.18701 5.77595V16.8198C4.18701 16.923 4.1955 17.0241 4.2118 17.1226C4.35621 17.995 5.11424 18.6604 6.02765 18.6604H17.0715C18.0881 18.6604 18.9122 17.8364 18.9122 16.8198V13.3135V5.77595C18.9122 4.75939 18.0881 3.9353 17.0715 3.9353Z" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658" stroke-linecap="round" stroke-linejoin="round"/>
<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>
<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>
</div>
</div>
{% for bug in bugs %}
{% include '_bug.html' %}
{% endfor %}
</div>
{% endblock %}
8 changes: 8 additions & 0 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ def newhome(request, template="new_home.html"):
except:
pass

bugs=Issue.objects.exclude(Q(is_hidden=True) & ~Q(user_id=request.user.id))
bugs_screenshots = {}

for bug in bugs:
bugs_screenshots[bug] = IssueScreenshot.objects.filter(issue=bug)[0:3]

# latest_hunts_filter = request.GET.get("latest_hunts",None)

# bug_count = Issue.objects.all().count()
Expand Down Expand Up @@ -231,6 +237,8 @@ def newhome(request, template="new_home.html"):


context = {
"bugs": bugs,
"bugs_screenshots" : bugs_screenshots,
# "server_url": request.build_absolute_uri('/'),
# "activities": activities,
# "hunts": Hunt.objects.exclude(txn_id__isnull=True)[:4],
Expand Down
Loading