From 5726e2efd7e4e5c5be7cb0c6ae2774068cb7f1e9 Mon Sep 17 00:00:00 2001 From: jarvisdev Date: Sat, 27 Oct 2018 18:32:39 +0530 Subject: [PATCH 1/4] syncing fork --- Projects/templates/Projects/home.html | 1 + Projects/views.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Projects/templates/Projects/home.html b/Projects/templates/Projects/home.html index 7a6598b..d145366 100644 --- a/Projects/templates/Projects/home.html +++ b/Projects/templates/Projects/home.html @@ -28,6 +28,7 @@ {% block body_content %} {% include 'Projects/navbar.html' %} +
diff --git a/Projects/views.py b/Projects/views.py index f0c0f77..72946f1 100644 --- a/Projects/views.py +++ b/Projects/views.py @@ -11,6 +11,7 @@ import json from .models import Issues, Prs import time +from django.db.models import Q def vote(request): if request.user.is_authenticated: @@ -82,7 +83,6 @@ def home(request): issues = Issues.objects.all().order_by('points') else: issues = Issues.objects.all().order_by('-pk') - paginator = Paginator(issues, 15) # Show 15 issues per page page = request.GET.get('page', 1) @@ -94,7 +94,7 @@ def home(request): except EmptyPage: issues = paginator.get_page(paginator.num_pages) issues = Issues.objects.none() - return render(request, 'Projects/home.html', {'issues': issues, 'val':val}) #this dic will have value of + return render(request, 'Projects/home.html', {'issues': issues}) #this dic will have value of #all filter attributes or you can also send a list of all such attrs def leaderboard(request): From a8ba98fd8773a356a5170e72e759830cdac1db66 Mon Sep 17 00:00:00 2001 From: jarvisdev Date: Sat, 27 Oct 2018 19:26:18 +0530 Subject: [PATCH 2/4] reloading prevented while changing label --- Projects/templates/Projects/home.html | 309 +++++++++++++------------- 1 file changed, 160 insertions(+), 149 deletions(-) diff --git a/Projects/templates/Projects/home.html b/Projects/templates/Projects/home.html index 79a13a0..78caa1a 100644 --- a/Projects/templates/Projects/home.html +++ b/Projects/templates/Projects/home.html @@ -69,9 +69,9 @@

{{forloop.counter0|add:issues.start_index}}. Issue - {{issue.title_issue}} {% if issue.label == 1 %} - OPEN + OPEN {% elif issue.label == 0 %} - CLOSED + CLOSED {% endif %}

@@ -152,172 +152,183 @@

{% block js_extra %} - - + {% endblock js_extra %} From 7ce9b8df6968f3d7fe0798b556e8cdca7814bb93 Mon Sep 17 00:00:00 2001 From: jarvisdev Date: Sat, 27 Oct 2018 19:34:58 +0530 Subject: [PATCH 3/4] updated master --- Projects/static/Projects/js/profile.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Projects/static/Projects/js/profile.js b/Projects/static/Projects/js/profile.js index d648224..0efb326 100644 --- a/Projects/static/Projects/js/profile.js +++ b/Projects/static/Projects/js/profile.js @@ -65,7 +65,6 @@ $(document).ready(function() { success: function(data) { if (data) { alert(data); - document.location.reload(); } } }); From e07a35966f1b027526cd753da632971ef129764f Mon Sep 17 00:00:00 2001 From: jarvisdev Date: Sat, 27 Oct 2018 19:43:24 +0530 Subject: [PATCH 4/4] preventing reload when deleting a PR --- ContriHub/settings.py | 40 +++++++++++++------------- Projects/static/Projects/js/profile.js | 1 + 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/ContriHub/settings.py b/ContriHub/settings.py index ab2c66a..ed8dd11 100644 --- a/ContriHub/settings.py +++ b/ContriHub/settings.py @@ -122,12 +122,12 @@ else: #this is for local you need not to make any changes here, # it'll work unless you are sure about how to setup postgres/mysql etc - DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } - } + # DATABASES = { + # 'default': { + # 'ENGINE': 'django.db.backends.sqlite3', + # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + # } + # } #An example how you can setup postgres sql in local, create a postgres db and provide relevant details in this format # DB_PASS = os.environ.get('CONTRIHUB_PASS', "") # DATABASES = { @@ -140,20 +140,20 @@ # 'PORT': '', # } # } - # DATABASES = { - # 'default': { - # 'ENGINE': 'django.db.backends.mysql', - # 'OPTIONS': { - # # 'read_default_file': '/path/to/my.cnf', - # }, - # # 'NAME': os.path.join(BASE_DIR, 'testdb'), - # 'NAME': 'contrihub_db', - # 'USER': 'user', - # 'PASSWORD': '1234', - # 'HOST': '127.0.0.1', - # 'PORT': '', - # } - # } + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'OPTIONS': { + # 'read_default_file': '/path/to/my.cnf', + }, + # 'NAME': os.path.join(BASE_DIR, 'testdb'), + 'NAME': 'contrihub_db', + 'USER': 'user', + 'PASSWORD': '1234', + 'HOST': '127.0.0.1', + 'PORT': '', + } + } # Password validation diff --git a/Projects/static/Projects/js/profile.js b/Projects/static/Projects/js/profile.js index 0efb326..5e7edae 100644 --- a/Projects/static/Projects/js/profile.js +++ b/Projects/static/Projects/js/profile.js @@ -65,6 +65,7 @@ $(document).ready(function() { success: function(data) { if (data) { alert(data); + pr.hide(); } } });