From 0e434b60d49363275216007c9684f4e3521a56e3 Mon Sep 17 00:00:00 2001 From: AtmegaBuzz Date: Thu, 23 Mar 2023 16:22:01 +0530 Subject: [PATCH 1/2] created contributors detail page --- contributors.json | 8 +++- website/templates/contributors.html | 1 + website/templates/contributors_detail.html | 56 ++++++++++++++++++++++ website/views.py | 19 +++++++- 4 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 website/templates/contributors_detail.html diff --git a/contributors.json b/contributors.json index 05c4999df5..8ee0eae47f 100644 --- a/contributors.json +++ b/contributors.json @@ -1,5 +1,6 @@ [ { + "id":1, "img":"https://avatars.githubusercontent.com/u/7475382?v=4", "name":"Fredfalcon", "repository":"BLT", @@ -12,6 +13,7 @@ "bch_addr":"" }, { + "id":2, "img":"https://avatars.githubusercontent.com/u/76696648?v=4", "name":"Aryan Ranjan", "repository":"BLT Flutter", @@ -25,6 +27,7 @@ }, { + "id":3, "img":"https://avatars.githubusercontent.com/u/18749480?v=4", "name":"Raghav Jajodia", "repository":"BLT Core", @@ -37,11 +40,12 @@ "bch_addr":"" }, { + "id":4, "img":"https://avatars.githubusercontent.com/u/68425016?v=4", "name":"Swapnil Shinde", "repository":"BLT Core | BLT Bacon", "short_description":"reincarnating", - "long_description":"", + "long_description":"Hey, Im a Python developer and have experience in backend and Api development with django , Automation and testing with selenium. love to talk about cyber security and IOT. Opensource Contributor OWASP.", "location":"Maharashtra, India", "twitter":"https://twitter.com/a_kraken_head", "linkedin":"https://www.linkedin.com/in/swapnil-shinde-5ba45118b/", @@ -49,6 +53,7 @@ "bch_addr":"qq62zrxxeyqlvhunl2zeq7xqf2xu3pv39q6wyz7ckk" }, { + "id":5, "img":"https://avatars.githubusercontent.com/u/37345795?v=4", "name":"Harshit Seksaria", "repository":"BLT Flutter", @@ -61,6 +66,7 @@ "bch_addr":"" }, { + "id":6, "img":"https://avatars.githubusercontent.com/u/65587505?v=4", "name":"Amrit Prakash", "repository":"BLT Flutter", diff --git a/website/templates/contributors.html b/website/templates/contributors.html index 786f20f936..941be3d6a0 100644 --- a/website/templates/contributors.html +++ b/website/templates/contributors.html @@ -65,6 +65,7 @@ > + More Info {% endfor %} diff --git a/website/templates/contributors_detail.html b/website/templates/contributors_detail.html new file mode 100644 index 0000000000..1cca6bab47 --- /dev/null +++ b/website/templates/contributors_detail.html @@ -0,0 +1,56 @@ +{% extends "base.html" %} + +{% block natural_content %} + + + + + +
+
+
+ + ecommerce + +
+

{{contributor.name}}

+

{{contributor.repository}}

+
+

{{contributor.location}}

+ {% if contributor.long_description == "" %} +

{{contributor.short_description}}

+ {% else %} +

{{contributor.long_description}}

+ {% endif %} + + +
+
+
+ +
+{% endblock %} \ No newline at end of file diff --git a/website/views.py b/website/views.py index c160674652..8482e5bfb0 100644 --- a/website/views.py +++ b/website/views.py @@ -34,7 +34,7 @@ from django.db.models import Sum, Count, Q from django.db.models.functions import ExtractMonth from django.dispatch import receiver -from django.http import Http404,JsonResponse,HttpResponseRedirect,HttpResponse +from django.http import Http404,JsonResponse,HttpResponseRedirect,HttpResponse,HttpResponseNotFound from django.shortcuts import render, redirect, get_object_or_404 from django.template.loader import render_to_string from django.utils.decorators import method_decorator @@ -3041,6 +3041,8 @@ def handler500(request, exception=None): def contributors_view(request,*args,**kwargs): + + contributors_file_path = os.path.join(settings.BASE_DIR,"contributors.json") with open(contributors_file_path,'r') as file: @@ -3048,6 +3050,21 @@ def contributors_view(request,*args,**kwargs): contributors = json.loads(content) + contributor_id = request.GET.get("contributor",None) + + if contributor_id: + + contributor=None + for i in contributors: + if str(i["id"])==contributor_id: + contributor = i + + if contributor==None: + return HttpResponseNotFound("Contributor not found") + + return render(request,"contributors_detail.html",context={"contributor":contributor}) + + context = { "contributors":contributors } From 84c3bc94d22e484e6fd004b95bb6262873eb2cf7 Mon Sep 17 00:00:00 2001 From: AtmegaBuzz Date: Sat, 25 Mar 2023 12:28:01 +0530 Subject: [PATCH 2/2] added video ref in readme --- README.md | 3 ++- Setup.md | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 92fd8ebd99..6d9b4a831a 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,8 @@ - Read more about [BLT](https://owasp.org/www-project-bug-logging-tool/) - + +- Watch this [Video](https://www.youtube.com/watch?v=jNp3J6HLpqc) to get detailed motives and features of project BLT. # Development diff --git a/Setup.md b/Setup.md index 6e293f0c35..5bc310c34d 100644 --- a/Setup.md +++ b/Setup.md @@ -1,5 +1,8 @@ # Setting up Development server +- [Video on How to setup Project BLT](https://www.youtube.com/watch?v=IYBRVRfPCK8) + + ## Setting Up Development Server using Docker-compose (Recomended) ### Install [Docker](https://docs.docker.com/get-docker/)