Thanks to visit codestin.com
Credit goes to github.com

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
7 changes: 3 additions & 4 deletions scripts/get_daily_commits_for_user.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import requests
import csv
from datetime import datetime, timedelta

import requests

# Configuration
username = "USERNAME" # GitHub username of the user
repo = "REPOSITORY" # Repository name
Expand Down Expand Up @@ -47,9 +48,7 @@ def fetch_commit_counts(username, repo, owner, headers, start_date, end_date):


# Fetch commit counts
commit_counts = fetch_commit_counts(
username, repo, owner, headers, start_date, end_date
)
commit_counts = fetch_commit_counts(username, repo, owner, headers, start_date, end_date)

# Write commit counts to CSV
with open(csv_filename, "w", newline="") as csvfile:
Expand Down
4 changes: 2 additions & 2 deletions website/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
type="text/css">
<link href="{% static 'css/navbar.css' %}" rel="stylesheet" type="text/css">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css"
integrity="sha512-1sCRPdkRXhBV2PBLUdRb4tMg1w2YPf37qatUFeS7zlBy7jJI8Lf4VHwWfZZfpXtYSLy85pkm9GaYVYMfw5BC1A=="
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"
integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA=="
crossorigin="anonymous"
referrerpolicy="no-referrer" />
<script src="https://code.jquery.com/jquery-3.7.1.min.js"
Expand Down
20 changes: 2 additions & 18 deletions website/templates/includes/_dislikes3.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<div id="dislike-container">
<button name="{{ object.pk }}"
type="submit"
id="dislike-btn"
class="dislike md:w-1/2 lg:w-auto rounded-2xl shadow-md p-5 bg-[#8faa8757] mb-3 cursor-pointer">
{{ dislikes }}&nbsp;
<span id="dislikes">{{ dislikes }}</span>&nbsp;
{% if isDisliked %}
<i class="fa-solid fa-thumbs-down text-3xl text-black"></i>
{% else %}
Expand All @@ -17,20 +18,3 @@
{{ 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>
74 changes: 72 additions & 2 deletions website/templates/includes/_like_dislike_share.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load gravatar %}
{% load custom_tags %}
<aside class="absolute flex-wrap right-9 max-sm:right-0 top-40 flex items-center lg:flex-col max-sm:top-80 max-sm:flex max-sm:w-full max-sm:mr--10 max-sm:items-center max-sm:justify-evenly">
<div class="flex flex-col max-sm:w-11/12 max-sm:flex-row max-sm:items-center max-sm:justify-evenly">
<span><i class="fa fa-eye mr-5 mb-3"></i><span class="font-bold">{{ object.views }}</span></span>
Expand All @@ -9,10 +10,16 @@
<div class="max-sm:w-11/12 flex max-sm:flex-row flex-col items-center max-sm:justify-evenly">
{% include "./_bookmark3.html" %}
<div class="md:w-1/2 lg:w-auto rounded-2xl shadow-md p-5 bg-[#0786fb4d] mb-3 cursor-pointer">
<i class="fa-solid fa-share-from-square text-3xl text-red-[#174BD2]"></i>
<a href="https://twitter.com/intent/tweet?text=Bug Found on @{{ object.domain_title }} - {{ object.description }} Report: https://{% env 'FQDN' %}/issue/{{ object.id }}"
target="_blank"
rel="noopener noreferrer">
<i class="fa-brands fa-x-twitter fa-lg"></i>
</a>
</div>
<div class="md:w-1/2 lg:w-auto rounded-2xl shadow-md p-5 bg-[#1c20734d] mb-3 cursor-pointer">
<i class="fa-solid fa-copy text-3xl text-red-[#4A6676]"></i>
<button onclick="copyClipboard()">
<i class="fa-solid fa-copy text-3xl text-red-[#4A6676]"></i>
</button>
</div>
<div class="md:w-1/2 lg:w-auto rounded-2xl shadow-md p-5 bg-[#2d9cdb4d] mb-3 cursor-pointer">
<i class="fa-brands fa-github text-3xl text-black"></i>
Expand All @@ -22,3 +29,66 @@
</div>
</div>
</aside>
<script>
function copyClipboard() {
var textToCopy = "Bug Found on @{{ object.domain_title }} - {{ object.description }} Report: https://{% env 'FQDN' %}/issue/{{ object.id }}";

navigator.clipboard.writeText(textToCopy);

$.notify("Bug details copied to clipboard!", {
style: "custom",
className: "success"
});
}

function like_unlike_handler(e) {
e.preventDefault();
var issue_pk = $(this).attr('name');
$.ajax({
type: 'GET',
url: '/like_issue3/' + issue_pk + '/',
data: {},
success: function (data) {
$('.like_unlike').remove();
$('#like-container').append(data);
if ($("#dislike-btn i").hasClass("fa-solid")) {
var dislikes = $("#dislikes").text();
dislikes = dislikes-1;
$('#dislike-btn').html(
dislikes+`&nbsp;
<i class="fa-regular fa-thumbs-down text-3xl text-black"></i>`
);
}
},
});
// Later, when you want to "destroy" the event handler:
$('body').off('click', '.like_unlike', like_unlike_handler);
}

// Attach the click event handler
$('body').on('click', '.like_unlike', like_unlike_handler);

function dislike_handler(e){
e.preventDefault();
var issue_pk = document.getElementById("dislike-btn").getAttribute("name");
$.ajax({
type: 'GET',
url: '/dislike_issue3/' + issue_pk + '/',
data: {},
success: function (data) {
$('.dislike').remove();
$("#dislike-container").append(data);
if ($("#like_unlike i").hasClass("fa-solid")) {
var likes = $("#likes").text();
likes = likes-1;
$('#like_unlike').html(
likes+`&nbsp;
<i class="fa-regular fa-thumbs-up text-3xl text-black"></i>`
);
}
},
});
$('body').off('click', '.dislike', dislike_handler);
}
$('body').on('click', '.dislike', dislike_handler);
</script>
23 changes: 2 additions & 21 deletions website/templates/includes/_likes3.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<div id="like-container">
<button name="{{ object.pk }}"
type="submit"
id="like_unlike"
class="like_unlike rounded-2xl shadow-md p-5 bg-[#ff00004d] mb-3 cursor-pointer">
{{ likes }}&nbsp;
<span id="likes">{{ likes }}</span>&nbsp;
{% if isLiked %}
<i class="fa-solid fa-thumbs-up text-3xl text-red-700"></i>
{% else %}
Expand All @@ -18,23 +19,3 @@
{{ likes }}&nbsp;<i class="fa-regular fa-thumbs-up text-3xl text-red-700"></i>
</button>
{% endif %}
<script>
function like_unlike_handler(e) {
e.preventDefault();
var issue_pk = $(this).attr('name');
$.ajax({
type: 'GET',
url: '/like_issue3/' + issue_pk + '/',
data: {},
success: function (data) {
$('.like_unlike').remove();
$('#like-container').append(data);
},
});
// Later, when you want to "destroy" the event handler:
$('body').off('click', '.like_unlike', like_unlike_handler);
}

// Attach the click event handler
$('body').on('click', '.like_unlike', like_unlike_handler);
</script>
13 changes: 8 additions & 5 deletions website/templates/issue3.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@
content="{% block og_title %}{{ object.description }}{% endblock og_title %}" />
{% for screenshot in screenshots %}
<meta property="og:image"
content="https://blt.owasp.org{% block og_image %}{{ screenshot.image.url }}{% endblock og_image %}" />
content="https://{% env 'FQDN' %}{% block og_image %}{{ screenshot.image.url }}{% endblock og_image %}" />
{% endfor %}
<meta property="og:description"
content="{{ object.markdown_description|escapejs }}" />
<meta name="keywords"
content="{% block keywords %}BLT, bug, tracking, company, easy{% endblock keywords %}">
{% comment %} TODO: change to update DOMAIN {% endcomment %}
<link rel="canonical" href="https://blt.owasp.org/issue3/{{ object.id }}">
<link rel="canonical"
href="https://{% env 'FQDN' %}/issue3/{{ object.id }}">
<meta property="og:url"
content="https://blt.owasp.org/issue3/{{ object.id }}" />
content="https://{% env 'FQDN' %}/issue3/{{ object.id }}" />
<meta property="og:type" content="website" />
<meta name="robots" content="index, follow">
{% endblock metaTags %}
Expand Down Expand Up @@ -74,8 +75,10 @@ <h2 class="font-[ubuntu] font-bold text-3xl">{{ object.description | truncatecha
</div>
</div>
<br>
<h3 class="font-[ubuntu] font-bold text-2xl">Issue Description</h3>
<p class="text-justify max-sm:w-[95vw] lg:w-11/12">{{ object.markdown_description|escapejs }}</p>
{% if object.markdown_description %}
<h3 class="font-[ubuntu] font-bold text-2xl">Issue Description</h3>
<p class="text-justify max-sm:w-[95vw] lg:w-11/12" id="bug_report"></p>
{% endif %}
</div>
<script src="{% static '/company/js/md_editor.js' %}"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> -->
Expand Down