Skip to content
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
45 changes: 16 additions & 29 deletions website/templates/_bug.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,21 @@
</script>
{% endif %}
{% endwith %}
<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>
<button {% if not user.is_authenticated %} disabled {% endif %} onclick="flag_unflag_handler(event,{{bug.id}})">
<svg id="flagSvg{{bug.id}}" 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>
</button>
{% with user_issue_flagged_list=bug.user.userprofile.issue_flagged.all %}
{% if user_issue_flagged_list and bug in user_issue_flagged_list %}
<script>
$(document).ready(function () {
$('#flagSvg{{bug.id}}').find('path').attr('fill', '#a11010');
});
</script>
{% endif %}
{% endwith %}
<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"/>
Expand All @@ -71,28 +82,4 @@
</svg>
</a>
</div>
</div>
<script>
function like_unlike_handler(e,issue_pk){
e.preventDefault();
var issue_pk = issue_pk;
$.ajax({
type: 'GET',
url: '/like_issue2/' + issue_pk + '/',
data: {},
success: function (data) {
// Toggle the color of the SVG
var svg = $('#likeSvg' + issue_pk);
var currentColor = svg.find('path').attr('fill');

if (currentColor === '#a11010') {
// Change to default color
svg.find('path').attr('fill', ''); // Set to default color
} else {
// Change to full red
svg.find('path').attr('fill', '#a11010');
}
},
});
}
</script>
</div>
47 changes: 47 additions & 0 deletions website/templates/new_home.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,53 @@
{% include '_bug.html' %}
{% endfor %}
</div>

<script>
function like_unlike_handler(e,issue_pk){
e.preventDefault();
var issue_pk = issue_pk;
$.ajax({
type: 'GET',
url: '/like_issue2/' + issue_pk + '/',
data: {},
success: function (data) {
// Toggle the color of the SVG
var svg = $('#likeSvg' + issue_pk);
var currentColor = svg.find('path').attr('fill');

if (currentColor === '#a11010') {
// Change to default color
svg.find('path').attr('fill', ''); // Set to default color
} else {
// Change to full red
svg.find('path').attr('fill', '#a11010');
}
},
});
}
function flag_unflag_handler(e,issue_pk){
e.preventDefault();
var issue_pk = issue_pk;
$.ajax({
type: 'GET',
url: '/flag_issue2/' + issue_pk + '/',
data: {},
success: function (data) {
// Toggle the color of the SVG
var svg = $('#flagSvg' + issue_pk);
var currentColor = svg.find('path').attr('fill');

if (currentColor === '#a11010') {
// Change to default color
svg.find('path').attr('fill', ''); // Set to default color
} else {
// Change to full red
svg.find('path').attr('fill', '#a11010');
}
},
});
}
</script>
<div class="col-md-12">
<div class="text-center">
{% if bugs.has_previous %}
Expand Down