Skip to content

Commit

Permalink
Enhancement: Bug Details Page - Task 2 (#1982)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeWithBishal authored Mar 12, 2024
1 parent d0efe7a commit f77f227
Show file tree
Hide file tree
Showing 12 changed files with 712 additions and 38 deletions.
1 change: 1 addition & 0 deletions blt/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""

# from google.oauth2 import service_account
import os
import socket
Expand Down
12 changes: 11 additions & 1 deletion blt/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
UserIssueViewSet,
UserProfileViewSet,
)
from website.views import (
from website.views import ( # TODO IssueView,; TODO: REMOVE like_issue2 etc
AllIssuesView,
CompanySettings,
ContributorStatsView,
Expand All @@ -55,6 +55,7 @@
IssueCreate,
IssueView,
IssueView2,
IssueView3,
JoinCompany,
ListHunts,
OngoingHunts,
Expand All @@ -70,11 +71,14 @@
UserProfileDetailView,
contributors_view,
dislike_issue2,
dislike_issue3,
facebook_callback,
flag_issue2,
flag_issue3,
github_callback,
google_callback,
like_issue2,
like_issue3,
subscribe_to_domains,
vote_count,
)
Expand Down Expand Up @@ -264,6 +268,7 @@
name="user_profile",
),
path(settings.ADMIN_URL + "/", admin.site.urls),
# TODO: REMOVE after _3 is ready
re_path(r"^like_issue/(?P<issue_pk>\d+)/$", website.views.like_issue, name="like_issue"),
re_path(
r"^dislike_issue/(?P<issue_pk>\d+)/$",
Expand All @@ -274,6 +279,9 @@
re_path(r"^like_issue2/(?P<issue_pk>\d+)/$", like_issue2, name="like_issue2"),
re_path(r"^dislike_issue2/(?P<issue_pk>\d+)/$", dislike_issue2, name="dislike_issue2"),
re_path(r"^flag_issue2/(?P<issue_pk>\d+)/$", flag_issue2, name="flag_issue2"),
re_path(r"^like_issue3/(?P<issue_pk>\d+)/$", like_issue3, name="like_issue3"),
re_path(r"^dislike_issue3/(?P<issue_pk>\d+)/$", dislike_issue3, name="dislike_issue3"),
re_path(r"^flag_issue3/(?P<issue_pk>\d+)/$", flag_issue3, name="flag_issue3"),
re_path(r"^vote_count/(?P<issue_pk>\d+)/$", vote_count, name="vote_count"),
path("domain/<int:pk>/subscribe/", subscribe_to_domains, name="subscribe_to_domains"),
re_path(r"^save_issue/(?P<issue_pk>\d+)/$", website.views.save_issue, name="save_issue"),
Expand Down Expand Up @@ -301,8 +309,10 @@
),
# delete_comment
path("issue2/comment/delete/", website.views.delete_comment, name="delete_comment"),
# TODO: REMOVE after _3 is ready
re_path(r"^issue/(?P<slug>\w+)/$", IssueView.as_view(), name="issue_view"),
re_path(r"^issue2/(?P<slug>\w+)/$", IssueView2.as_view(), name="issue_view2"),
re_path(r"^issue3/(?P<slug>\w+)/$", IssueView3.as_view(), name="issue_view3"),
re_path(r"^follow/(?P<user>[^/]+)/", website.views.follow_user, name="follow_user"),
re_path(r"^all_activity/$", AllIssuesView.as_view(), name="all_activity"),
re_path(r"^label_activity/$", SpecificIssuesView.as_view(), name="all_activitys"),
Expand Down
43 changes: 28 additions & 15 deletions contributors.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@
},
{
"id":5,
"img":"https://avatars.githubusercontent.com/u/69814108?v=4",
"name":"Bishal Das",
"repository":"BLT Core",
"short_description":"Full Stack Developer",
"long_description":"",
"location":"Indore, India",
"twitter":"",
"linkedin":"https://www.linkedin.com/in/bishal-das-bd/",
"website":"https://github.com/CodeWithBishal/",
"bch_addr":""
},
{
"id":6,
"img":"https://avatars.githubusercontent.com/u/47253186?v=4",
"name":"Pulkit Agrawal",
"repository":"BLT Core",
Expand All @@ -66,7 +79,7 @@
"bch_addr":""
},
{
"id":6,
"id":7,
"img":"https://avatars.githubusercontent.com/u/65587505?v=4",
"name":"Amrit Prakash",
"repository":"BLT Flutter",
Expand All @@ -79,7 +92,7 @@
"bch_addr":""
},
{
"id":7,
"id":8,
"img":"https://avatars.githubusercontent.com/u/16963976?v=4",
"name":"Mohit Anand",
"repository":"",
Expand All @@ -92,7 +105,7 @@
"bch_addr":""
},
{
"id":8,
"id":9,
"img":"https://avatars.githubusercontent.com/u/11073943?v=4",
"name":"Sourav Badami",
"repository":"",
Expand All @@ -105,7 +118,7 @@
"bch_addr":""
},
{
"id":9,
"id":10,
"img":"https://avatars.githubusercontent.com/u/22706287?v=4",
"name":"S Rahul Badami",
"repository":"",
Expand All @@ -118,7 +131,7 @@
"bch_addr":""
},
{
"id":10,
"id":11,
"img":"https://avatars.githubusercontent.com/u/17125030?v=4",
"name":"Siddharth Goyal",
"repository":"",
Expand All @@ -131,7 +144,7 @@
"bch_addr":""
},
{
"id":11,
"id":12,
"img":"https://avatars.githubusercontent.com/u/20015262?v=4",
"name":"Neethu Mariya Joy",
"repository":"",
Expand All @@ -144,7 +157,7 @@
"bch_addr":""
},
{
"id":12,
"id":13,
"img":"https://avatars.githubusercontent.com/u/128622481?v=4",
"name":"DonnieBLT",
"repository":"",
Expand All @@ -157,7 +170,7 @@
"bch_addr":""
},
{
"id":13,
"id":14,
"img":"https://avatars.githubusercontent.com/u/44541855?v=4",
"name":"Ankit Choudhary",
"repository":"",
Expand All @@ -170,7 +183,7 @@
"bch_addr":""
},
{
"id":14,
"id":15,
"img":"https://avatars.githubusercontent.com/u/103092293?v=4",
"name":"Cody Ross",
"repository":"",
Expand All @@ -183,7 +196,7 @@
"bch_addr":""
},
{
"id":15,
"id":16,
"img":"https://avatars.githubusercontent.com/u/53966291?v=4",
"name":"Mrigank Anand",
"repository":"",
Expand All @@ -196,7 +209,7 @@
"bch_addr":""
},
{
"id":16,
"id":17,
"img":"https://avatars.githubusercontent.com/u/55937724?v=4",
"name":"Sparsh Agrawal",
"repository":"",
Expand All @@ -209,7 +222,7 @@
"bch_addr":""
},
{
"id":17,
"id":18,
"img":"https://avatars.githubusercontent.com/u/99071926?v=4",
"name":"Kej-r03",
"repository":"",
Expand All @@ -222,7 +235,7 @@
"bch_addr":""
},
{
"id":18,
"id":19,
"img":"https://avatars.githubusercontent.com/u/81790585?v=4",
"name":"Bhawna",
"repository":"",
Expand All @@ -235,7 +248,7 @@
"bch_addr":""
},
{
"id":19,
"id":20,
"img":"https://avatars.githubusercontent.com/u/17159160?v=4",
"name":"Rohit Lodha",
"repository":"",
Expand All @@ -248,7 +261,7 @@
"bch_addr":""
},
{
"id":20,
"id":21,
"img":"https://avatars.githubusercontent.com/u/89926834?v=4",
"name":"Manish Bisht",
"repository":"",
Expand Down
10 changes: 5 additions & 5 deletions scripts/git_username_replacer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
Git Username Replacer:
Safeguard user privacy and enhance security by easily replacing usernames in Git commit history.
Protect sensitive information with our tool.
Use: python git_username_replacer.py <repo path> <old_author_username> <new_author_username>
Git Username Replacer:
Safeguard user privacy and enhance security by easily replacing usernames in Git commit history.
Protect sensitive information with our tool.
Use: python git_username_replacer.py <repo path> <old_author_username> <new_author_username>
"""

import argparse
Expand Down
40 changes: 23 additions & 17 deletions website/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>
{% block title %}
{% env 'PROJECT_NAME' %}
{% endblock title %}
</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description"
content="{% block description %}{% env 'PROJECT_NAME' %} allows anyone to submit an issue from any website. For example if you saw a broken button on Amazon.com you can report the issue on {% env 'PROJECT_NAME' %} and then get a point! The more bugs you find the more points you get. Bugs can be verified for extra points and companies can get involved and help out.{% endblock description %}">
<meta name="keywords"
content="{% block keywords %}{% env 'PROJECT_NAME' %}, bug, tracking, company, easy{% endblock keywords %}">
<meta name="author" content="">
{% block metaTags %}
<title>
{% block title %}
{% env 'PROJECT_NAME' %}
{% endblock title %}
</title>
<meta name="description"
content="{% block description %}{% env 'PROJECT_NAME' %} allows anyone to submit an issue from any website. For example if you saw a broken button on Amazon.com you can report the issue on {% env 'PROJECT_NAME' %} and then get a point! The more bugs you find the more points you get. Bugs can be verified for extra points and companies can get involved and help out.{% endblock description %}">
<meta name="keywords"
content="{% block keywords %}{% env 'PROJECT_NAME' %}, bug, tracking, company, easy{% endblock keywords %}">
<meta name="author" content="">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;700&display=swap"
rel="stylesheet">
<meta property="og:title"
content="{% block og_title %}{% env 'PROJECT_NAME' %}{% endblock og_title %}" />
<meta property="og:image"
content="{% block og_image %}{% static 'img/screenshot.png' %}{% endblock og_image %}" />
<meta property="og:description"
content="{% block og_description %}{% env 'PROJECT_NAME' %} allows anyone to submit an issue from any website. For example if you saw a broken button on Amazon.com you can report the issue on {% env 'PROJECT_NAME' %} and then get a point! The more bugs you find the more points you get. Bugs can be verified for extra points and companies can get involved and help out.{% endblock og_description %}" />
<meta property="og:type" content="website" />
{% endblock metaTags %}
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;700&display=swap"
rel="stylesheet">
<meta property="og:title"
content="{% block og_title %}{% env 'PROJECT_NAME' %}{% endblock og_title %}" />
<meta property="og:image"
content="{% block og_image %}{% static 'img/screenshot.png' %}{% endblock og_image %}" />
<meta property="og:description"
content="{% block og_description %}{% env 'PROJECT_NAME' %} allows anyone to submit an issue from any website. For example if you saw a broken button on Amazon.com you can report the issue on {% env 'PROJECT_NAME' %} and then get a point! The more bugs you find the more points you get. Bugs can be verified for extra points and companies can get involved and help out.{% endblock og_description %}" />
<meta property="og:type" content="website" />
<link href="{% static 'vendor/bootstrap/css/bootstrap.css' %}"
rel="stylesheet">
<link href="{% static 'css/style.css' %}" rel="stylesheet">
Expand Down Expand Up @@ -84,6 +89,7 @@
}
</style>
{% include "includes/header.html" %}
{% comment %} <div class="lg:ml-[215px] mt-[90px]"></div> {% endcomment %}
<div class="lg:ml-[230px] mt-[70px]">
{% block content %}
{% endblock content %}
Expand Down
54 changes: 54 additions & 0 deletions website/templates/includes/_bookmark3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{% if request.user.is_authenticated %}
<button type="submit"
name="{{ object.pk }}"
class="bookmark md:w-1/2 lg:w-auto rounded-2xl shadow-md p-5 bg-[#842adb4d] mb-3 cursor-pointer">
{% if bookmarked %}
<i class="fa-solid fa-bookmark text-3xl text-black"></i>
{% else %}
<i class="fa-regular fa-bookmark text-3xl text-black"></i>
{% endif %}
</button>
{% else %}
<button disabled
class="md:w-1/2 lg:w-auto rounded-2xl shadow-md p-5 bg-[#842adb4d] mb-3 cursor-pointer">
<i class="fa-regular fa-bookmark text-3xl text-black"></i>
</button>
{% endif %}
<script>
function bookmark_handler(e){
e.preventDefault();
var issue_pk = $(this).attr('name');
$.ajax({
type: 'GET',
url: '/save_issue/' + issue_pk + '/',
data: {},
success: function (data) {
if (data === "REMOVED"){
$('.bookmark i').removeClass('fa-solid');
$('.bookmark i').addClass('fa-regular');
$.notify("Bookmark Removed!", {
style: "custom",
className: "success"
});
}
else{
$('.bookmark i').removeClass('fa-regular');
$('.bookmark i').addClass('fa-solid');
$.notify("Bookmark Added!", {
style: "custom",
className: "success"
});
}
},
error: function (e) {
$.notify("Some error occurred!", {
style: "custom",
className: "danger"
});
}
});
}

// Attach the click event handler
$('body').on('click', '.bookmark', bookmark_handler);
</script>
36 changes: 36 additions & 0 deletions website/templates/includes/_dislikes3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{% if request.user.is_authenticated %}
<div id="dislike-container">
<button name="{{ object.pk }}"
type="submit"
class="dislike md:w-1/2 lg:w-auto rounded-2xl shadow-md p-5 bg-[#8faa8757] mb-3 cursor-pointer">
{{ dislikes }}&nbsp;
{% if isDisliked %}
<i class="fa-solid fa-thumbs-down text-3xl text-black"></i>
{% else %}
<i class="fa-regular fa-thumbs-down text-3xl text-black"></i>
{% endif %}
</button>
</div>
{% else %}
<button disabled
class="md:w-1/2 lg:w-auto rounded-2xl shadow-md p-5 bg-[#8faa8757] mb-3 cursor-pointer">
{{ dislikes }}&nbsp;<i class="fa-regular fa-thumbs-down text-3xl text-black"></i>
</button>
{% endif %}
<script>
function dislike_handler(e){
e.preventDefault();
var issue_pk = $(this).attr('name');
$.ajax({
type: 'GET',
url: '/dislike_issue3/' + issue_pk + '/',
data: {},
success: function (data) {
$('.dislike').remove();
$("#dislike-container").append(data);
},
});
$('body').off('click', '.dislike', dislike_handler);
}
$('body').on('click', '.dislike', dislike_handler);
</script>
Loading

0 comments on commit f77f227

Please sign in to comment.