From 1a42123ca12eb45e0163cfb0d1637fdfe805b658 Mon Sep 17 00:00:00 2001 From: Alwin1847207 Date: Thu, 3 Oct 2019 15:25:52 +0530 Subject: Segregate proposals based on proposal status --- .idea/.gitignore | 6 + .idea/FOSSEE_animations.iml | 31 ++++++ .idea/dataSources.xml | 16 +++ .idea/inspectionProfiles/profiles_settings.xml | 6 + .idea/misc.xml | 7 ++ .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 + .../templates/fossee_manim/proposal_status.html | 44 ++++++-- fossee_manim/urls.py | 4 + fossee_manim/views.py | 123 +++++++++++++++++++++ 10 files changed, 244 insertions(+), 7 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/FOSSEE_animations.iml create mode 100644 .idea/dataSources.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..3889a9e --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,6 @@ + +# Default ignored files +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml \ No newline at end of file diff --git a/.idea/FOSSEE_animations.iml b/.idea/FOSSEE_animations.iml new file mode 100644 index 0000000..455ff31 --- /dev/null +++ b/.idea/FOSSEE_animations.iml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml new file mode 100644 index 0000000..954cdfa --- /dev/null +++ b/.idea/dataSources.xml @@ -0,0 +1,16 @@ + + + + + sqlite.xerial + true + true + $PROJECT_DIR$/fossee_anime/settings.py + org.sqlite.JDBC + jdbc:sqlite:$PROJECT_DIR$/db.sqlite3 + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8656114 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..3dd842f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/fossee_manim/templates/fossee_manim/proposal_status.html b/fossee_manim/templates/fossee_manim/proposal_status.html index c41a195..a18dc41 100644 --- a/fossee_manim/templates/fossee_manim/proposal_status.html +++ b/fossee_manim/templates/fossee_manim/proposal_status.html @@ -10,6 +10,36 @@

Proposal Status


+
+
+

Sort by :

+
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+
+
@@ -18,7 +48,7 @@ {% if request.user.profile.position == 'reviewer' %} - + {# #} {% endif %} @@ -36,18 +66,18 @@ {% if request.user.profile.position == 'reviewer' %} - + {# #} {% endif %} - {% if request.user.profile.position == 'reviewer' %} - - {% endif %} + {% if request.user.profile.position == 'reviewer' %} + + {% endif %} {% endfor %} diff --git a/fossee_manim/urls.py b/fossee_manim/urls.py index 1947cba..5c87869 100644 --- a/fossee_manim/urls.py +++ b/fossee_manim/urls.py @@ -36,6 +36,10 @@ urlpatterns = [ name='explore'), url(r'^delete_proposal/([1-9][0-9]*)$',views.delete_proposal,name='delete_proposal'), url(r'^delete_proposal_info/([1-9][0-9]*)$',views.delete_proposal_info,name='delete_proposal_info'), + url(r'^sortproposal_released/$',views.sortproposal_released,name='sortproposal_released'), + url(r'^sortproposal_rejected/$',views.sortproposal_rejected,name='sortproposal_rejected'), + url(r'^sortproposal_changes/',views.sortproposal_changes,name='sortproposal_changes'), + url(r'^sortproposal_pending/$',views.sortproposal_pending,name='sortproposal_pending'), ] urlpatterns += static( diff --git a/fossee_manim/views.py b/fossee_manim/views.py index faa93b9..fc307f2 100644 --- a/fossee_manim/views.py +++ b/fossee_manim/views.py @@ -334,6 +334,129 @@ def proposal_status(request): else: return redirect('/login/') +@login_required +def sortproposal_released(request): + user = request.user + if is_email_checked(user) and user.is_authenticated(): + profile = Profile.objects.get(user_id=user) + categories = Category.objects.all() + if profile.position == 'contributor': + animations = Animation.objects.filter(contributor_id=user,status='released').order_by('-created') + else: + animations = Animation.objects.filter(status='released').order_by('-created') + # print(animations) + + # Show upto 9 proposals per page + paginator = Paginator(list(animations), 9) + page = request.GET.get('page') + try: + anime = paginator.page(page) + print(animations.count(), anime) + except PageNotAnInteger: + # If page is not an integer, deliver first page. + anime = paginator.page(1) + except EmptyPage: + # If page is out of range(e.g 999999), deliver last page. + anime = paginator.page(paginator.num_pages) + + return render(request, 'fossee_manim/proposal_status.html', + {'anime': anime, + 'categories': categories}) + else: + return redirect('/login/') + +@login_required +def sortproposal_rejected(request): + user = request.user + if is_email_checked(user) and user.is_authenticated(): + profile = Profile.objects.get(user_id=user) + categories = Category.objects.all() + if profile.position == 'contributor': + animations = Animation.objects.filter(contributor_id=user,status='rejected').order_by('-created') + else: + animations = Animation.objects.filter(status='rejected').order_by('-created') + # print(animations) + + # Show upto 9 proposals per page + paginator = Paginator(list(animations), 9) + page = request.GET.get('page') + try: + anime = paginator.page(page) + print(animations.count(), anime) + except PageNotAnInteger: + # If page is not an integer, deliver first page. + anime = paginator.page(1) + except EmptyPage: + # If page is out of range(e.g 999999), deliver last page. + anime = paginator.page(paginator.num_pages) + + return render(request, 'fossee_manim/proposal_status.html', + {'anime': anime, + 'categories': categories}) + else: + return redirect('/login/') + +@login_required +def sortproposal_changes(request): + user = request.user + if is_email_checked(user) and user.is_authenticated(): + profile = Profile.objects.get(user_id=user) + categories = Category.objects.all() + if profile.position == 'contributor': + animations = Animation.objects.filter(contributor_id=user,status='changes').order_by('-created') + else: + animations = Animation.objects.filter(status='changes').order_by('-created') + # print(animations) + + # Show upto 9 proposals per page + paginator = Paginator(list(animations), 9) + page = request.GET.get('page') + try: + anime = paginator.page(page) + print(animations.count(), anime) + except PageNotAnInteger: + # If page is not an integer, deliver first page. + anime = paginator.page(1) + except EmptyPage: + # If page is out of range(e.g 999999), deliver last page. + anime = paginator.page(paginator.num_pages) + + return render(request, 'fossee_manim/proposal_status.html', + {'anime': anime, + 'categories': categories}) + else: + return redirect('/login/') + +@login_required +def sortproposal_pending(request): + user = request.user + if is_email_checked(user) and user.is_authenticated(): + profile = Profile.objects.get(user_id=user) + categories = Category.objects.all() + if profile.position == 'contributor': + animations = Animation.objects.filter(contributor_id=user,status='pending').order_by('-created') + else: + animations = Animation.objects.filter(status='pending').order_by('-created') + # print(animations) + + # Show upto 9 proposals per page + paginator = Paginator(list(animations), 9) + page = request.GET.get('page') + try: + anime = paginator.page(page) + print(animations.count(), anime) + except PageNotAnInteger: + # If page is not an integer, deliver first page. + anime = paginator.page(1) + except EmptyPage: + # If page is out of range(e.g 999999), deliver last page. + anime = paginator.page(paginator.num_pages) + + return render(request, 'fossee_manim/proposal_status.html', + {'anime': anime, + 'categories': categories}) + else: + return redirect('/login/') @login_required def edit_proposal(request, proposal_id=None): -- cgit
Created DateContributor NameMail StatusMail Status
{{ an.created }}{{ an.contributor.get_full_name }}{{ an.contributor.get_full_name }}{{ an.contributor.get_full_name }} - - + +