Skip to content

Commit

Permalink
add quick click icons to report issue
Browse files Browse the repository at this point in the history
  • Loading branch information
DonnieBLT committed Nov 11, 2023
1 parent 0de510a commit c48742a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 17 deletions.
53 changes: 36 additions & 17 deletions website/templates/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,34 @@ <h3 class="text-xl font-bold leading-none text-red-500">Latest Issues</h3>
</p>

<div class="mt-12 grid grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6">
<div class="sm:col-span-5">
<label
for="url"
class="block text-2xl font-semibold leading-6 text-gray-900"
>{% trans 'DOMAIN URL' %}</label
>
<div class="mt-2">
<input
type="text"
name="url"
value="{{ request.GET.url }}"
autocomplete="domain_name"
placeholder="https://bugheist.com/search"
required
data-intro="Enter the website's complete url where you found the bug." data-step="1"
class="block w-full placeholder:text-xl rounded-md border-0 py-5 pl-3 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 sm:leading-6"
/>
<div class="sm:col-span-5 flex items-center">
<div>
<label for="url" class="block text-2xl font-semibold leading-6 text-gray-900">
{% trans 'DOMAIN URL' %}
</label>
<div class="mt-2">
<input
id="url"
type="text"
name="url"
value="{{ request.GET.url }}"
autocomplete="domain_name"
placeholder="https://bugheist.com/search"
required
data-intro="Enter the website's complete url where you found the bug." data-step="1"
class="block w-full placeholder:text-xl rounded-md border-0 py-5 pl-3 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 sm:leading-6"
/>
</div>
</div>
<!-- Top Domains List -->
<div class="flex ml-4">
{% for domain in top_domains %}
<img
src="https://www.google.com/s2/favicons?sz=32&domain_url={{ domain.domain__name }}"
alt="{{ domain.domain__name }}"
class="mr-2 cursor-pointer"
onclick="fillUrl('{{ domain.domain__name }}')"> <!-- JavaScript function to fill URL -->
{% endfor %}
</div>
</div>
<div class="h-full flex items-end w-full min-w-[150px]">
Expand All @@ -129,6 +140,14 @@ <h3 class="text-xl font-bold leading-none text-red-500">Latest Issues</h3>
</a>
</div>
</div>

<script>
// JavaScript function to fill the URL input field
function fillUrl(url) {
document.getElementById('url').value = url;
}
</script>


<div class="mt-12 grid grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6">

Expand Down
1 change: 1 addition & 0 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ def get_context_data(self, **kwargs):
context["hunts"] = Hunt.objects.values("id","name").filter(is_published=True,result_published=False)
context["report_on_hunt"] = False

context['top_domains'] = Issue.objects.values("domain__name").annotate(count=Count('domain__name')).order_by("-count")[:30]


return context
Expand Down

0 comments on commit c48742a

Please sign in to comment.