diff options
author | Alwin1847207 | 2019-10-03 15:25:52 +0530 |
---|---|---|
committer | Alwin1847207 | 2019-10-03 15:25:52 +0530 |
commit | 1a42123ca12eb45e0163cfb0d1637fdfe805b658 (patch) | |
tree | 1217a75bf131720e76ba69a2555720838dd91999 | |
parent | 055efb407c3b265ffbc2ed47f1f0b5d1a29b6391 (diff) | |
download | FOSSEE_animations-1a42123ca12eb45e0163cfb0d1637fdfe805b658.tar.gz FOSSEE_animations-1a42123ca12eb45e0163cfb0d1637fdfe805b658.tar.bz2 FOSSEE_animations-1a42123ca12eb45e0163cfb0d1637fdfe805b658.zip |
Segregate proposals based on proposal status
-rw-r--r-- | .idea/.gitignore | 6 | ||||
-rw-r--r-- | .idea/FOSSEE_animations.iml | 31 | ||||
-rw-r--r-- | .idea/dataSources.xml | 16 | ||||
-rw-r--r-- | .idea/inspectionProfiles/profiles_settings.xml | 6 | ||||
-rw-r--r-- | .idea/misc.xml | 7 | ||||
-rw-r--r-- | .idea/modules.xml | 8 | ||||
-rw-r--r-- | .idea/vcs.xml | 6 | ||||
-rw-r--r-- | fossee_manim/templates/fossee_manim/proposal_status.html | 44 | ||||
-rw-r--r-- | fossee_manim/urls.py | 4 | ||||
-rw-r--r-- | fossee_manim/views.py | 123 |
10 files changed, 244 insertions, 7 deletions
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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="PYTHON_MODULE" version="4"> + <component name="FacetManager"> + <facet type="django" name="Django"> + <configuration> + <option name="rootFolder" value="$MODULE_DIR$" /> + <option name="settingsModule" value="fossee_anime/settings.py" /> + <option name="manageScript" value="$MODULE_DIR$/manage.py" /> + <option name="environment" value="<map/>" /> + <option name="doNotUseTestRunner" value="false" /> + <option name="trackFilePattern" value="migrations" /> + </configuration> + </facet> + </component> + <component name="NewModuleRootManager"> + <content url="file://$MODULE_DIR$" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> + <component name="TemplatesService"> + <option name="TEMPLATE_CONFIGURATION" value="Django" /> + <option name="TEMPLATE_FOLDERS"> + <list> + <option value="$MODULE_DIR$/fossee_manim/templates" /> + </list> + </option> + </component> + <component name="TestRunnerService"> + <option name="PROJECT_TEST_RUNNER" value="Unittests" /> + </component> +</module>
\ 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="DataSourceManagerImpl" format="xml" multifile-model="true"> + <data-source source="LOCAL" name="Django default" uuid="c2ec2b16-9a8a-4975-be60-2a0417af82c8"> + <driver-ref>sqlite.xerial</driver-ref> + <synchronize>true</synchronize> + <imported>true</imported> + <remarks>$PROJECT_DIR$/fossee_anime/settings.py</remarks> + <jdbc-driver>org.sqlite.JDBC</jdbc-driver> + <jdbc-url>jdbc:sqlite:$PROJECT_DIR$/db.sqlite3</jdbc-url> + <driver-properties> + <property name="enable_load_extension" value="true" /> + </driver-properties> + </data-source> + </component> +</project>
\ 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 @@ +<component name="InspectionProjectProfileManager"> + <settings> + <option name="USE_PROJECT_PROFILE" value="false" /> + <version value="1.0" /> + </settings> +</component>
\ 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="JavaScriptSettings"> + <option name="languageLevel" value="ES6" /> + </component> + <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" /> +</project>
\ 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/FOSSEE_animations.iml" filepath="$PROJECT_DIR$/.idea/FOSSEE_animations.iml" /> + </modules> + </component> +</project>
\ 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$" vcs="Git" /> + </component> +</project>
\ 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 @@ <h2> Proposal Status </h2> <hr> + <div class="row"> + <div class="col-md-2"> + <h2>Sort by :</h2> + </div> + + <div class="col-md-2"> + <a href="{% url 'sortproposal_rejected' %}"> + <button type="button" class="btn btn-info" id="btnred">Rejected</button> + </a> + </div> + + <div class="col-md-2"> + <a href="{% url 'sortproposal_released' %}"> + <button type="button" class="btn btn-info" id="btnred">Released</button> + </a> + </div> + + <div class="col-md-2"> + <a href="{% url 'sortproposal_changes' %}"> + <button type="button" class="btn btn-info" id="btnred">Changes</button> + </a> + </div> + + <div class="col-md-2"> + <a href="{% url 'sortproposal_pending' %}"> + <button type="button" class="btn btn-info" id="btnred">Pending</button> + </a> + </div> + </div> + <hr> <table class="table table-hover" style="font-family: 'Lato', sans-serif;"> <thead> <tr> @@ -18,7 +48,7 @@ <th>Created Date</th> {% if request.user.profile.position == 'reviewer' %} <th>Contributor Name</th> - <th>Mail Status</th> + {# <th>Mail Status</th>#} {% endif %} </tr> </thead> @@ -36,18 +66,18 @@ <td><span class="badge">{{ an.created }}</span></td> {% if request.user.profile.position == 'reviewer' %} <td>{{ an.contributor.get_full_name }}</td> - <td>{{ an.contributor.get_full_name }}</td> + {# <td>{{ an.contributor.get_full_name }}</td>#} {% endif %} <td><a href="{% url 'edit_proposal' an.id %}"> <button type="button" class="btn btn-info" id="btnblue">Edit </button> </a></td> - {% if request.user.profile.position == 'reviewer' %} - <td><a href="{% url 'delete_proposal' an.id %}"> - <button type="button" class="btn btn-info" id="btnred">Delete</button> - </a></td> - {% endif %} + {% if request.user.profile.position == 'reviewer' %} + <td><a href="{% url 'delete_proposal' an.id %}"> + <button type="button" class="btn btn-info" id="btnred">Delete</button> + </a></td> + {% endif %} </tr> </tbody> {% 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): |