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

Enhancement: Bug Details Page; Revision FINAL #2360

Merged
merged 8 commits into from
Jun 19, 2024
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
104 changes: 43 additions & 61 deletions website/templates/includes/_like_dislike_widget.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{% comment %} views {% endcomment %}
<button disabled
class="like_unlike border-[1px] rounded-2xl shadow-sm mb-3 cursor-pointer relative transform-[0] font-medium text-[#3e3446] bg-white border-black-2 text-[1.3rem] leading-4 p-4 "
class="like_unlike border-[1px] rounded-2xl shadow-sm mb-3 cursor-pointer relative transform-[0] font-bold text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 "
type="button">
<span id="likes" class="flex flex-row gap-2 items-center">
{{ object.views }}
<span>Views</span>
<span id="likes" class="flex items-end">
{{ object.views }} &nbsp;
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 562 352"
height="16px"
Expand All @@ -15,10 +14,15 @@
</button>
{% comment %} likes {% endcomment %}
{% if request.user.is_authenticated %}
<button name="{{ object.pk }}" {% comment %} {{device}} is passed by _like_dislike_share.html {% endcomment %} data-tooltip-target="tooltip-bottom-{{ device }}-like" data-tooltip-placement="bottom" type="submit" id="like_unlike" class="like_unlike rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-medium text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 " type="button">
<span id="likes" class="flex flex-row gap-2 items-center">
{{ likes }}
<span>Likes</span>
<button name="{{ object.pk }}"
data-tooltip-target="tooltip-bottom-{{ object.pk }}-like"
data-tooltip-placement="bottom"
type="submit"
id="like_unlike"
class="like_unlike rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-bold text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 "
type="button">
<span id="likes" class="flex items-end">
{{ likes }} &nbsp;
{% if isLiked %}
{% include "./_tooltip3.html" with text="Unlike" sno=object.pk widget="like" %}
<svg xmlns="http://www.w3.org/2000/svg"
Expand All @@ -41,10 +45,10 @@
</span>
</button>
{% else %}
<button data-tooltip-target="tooltip-bottom-{{ device }}-like"
<button data-tooltip-target="tooltip-bottom-{{ object.pk }}-like"
data-tooltip-placement="bottom"
onclick="window.location.href='/accounts/login'"
class="like_unlike rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-medium text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 "
class="like_unlike rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-bold text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 "
type="button">
<span id="likes" class="flex items-end">
{{ likes }} &nbsp;
Expand All @@ -62,15 +66,14 @@
{% comment %} dislike {% endcomment %}
{% if request.user.is_authenticated %}
<button name="{{ object.pk }}"
data-tooltip-target="tooltip-bottom-{{ device }}-dislike"
data-tooltip-target="tooltip-bottom-{{ object.pk }}-dislike"
data-tooltip-placement="bottom"
type="submit"
id="dislike-btn"
class="dislike rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-medium text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4"
class="dislike rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-bold text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4"
type="button">
<span id="dislikes" class="flex flex-row gap-2 items-center">
{{ dislikes }}
<span>Dislikes</span>
<span id="dislikes" class="flex items-end">
{{ dislikes }} &nbsp;
{% if dislikes %}
{% include "./_tooltip3.html" with text="Undo Dislike" sno=object.pk widget="dislike" %}
<svg xmlns="http://www.w3.org/2000/svg"
Expand All @@ -93,10 +96,10 @@
</span>
</button>
{% else %}
<button data-tooltip-target="tooltip-bottom-{{ device }}-dislike"
<button data-tooltip-target="tooltip-bottom-{{ object.pk }}-dislike"
data-tooltip-placement="bottom"
onclick="window.location.href='/accounts/login'"
class="dislike rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-medium text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 ">
class="dislike rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-bold text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 ">
<span id="dislikes" class="flex items-end">
{{ dislikes }} &nbsp;
{% include "./_tooltip3.html" with text="Login to Dislike" sno=object.pk widget="dislike" %}
Expand All @@ -113,14 +116,13 @@
{% comment %} report {% endcomment %}
{% if request.user.is_authenticated %}
<button name="{{ object.pk }}"
data-tooltip-target="tooltip-bottom-{{ device }}-flags"
data-tooltip-target="tooltip-bottom-{{ object.pk }}-flags"
data-tooltip-placement="bottom"
id="flag-unflag"
class="flag-unflag rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-medium text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 "
class="flag-unflag rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-bold text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 "
type="button">
<span id="flags" class="flex flex-row gap-2 items-center">
{{ flags }}
<span>Flag</span>
<span id="flags" class="flex items-end">
{{ flags }} &nbsp;
{% if isFlagged %}
{% include "./_tooltip3.html" with text="Undo Report" sno=object.pk widget="flags" %}
<svg xmlns="http://www.w3.org/2000/svg"
Expand All @@ -143,10 +145,10 @@
</span>
</button>
{% else %}
<button data-tooltip-target="tooltip-bottom-{{ device }}-flags"
<button data-tooltip-target="tooltip-bottom-{{ object.pk }}-flags"
data-tooltip-placement="bottom"
onclick="window.location.href='/accounts/login'"
class="like_unlike rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-medium text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 "
class="like_unlike rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-bold text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 "
type="button">
<span id="flags" class="flex items-end">
{{ flags }} &nbsp;
Expand All @@ -164,14 +166,13 @@
{% comment %} bookmark {% endcomment %}
{% if request.user.is_authenticated %}
<button name="{{ object.pk }}"
data-tooltip-target="tooltip-bottom-{{ device }}-bookmark"
data-tooltip-target="tooltip-bottom-{{ object.pk }}-bookmark"
data-tooltip-placement="bottom"
class="bookmark rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-medium text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 "
class="bookmark rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-bold text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 "
type="button">
<span id="bookmark" class="flex flex-row gap-2 items-center">
<span id="bookmark" class="flex items-end">
{% if bookmarked %}
{% include "./_tooltip3.html" with text="Undo Bookmark" sno=object.pk widget="bookmark" %}
<span>Bookmark</span>
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 448 512"
height="16px"
Expand All @@ -181,7 +182,6 @@
</svg>
{% else %}
{% include "./_tooltip3.html" with text="Bookmark" sno=object.pk widget="bookmark" %}
<span>Bookmark</span>
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 384 512"
height="16px"
Expand All @@ -193,10 +193,10 @@
</span>
</button>
{% else %}
<button data-tooltip-target="tooltip-bottom-{{ device }}-bookmark"
<button data-tooltip-target="tooltip-bottom-{{ object.pk }}-bookmark"
data-tooltip-placement="bottom"
onclick="window.location.href='/accounts/login'"
class="like_unlike rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-medium text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 "
class="like_unlike rounded-2xl border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-bold text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4 "
type="button">
<span id="bookmark" class="flex items-end">
{{ bookmark }} &nbsp;
Expand All @@ -212,42 +212,24 @@
</button>
{% endif %}
{% comment %} notification {% endcomment %}
<button data-tooltip-target="tooltip-bottom-{{ device }}-notification"
<button data-tooltip-target="tooltip-bottom-{{ object.pk }}-notification"
data-tooltip-placement="bottom"
class="relative inline-block shadow-sm rounded-xl transform-[0] font-medium text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4"
class="relative inline-block shadow-sm rounded-xl transform-[0] font-bold text-[#3e3446] bg-white border-black-2 text-[#0.875rem] leading-4 p-4"
onclick="{% if user.is_authenticated %}subscribe_domain(){% else %}window.location.href=`{% url 'account_login' %}`{% endif %}"
id="subscribe_domain_btn">
{% if user.is_authenticated and subscribed_to_domain %}
{% include "./_tooltip3.html" with text="Unsubscribe" sno=object.pk widget="notification" %}
<div class="flex flex-row gap-2 items-center">
<span>Unsubscribe</span>
<svg viewBox="0 0 16 16" fill="currentColor" height="16px" width="16px">
<path d="M10.533 14.07h3.466a.76.76 0 0 0 .58-.28.74.74 0 0 0 .19-.57l-.57-6.55a.13.13 0 0 0 0-.06A6.42 6.42 0 0 0 8 0a6.42 6.42 0 0 0-6.18 6.65v.06l-.57 6.55a.74.74 0 0 0 .19.57.76.76 0 0 0 .56.24h3.468A2.64 2.64 0 0 0 8 16a2.64 2.64 0 0 0 2.533-1.93Zm-1.654 0H7.121a1.13 1.13 0 0 0 1.758 0Zm4.32-1.5H2.8l.5-5.79v-.13A4.92 4.92 0 0 1 8 1.54a4.92 4.92 0 0 1 4.7 5.11v.19l.5 5.73Z">
</path>
<path d="M.801 16.5a.798.798 0 0 1-.563-.234.786.786 0 0 1 0-1.127L14.635.733a.798.798 0 0 1 1.127 0 .787.787 0 0 1 0 1.127L1.365 16.266A.84.84 0 0 1 .8 16.5Z">
</path>
</svg>
</div>
<svg viewBox="0 0 16 16" fill="currentColor" height="16px" width="16px">
<path d="M10.533 14.07h3.466a.76.76 0 0 0 .58-.28.74.74 0 0 0 .19-.57l-.57-6.55a.13.13 0 0 0 0-.06A6.42 6.42 0 0 0 8 0a6.42 6.42 0 0 0-6.18 6.65v.06l-.57 6.55a.74.74 0 0 0 .19.57.76.76 0 0 0 .56.24h3.468A2.64 2.64 0 0 0 8 16a2.64 2.64 0 0 0 2.533-1.93Zm-1.654 0H7.121a1.13 1.13 0 0 0 1.758 0Zm4.32-1.5H2.8l.5-5.79v-.13A4.92 4.92 0 0 1 8 1.54a4.92 4.92 0 0 1 4.7 5.11v.19l.5 5.73Z">
</path>
</svg>
{% else %}
{% include "./_tooltip3.html" with text="Subscribe" sno=object.pk widget="notification" %}
<div class="flex flex-row gap-2 items-center">
<span>Sububscribe</span>
<svg viewBox="0 0 16 16" fill="currentColor" height="16px" width="16px">
<path d="M10.533 14.07h3.466a.76.76 0 0 0 .58-.28.74.74 0 0 0 .19-.57l-.57-6.55a.13.13 0 0 0 0-.06A6.42 6.42 0 0 0 8 0a6.42 6.42 0 0 0-6.18 6.65v.06l-.57 6.55a.74.74 0 0 0 .19.57.76.76 0 0 0 .56.24h3.468A2.64 2.64 0 0 0 8 16a2.64 2.64 0 0 0 2.533-1.93Zm-1.654 0H7.121a1.13 1.13 0 0 0 1.758 0Zm4.32-1.5H2.8l.5-5.79v-.13A4.92 4.92 0 0 1 8 1.54a4.92 4.92 0 0 1 4.7 5.11v.19l.5 5.73Z">
</path>
</svg>
</div>
<svg viewBox="0 0 16 16" fill="currentColor" height="16px" width="16px">
<path d="M10.533 14.07h3.466a.76.76 0 0 0 .58-.28.74.74 0 0 0 .19-.57l-.57-6.55a.13.13 0 0 0 0-.06A6.42 6.42 0 0 0 8 0a6.42 6.42 0 0 0-6.18 6.65v.06l-.57 6.55a.74.74 0 0 0 .19.57.76.76 0 0 0 .56.24h3.468A2.64 2.64 0 0 0 8 16a2.64 2.64 0 0 0 2.533-1.93Zm-1.654 0H7.121a1.13 1.13 0 0 0 1.758 0Zm4.32-1.5H2.8l.5-5.79v-.13A4.92 4.92 0 0 1 8 1.54a4.92 4.92 0 0 1 4.7 5.11v.19l.5 5.73Z">
</path>
<path d="M.801 16.5a.798.798 0 0 1-.563-.234.786.786 0 0 1 0-1.127L14.635.733a.798.798 0 0 1 1.127 0 .787.787 0 0 1 0 1.127L1.365 16.266A.84.84 0 0 1 .8 16.5Z">
</path>
</svg>
{% endif %}
</button>
{% comment %} resolve {% endcomment %}
{% if request.user.is_superuser or request.user == object.user %}
<button type="button"
onclick="resolveIssue()"
class="rounded-2xl h-auto border-[1px] shadow-sm mb-3 cursor-pointer relative transform-[0] font-medium text-white bg-gradient-to-r from-purple-500 via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:outline-none border-black-2 text-[#0.875rem] leading-4 p-4 ">
{% if status == "open" %}
Resolve
{% else %}
Open Issue
{% endif %}
</button>
{% endif %}
4 changes: 2 additions & 2 deletions website/templates/includes/_tooltip3.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="tooltip-bottom-{{ device }}-{{ widget }}"
<div id="tooltip-bottom-{{ sno }}-{{ widget }}"
role="tooltip"
class="absolute z-10 inline-block px-3 py-2 font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700">
class="absolute z-10 invisible inline-block px-3 py-2 font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700">
{{ text }}
<div class="tooltip-arrow" data-popper-arrow></div>
</div>
Loading
Loading