From 055efb407c3b265ffbc2ed47f1f0b5d1a29b6391 Mon Sep 17 00:00:00 2001 From: Alwin1847207 Date: Thu, 3 Oct 2019 13:51:25 +0530 Subject: Enable deleting test proposals by reviewer --- fossee_manim/forms.py | 2 +- fossee_manim/models.py | 2 + fossee_manim/send_mails.py | 1 + fossee_manim/static/css/index.css | 27 ++ fossee_manim/templates/fossee_manim/about.html | 23 +- .../templates/fossee_manim/activation.html | 95 +++---- fossee_manim/templates/fossee_manim/base.html | 93 +++---- .../templates/fossee_manim/categorical_list.html | 54 ++-- .../templates/fossee_manim/delete_proposal.html | 46 +++ .../templates/fossee_manim/edit_profile.html | 32 ++- .../templates/fossee_manim/edit_proposal.html | 181 ++++++------ fossee_manim/templates/fossee_manim/explore.html | 46 +-- fossee_manim/templates/fossee_manim/faqs.html | 195 ++++++++----- .../templates/fossee_manim/guidelines.html | 307 ++++++++++++--------- .../templates/fossee_manim/honorarium.html | 132 +++++---- fossee_manim/templates/fossee_manim/index.html | 117 ++++---- fossee_manim/templates/fossee_manim/library.html | 110 ++++---- fossee_manim/templates/fossee_manim/libraryCS.html | 20 +- .../templates/fossee_manim/libraryMath.html | 20 +- .../templates/fossee_manim/libraryPhys.html | 18 +- fossee_manim/templates/fossee_manim/login.html | 43 +-- fossee_manim/templates/fossee_manim/logout.html | 22 +- fossee_manim/templates/fossee_manim/outreach.html | 18 +- .../templates/fossee_manim/profile_updated.html | 23 +- .../templates/fossee_manim/proposal_status.html | 145 +++++----- fossee_manim/templates/fossee_manim/register.html | 52 ++-- .../templates/fossee_manim/search_results.html | 52 ++-- .../templates/fossee_manim/send_proposal.html | 82 +++--- .../templates/fossee_manim/upload_success.html | 36 ++- fossee_manim/templates/fossee_manim/video.html | 130 ++++----- .../templates/fossee_manim/view_profile.html | 124 ++++++--- fossee_manim/templates/registration/base.html | 165 +++++------ .../registration/password_change_done.html | 15 +- .../registration/password_change_form.html | 21 +- .../registration/password_reset_confirm.html | 20 +- .../registration/password_reset_done.html | 10 +- .../registration/password_reset_form.html | 22 +- fossee_manim/urls.py | 2 + fossee_manim/views.py | 202 +++++++++----- 39 files changed, 1528 insertions(+), 1177 deletions(-) create mode 100644 fossee_manim/templates/fossee_manim/delete_proposal.html diff --git a/fossee_manim/forms.py b/fossee_manim/forms.py index 69f8458..af2b96e 100644 --- a/fossee_manim/forms.py +++ b/fossee_manim/forms.py @@ -261,6 +261,7 @@ class AnimationProposal(forms.ModelForm): 'any other related information') } + class Meta: model = Animation fields = ['category', 'subcategory', 'title', 'outline', 'tags'] @@ -282,7 +283,6 @@ class CommentForm(forms.ModelForm): 'comments': forms.CharField(), } - class UploadAnimationForm(forms.ModelForm): def __init__(self, *args, **kwargs): diff --git a/fossee_manim/models.py b/fossee_manim/models.py index 273ebe6..a6f68c2 100644 --- a/fossee_manim/models.py +++ b/fossee_manim/models.py @@ -172,6 +172,8 @@ class Animation(models.Model): reviewer = models.ForeignKey(User, null=True, on_delete=models.CASCADE, related_name="%(app_label)s_%(class)s_related") outline = models.TextField() + # concepts = models.TextField() + # audience=models.TextField() status = models.CharField(max_length=255, choices=status) category = models.ForeignKey(Category, on_delete=models.CASCADE) subcategory = models.CharField(max_length=255, blank=True) diff --git a/fossee_manim/send_mails.py b/fossee_manim/send_mails.py index 363a0ec..86f4bc4 100644 --- a/fossee_manim/send_mails.py +++ b/fossee_manim/send_mails.py @@ -103,6 +103,7 @@ def send_email(request, call_on, contributor=None, key=None, proposal=None): "Congratulations! Your Animation has been Accepted!", message, SENDER_EMAIL, [contributor.profile.user.email], fail_silently=True ) + """create a table and add the status as mail send""" elif call_on == 'rejected': message = dedent("""\ Dear {0}, diff --git a/fossee_manim/static/css/index.css b/fossee_manim/static/css/index.css index 0a7895e..54bda1b 100644 --- a/fossee_manim/static/css/index.css +++ b/fossee_manim/static/css/index.css @@ -124,3 +124,30 @@ hr { background-color: #ffe0b2; border-radius: 50%; } + +.footer{ + right: 0; + left: 0; + bottom: 0; + padding: 1rem; + text-align: center; +} +a{ + color:white; +} + +a:hover{ + color:white; + background-color: gray; +} + +.navbar-toggler-icon { + display: inline-block; + width: 1.5em; + height: 1.5em; + vertical-align: middle; + content: ""; + background: no-repeat center center; + background-size: 100% 100%; + background-color: white; +} \ No newline at end of file diff --git a/fossee_manim/templates/fossee_manim/about.html b/fossee_manim/templates/fossee_manim/about.html index 13b5a01..21c55d5 100644 --- a/fossee_manim/templates/fossee_manim/about.html +++ b/fossee_manim/templates/fossee_manim/about.html @@ -1,19 +1,20 @@ {% extends 'fossee_manim/base.html' %} - {% block title %} - About - {% endblock %} +{% block title %} +About +{% endblock %} {% block content %} -
- -
+
+ +

About FOSSEE Animations

-

What do we do and why?

-
+

What do we do and why?

+
-
+

-
- {% endblock content %} +
+{% endblock content %} \ No newline at end of file diff --git a/fossee_manim/templates/fossee_manim/activation.html b/fossee_manim/templates/fossee_manim/activation.html index 10a3d60..20a4c62 100644 --- a/fossee_manim/templates/fossee_manim/activation.html +++ b/fossee_manim/templates/fossee_manim/activation.html @@ -1,24 +1,24 @@ {% extends 'fossee_manim/base.html' %} {% block title %} - Awating activation +Awating activation {% endblock %} {% block header %} - {% endblock %} {% block extra %} @@ -27,45 +27,46 @@ {% block content %}
- {% if status == '2' %} -
-
-

Your email is already verified, Please view your profile here

- -
+{% if status == '2' %} +
+
+

Your email is already verified, Please view your profile here +

+
- {% elif status == '1' %} - -
-
-

Your activation has expired please register again

-
+
+{% elif status == '1' %} + +
+
+

Your activation has expired please register again

- {% elif status == '0' %} -
-
-

Your account has been activated. Please view your profile here

- -
+
+{% elif status == '0' %} +
+
+

Your account has been activated. Please view your profile here +

+
- {% else %} - +
+{% else %} + -
-
-

Activation Awaiting

-

The Activation Link has been sent to your email. The link expires in 24hours from the date of registration. You will be logged out automatically.

-
+
+
+

Activation Awaiting

+

The Activation Link has been sent to your email. The link expires in 24hours from the date + of registration. You will be logged out automatically.

- {% endif %} +
+{% endif %} {% endblock %} \ No newline at end of file diff --git a/fossee_manim/templates/fossee_manim/base.html b/fossee_manim/templates/fossee_manim/base.html index 06d7071..ab5fa06 100644 --- a/fossee_manim/templates/fossee_manim/base.html +++ b/fossee_manim/templates/fossee_manim/base.html @@ -1,15 +1,16 @@ + {% block title %} - HomePage + HomePage {% endblock %} - + @@ -19,20 +20,21 @@ - - + + + - - {% block extra %} + +{% block extra %} - {% endblock %} +{% endblock %} - {% block header %} -
- - - -
-
- -
-
- {% endblock %} - - {% block content %} -

-

Base Template Content. Please override me

-
{% endblock %} - + {% block content %} +

+

Base Template Content. Please override me

+
+ {% endblock %} {% block footer %} - {% endblock footer %} - - - {% endblock %} \ 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 2b5387f..81af9ec 100644 --- a/fossee_manim/templates/fossee_manim/proposal_status.html +++ b/fossee_manim/templates/fossee_manim/proposal_status.html @@ -11,6 +11,14 @@

Proposal Status



diff --git a/fossee_manim/views.py b/fossee_manim/views.py index 59eac34..314b83f 100644 --- a/fossee_manim/views.py +++ b/fossee_manim/views.py @@ -2,7 +2,7 @@ from os import listdir, path, sep, makedirs, remove from .forms import ( UserRegistrationForm, UserLoginForm, ProfileForm, AnimationProposal, - CommentForm, UploadAnimationForm,AnimationProposal_edit + CommentForm, UploadAnimationForm, AnimationProposal_edit ) from .models import ( Profile, User, AnimationStats, @@ -334,6 +334,8 @@ def proposal_status(request): else: return redirect('/login/') + +# this method return the proposal in the status of released @login_required def sortproposal_released(request): user = request.user @@ -341,8 +343,11 @@ def sortproposal_released(request): 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') + # filtering with the proposal status + animations = Animation.objects.filter(contributor_id=user, + status='released').order_by('-created') else: + # filtering with the proposal status animations = Animation.objects.filter(status='released').order_by('-created') # print(animations) @@ -365,6 +370,8 @@ def sortproposal_released(request): else: return redirect('/login/') + +# this method return the proposal in the status of rejected @login_required def sortproposal_rejected(request): user = request.user @@ -372,8 +379,11 @@ def sortproposal_rejected(request): 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') + # filtering with the proposal status + animations = Animation.objects.filter(contributor_id=user, + status='rejected').order_by('-created') else: + # filtering with the proposal status animations = Animation.objects.filter(status='rejected').order_by('-created') # print(animations) @@ -396,6 +406,8 @@ def sortproposal_rejected(request): else: return redirect('/login/') + +# this method return the proposal in the status of changes @login_required def sortproposal_changes(request): user = request.user @@ -403,8 +415,11 @@ def sortproposal_changes(request): 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') + # filtering with the proposal status + animations = Animation.objects.filter(contributor_id=user, + status='changes').order_by('-created') else: + # filtering with the proposal status animations = Animation.objects.filter(status='changes').order_by('-created') # print(animations) @@ -427,6 +442,8 @@ def sortproposal_changes(request): else: return redirect('/login/') + +# this method return the proposal in the status of pending @login_required def sortproposal_pending(request): user = request.user @@ -434,8 +451,11 @@ def sortproposal_pending(request): 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') + # filtering with the proposal status + animations = Animation.objects.filter(contributor_id=user, + status='pending').order_by('-created') else: + # filtering with the proposal status animations = Animation.objects.filter(status='pending').order_by('-created') # print(animations) @@ -551,6 +571,7 @@ def edit_proposal(request, proposal_id=None): 'msg': msg}) +# this method is used to return the details the proposal selected to delete @login_required def delete_proposal(request, proposal_id=None): user = request.user @@ -562,12 +583,15 @@ def delete_proposal(request, proposal_id=None): return redirect('/register/') +# this method is used to delete the selected proposal by the reviever @login_required def delete_proposal_info(request, proposal_id=None): user = request.user if is_email_checked(user) and user.is_authenticated(): + # delete the selected proposal proposal = Animation.objects.get(id=proposal_id) proposal.delete() + # loading the proposal page to redirect after deleting one proposal profile = Profile.objects.get(user_id=user) categories = Category.objects.all() if profile.position == 'contributor': -- cgit From f79913639bc283c945a392d641e84b0a70a97eda Mon Sep 17 00:00:00 2001 From: Alwin1847207 Date: Mon, 28 Oct 2019 10:58:33 +0530 Subject: PEP8 formatting --- fossee_manim/forms.py | 189 ++++++++++++++++++++++++-------------------------- fossee_manim/urls.py | 28 ++++---- fossee_manim/views.py | 153 +++++++++++++++++++++++++--------------- 3 files changed, 204 insertions(+), 166 deletions(-) diff --git a/fossee_manim/forms.py b/fossee_manim/forms.py index 8b7eada..0836e47 100644 --- a/fossee_manim/forms.py +++ b/fossee_manim/forms.py @@ -1,9 +1,9 @@ from django import forms from django.utils import timezone from .models import ( - Profile, User, Animation, - Comment, AnimationStats - ) + Profile, User, Animation, + Comment, AnimationStats +) from string import punctuation, digits try: from string import letters @@ -21,7 +21,7 @@ PWD_CHARS = letters + punctuation + digits position_choices = ( ("contributor", "Contributor"), ("reviewer", "Reviewer") - ) +) department_choices = ( ("computer", "Dept. of Computer Science/Engg."), @@ -36,7 +36,7 @@ department_choices = ( ("electronics", "Dept. of Electronics"), ("energy science and engineering", "Dept. of Energy Science and Engg"), ("others", "Others") - ) +) title = ( ("Professor", "Prof."), @@ -47,7 +47,7 @@ title = ( ("Mr", "Mr."), ("Mrs", "Mrs."), ("Miss", "Ms."), - ) +) source = ( ("FOSSEE Email", "FOSSEE Email"), @@ -56,46 +56,46 @@ source = ( ("Social Media", "Social Media"), ("From other College", "From other College"), ("others", "Others") - ) +) states = ( - ("IN-AP", "Andhra Pradesh"), - ("IN-AR", "Arunachal Pradesh"), - ("IN-AS", "Assam"), - ("IN-BR", "Bihar"), - ("IN-CT", "Chhattisgarh"), - ("IN-GA", "Goa"), - ("IN-GJ", "Gujarat"), - ("IN-HR", "Haryana"), - ("IN-HP", "Himachal Pradesh"), - ("IN-JK", "Jammu and Kashmir"), - ("IN-JH", "Jharkhand"), - ("IN-KA", "Karnataka"), - ("IN-KL", "Kerala"), - ("IN-MP", "Madhya Pradesh"), - ("IN-MH", "Maharashtra"), - ("IN-MN", "Manipur"), - ("IN-ML", "Meghalaya"), - ("IN-MZ", "Mizoram"), - ("IN-NL", "Nagaland"), - ("IN-OR", "Odisha"), - ("IN-PB", "Punjab"), - ("IN-RJ", "Rajasthan"), - ("IN-SK", "Sikkim"), - ("IN-TN", "Tamil Nadu"), - ("IN-TG", "Telangana"), - ("IN-TR", "Tripura"), - ("IN-UT", "Uttarakhand"), - ("IN-UP", "Uttar Pradesh"), - ("IN-WB", "West Bengal"), - ("IN-AN", "Andaman and Nicobar Islands"), - ("IN-CH", "Chandigarh"), - ("IN-DN", "Dadra and Nagar Haveli"), - ("IN-DD", "Daman and Diu"), - ("IN-DL", "Delhi"), - ("IN-LD", "Lakshadweep"), - ("IN-PY", "Puducherry") - ) + ("IN-AP", "Andhra Pradesh"), + ("IN-AR", "Arunachal Pradesh"), + ("IN-AS", "Assam"), + ("IN-BR", "Bihar"), + ("IN-CT", "Chhattisgarh"), + ("IN-GA", "Goa"), + ("IN-GJ", "Gujarat"), + ("IN-HR", "Haryana"), + ("IN-HP", "Himachal Pradesh"), + ("IN-JK", "Jammu and Kashmir"), + ("IN-JH", "Jharkhand"), + ("IN-KA", "Karnataka"), + ("IN-KL", "Kerala"), + ("IN-MP", "Madhya Pradesh"), + ("IN-MH", "Maharashtra"), + ("IN-MN", "Manipur"), + ("IN-ML", "Meghalaya"), + ("IN-MZ", "Mizoram"), + ("IN-NL", "Nagaland"), + ("IN-OR", "Odisha"), + ("IN-PB", "Punjab"), + ("IN-RJ", "Rajasthan"), + ("IN-SK", "Sikkim"), + ("IN-TN", "Tamil Nadu"), + ("IN-TG", "Telangana"), + ("IN-TR", "Tripura"), + ("IN-UT", "Uttarakhand"), + ("IN-UP", "Uttar Pradesh"), + ("IN-WB", "West Bengal"), + ("IN-AN", "Andaman and Nicobar Islands"), + ("IN-CH", "Chandigarh"), + ("IN-DN", "Dadra and Nagar Haveli"), + ("IN-DD", "Daman and Diu"), + ("IN-DL", "Delhi"), + ("IN-LD", "Lakshadweep"), + ("IN-PY", "Puducherry") +) def check_upper(uname): @@ -111,7 +111,8 @@ class UserRegistrationForm(forms.Form): a new user to the system""" required_css_class = 'required' errorlist_css_class = 'errorlist' - username = forms.CharField(max_length=32, help_text='''lowercase, letters, digits, + username = forms.CharField( + max_length=32, help_text='''lowercase, letters, digits, period and underscore only.''') email = forms.EmailField() password = forms.CharField(max_length=32, widget=forms.PasswordInput()) @@ -132,7 +133,9 @@ class UserRegistrationForm(forms.Form): department = forms.ChoiceField(help_text='Department you work/study', choices=department_choices) location = forms.CharField(max_length=255, help_text="Place/City") - pincode = forms.RegexField(regex=r'^.{6}$', error_messages={'invalid': "Please enter valid PINCODE"}) + pincode = forms.RegexField( + regex=r'^.{6}$', error_messages={ + 'invalid': "Please enter valid PINCODE"}) state = forms.ChoiceField(choices=states) how_did_you_hear_about_us = forms.ChoiceField(choices=source) @@ -213,11 +216,11 @@ class UserLoginForm(forms.Form): super(UserLoginForm, self).clean() try: u_name, pwd = self.cleaned_data["username"],\ - self.cleaned_data["password"] + self.cleaned_data["password"] user = authenticate(username=u_name, password=pwd) except Exception: - raise forms.ValidationError\ - ("Username and/or Password is not entered") + raise forms.ValidationError( + "Username and/or Password is not entered") if not user: raise forms.ValidationError("Invalid username/password") return user @@ -229,7 +232,7 @@ class ProfileForm(forms.ModelForm): class Meta: model = Profile fields = ['first_name', 'last_name', 'institute', 'department', - ] + ] first_name = forms.CharField(max_length=32) last_name = forms.CharField(max_length=32) @@ -253,13 +256,10 @@ class AnimationProposal(forms.ModelForm): # self.fields['outline'].widget.attrs['placeholder'] = 'NOTE: Do\ # add info about prerequisites (if any), possible textbooks and \ # any other related information' - self.fields['outline'].widget.attrs={ - 'id': 'custom_editor', - 'rows': 10, - 'cols': 50, - 'placeholder': ('NOTE: Do add info about prerequisites (if any), possible textbooks and ' - 'any other related information') - } + self.fields['outline'].widget.attrs = { + 'id': 'custom_editor', 'rows': 10, 'cols': 50, 'placeholder': ( + 'NOTE: Do add info about prerequisites (if any), possible textbooks and ' + 'any other related information')} class Meta: model = Animation @@ -281,56 +281,37 @@ class AnimationProposal_edit(forms.ModelForm): # add info about prerequisites (if any), possible textbooks and \ # any other related information' self.fields['outline'].widget.attrs = { - 'id': 'custom_editor', - 'rows': 10, - 'cols': 50, - 'placeholder': ('NOTE: Do add info about prerequisites (if any), possible textbooks and ' - 'any other related information') - } + 'id': 'custom_editor', 'rows': 10, 'cols': 50, 'placeholder': ( + 'NOTE: Do add info about prerequisites (if any), possible textbooks and ' + 'any other related information')} self.fields['concepts'].widget.attrs = { - 'id': 'custom_editor', - 'rows': 10, - 'cols': 50, - 'placeholder': ('Which concept(s) do you want to animate?' - 'Example: Animation of how data flows in Ring Topology') - } + 'id': 'custom_editor', 'rows': 10, 'cols': 50, 'placeholder': ( + 'Which concept(s) do you want to animate?' + 'Example: Animation of how data flows in Ring Topology')} self.fields['audience'].widget.attrs = { - 'id': 'custom_editor', - 'rows': 10, - 'cols': 50, - 'placeholder': ('Who would be the target audience for your video?\n' - 'Example: High School Students, Mechanical Engineers, etc.') - } + 'id': 'custom_editor', 'rows': 10, 'cols': 50, 'placeholder': ( + 'Who would be the target audience for your video?\n' + 'Example: High School Students, Mechanical Engineers, etc.')} self.fields['reference'].widget.attrs = { - 'id': 'custom_editor', - 'rows': 10, - 'cols': 50, - 'placeholder': ('Please try to be as specific as possible. For example,\n' - 'Book used: Linear Algebra.\n' - 'Author: Kenneth Hoffman, Ray Kunze\n' - 'Edition: Second\n' - 'Chapter: 2 ; Page: 40') - } + 'id': 'custom_editor', 'rows': 10, 'cols': 50, 'placeholder': ( + 'Please try to be as specific as possible. For example,\n' + 'Book used: Linear Algebra.\n' + 'Author: Kenneth Hoffman, Ray Kunze\n' + 'Edition: Second\n' + 'Chapter: 2 ; Page: 40')} self.fields['tools'].widget.attrs = { - 'id': 'custom_editor', - 'rows': 10, - 'cols': 50, - 'placeholder': ('What all tools would you be using for animation?\n' - 'Example: manim, blender, mayavi, mathbox, etc') - } + 'id': 'custom_editor', 'rows': 10, 'cols': 50, 'placeholder': ( + 'What all tools would you be using for animation?\n' + 'Example: manim, blender, mayavi, mathbox, etc')} self.fields['detaled_description'].widget.attrs = { 'id': 'custom_editor', 'rows': 10, 'cols': 50, 'placeholder': ('Give a detailed description of your animation') } - self.fields['link'].widget.attrs = { - 'id': 'custom_editor', - 'rows': 10, - 'cols': 50, - 'placeholder': ('Along with the video you will have to submit the source code github link below.\n') - } + self.fields['link'].widget.attrs = {'id': 'custom_editor', 'rows': 10, 'cols': 50, 'placeholder': ( + 'Along with the video you will have to submit the source code github link below.\n')} self.fields['sketch'].label = "Sketch(.jpeg/.jpg only)" class Meta: @@ -338,8 +319,19 @@ class AnimationProposal_edit(forms.ModelForm): widgets = { 'sketch': forms.FileInput(), } - fields = ['category', 'subcategory', 'title', 'outline', 'tags', 'concepts', 'audience', 'reference', 'tools', - 'detaled_description', 'link', 'sketch'] + fields = [ + 'category', + 'subcategory', + 'title', + 'outline', + 'tags', + 'concepts', + 'audience', + 'reference', + 'tools', + 'detaled_description', + 'link', + 'sketch'] class CommentForm(forms.ModelForm): @@ -358,6 +350,7 @@ class CommentForm(forms.ModelForm): 'comments': forms.CharField(), } + class UploadAnimationForm(forms.ModelForm): def __init__(self, *args, **kwargs): diff --git a/fossee_manim/urls.py b/fossee_manim/urls.py index 9615d47..372ebe7 100644 --- a/fossee_manim/urls.py +++ b/fossee_manim/urls.py @@ -26,24 +26,24 @@ urlpatterns = [ url(r'^faqs/$', views.faqs, name='faqs'), url(r'^search_category/(?P.+)$', views.search_category, name='search_category'), - url(r'^about/$',views.about, name='about'), - url(r'^outreach/$',views.outreach, name='outreach'), - url(r'^library/$',views.library, name='library'), - url(r'^libraryMath/$',views.libraryMath, name='libraryMath'), - url(r'^libraryPhys/$',views.libraryPhys, name='libraryPhys'), - url(r'^libraryCS/$',views.libraryCS, name='libraryCS'), + url(r'^about/$', views.about, name='about'), + url(r'^outreach/$', views.outreach, name='outreach'), + url(r'^library/$', views.library, name='library'), + url(r'^libraryMath/$', views.libraryMath, name='libraryMath'), + url(r'^libraryPhys/$', views.libraryPhys, name='libraryPhys'), + url(r'^libraryCS/$', views.libraryCS, name='libraryCS'), url(r'^explore/(?P.+)$', views.explore, 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'), + 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'), url(r'^search_proposal/$', views.search_proposal, name='search_proposal'), ] urlpatterns += static( - settings.MEDIA_URL, - document_root=settings.MEDIA_ROOT + settings.MEDIA_URL, + document_root=settings.MEDIA_ROOT ) diff --git a/fossee_manim/views.py b/fossee_manim/views.py index 314b83f..e7a3aee 100644 --- a/fossee_manim/views.py +++ b/fossee_manim/views.py @@ -35,9 +35,14 @@ except ImportError: from io import BytesIO as string_io __author__ = "Akshen Doke" -__credits__ = ["Prabhu Ramachandran", "Aditya P.", "KhushalSingh Rajput", - "Prathamesh Salunke", "Purusharth Saxsena", "Sharanya Achut", "Ankit Javalkar" - ] +__credits__ = [ + "Prabhu Ramachandran", + "Aditya P.", + "KhushalSingh Rajput", + "Prathamesh Salunke", + "Purusharth Saxsena", + "Sharanya Achut", + "Ankit Javalkar"] def makepath(proposal_data, reject=None): @@ -52,10 +57,9 @@ def makepath(proposal_data, reject=None): settings.MEDIA_ROOT, proposal_data.category.name, proposal_data.title.replace(" ", "_") )) - except: + except BaseException: logging.info("Proposal rejected") - else: makedirs(path.join(settings.MEDIA_ROOT, proposal_data.category.name, proposal_data.title.replace(" ", "_") @@ -65,7 +69,7 @@ def makepath(proposal_data, reject=None): def check_repo(link): try: return (get(link).status_code == 200) - except: + except BaseException: return False @@ -88,7 +92,9 @@ def index(request): categories = Category.objects.all() if user.is_authenticated() and is_email_checked(user): return redirect('/proposal_status/') - return render(request, "fossee_manim/index.html", {"categories": categories}) + return render(request, + "fossee_manim/index.html", + {"categories": categories}) def is_reviewer(user): @@ -119,8 +125,8 @@ def user_login(request): return render(request, 'fossee_manim/login.html', {"form": form}) else: form = UserLoginForm() - return render(request, 'fossee_manim/login.html', {"form": form, - 'categories': categories}) + return render(request, 'fossee_manim/login.html', + {"form": form, 'categories': categories}) def user_logout(request): @@ -154,7 +160,7 @@ def activate_user(request, key=None): try: user = Profile.objects.get(activation_key=key) - except: + except BaseException: return redirect('/register/') if key == user.activation_key: @@ -198,14 +204,18 @@ def user_register(request): elif request.user.is_authenticated(): return render(request, 'fossee_manim/activation.html') form = UserRegistrationForm() - return render(request, "fossee_manim/register.html", {'form': form, 'categories': categories}) + return render(request, "fossee_manim/register.html", + {'form': form, 'categories': categories}) def explore(request, category): categories = Category.objects.all() # not related to category below - videos = AnimationStats.objects.filter(animation__category__name=category, animation__status="released") + videos = AnimationStats.objects.filter( + animation__category__name=category, + animation__status="released") - return render(request, "fossee_manim/explore.html", {"videos": videos, "categories": categories}) + return render(request, "fossee_manim/explore.html", + {"videos": videos, "categories": categories}) @login_required @@ -225,7 +235,7 @@ def view_profile(request): try: logout(request) return redirect('/login/') - except: + except BaseException: return redirect('/register/') @@ -246,7 +256,7 @@ def edit_profile(request): try: logout(request) return redirect('/login/') - except: + except BaseException: return redirect('/register/') context = {'template': template} @@ -274,9 +284,8 @@ def edit_profile(request): return render(request, 'fossee_manim/edit_profile.html', context) else: form = ProfileForm(user=user, instance=profile) - return render(request, 'fossee_manim/edit_profile.html', {'form': form, - 'categories': categories} - ) + return render(request, 'fossee_manim/edit_profile.html', + {'form': form, 'categories': categories}) @login_required @@ -310,7 +319,8 @@ def proposal_status(request): profile = Profile.objects.get(user_id=user) categories = Category.objects.all() if profile.position == 'contributor': - animations = Animation.objects.filter(contributor_id=user).order_by('-created') + animations = Animation.objects.filter( + contributor_id=user).order_by('-created') else: animations = Animation.objects.order_by('-created') # print(animations) @@ -344,11 +354,12 @@ def sortproposal_released(request): categories = Category.objects.all() if profile.position == 'contributor': # filtering with the proposal status - animations = Animation.objects.filter(contributor_id=user, - status='released').order_by('-created') + animations = Animation.objects.filter( + contributor_id=user, status='released').order_by('-created') else: # filtering with the proposal status - animations = Animation.objects.filter(status='released').order_by('-created') + animations = Animation.objects.filter( + status='released').order_by('-created') # print(animations) # Show upto 9 proposals per page @@ -380,11 +391,12 @@ def sortproposal_rejected(request): categories = Category.objects.all() if profile.position == 'contributor': # filtering with the proposal status - animations = Animation.objects.filter(contributor_id=user, - status='rejected').order_by('-created') + animations = Animation.objects.filter( + contributor_id=user, status='rejected').order_by('-created') else: # filtering with the proposal status - animations = Animation.objects.filter(status='rejected').order_by('-created') + animations = Animation.objects.filter( + status='rejected').order_by('-created') # print(animations) # Show upto 9 proposals per page @@ -416,11 +428,12 @@ def sortproposal_changes(request): categories = Category.objects.all() if profile.position == 'contributor': # filtering with the proposal status - animations = Animation.objects.filter(contributor_id=user, - status='changes').order_by('-created') + animations = Animation.objects.filter( + contributor_id=user, status='changes').order_by('-created') else: # filtering with the proposal status - animations = Animation.objects.filter(status='changes').order_by('-created') + animations = Animation.objects.filter( + status='changes').order_by('-created') # print(animations) # Show upto 9 proposals per page @@ -452,11 +465,12 @@ def sortproposal_pending(request): categories = Category.objects.all() if profile.position == 'contributor': # filtering with the proposal status - animations = Animation.objects.filter(contributor_id=user, - status='pending').order_by('-created') + animations = Animation.objects.filter( + contributor_id=user, status='pending').order_by('-created') else: # filtering with the proposal status - animations = Animation.objects.filter(status='pending').order_by('-created') + animations = Animation.objects.filter( + status='pending').order_by('-created') # print(animations) # Show upto 9 proposals per page @@ -478,6 +492,7 @@ def sortproposal_pending(request): else: return redirect('/login/') + @login_required def edit_proposal(request, proposal_id=None): user = request.user @@ -489,14 +504,15 @@ def edit_proposal(request, proposal_id=None): categories = Category.objects.all() video = AnimationStats.objects.filter(animation=proposal_id) if len(video) > 0: - msg = ('Previously a video was uploaded for ' + video[0].animation.title) + msg = ( + 'Previously a video was uploaded for ' + + video[0].animation.title) else: msg = ('No video uploaded') try: - comments = Comment.objects.filter(animation_id=proposal_id).order_by( - '-created_date' - ) - except: + comments = Comment.objects.filter( + animation_id=proposal_id).order_by('-created_date') + except BaseException: comments = None if request.method == 'POST': text = request.POST.get('comment') @@ -536,7 +552,8 @@ def edit_proposal(request, proposal_id=None): proposal=proposal) form_data.save() return redirect('/edit_proposal/{}'.format(proposal_id)) - proposal_form = AnimationProposal_edit(request.POST, instance=proposal) + proposal_form = AnimationProposal_edit( + request.POST, instance=proposal) if proposal_form.is_valid(): p_f = proposal_form.save(commit=False) p_f.contributor = user @@ -578,7 +595,9 @@ def delete_proposal(request, proposal_id=None): if is_email_checked(user) and user.is_authenticated(): proposal = Animation.objects.get(id=proposal_id) - return render(request, 'fossee_manim/delete_proposal.html', {'proposal': proposal}) + return render(request, + 'fossee_manim/delete_proposal.html', + {'proposal': proposal}) else: return redirect('/register/') @@ -595,7 +614,8 @@ def delete_proposal_info(request, proposal_id=None): profile = Profile.objects.get(user_id=user) categories = Category.objects.all() if profile.position == 'contributor': - animations = Animation.objects.filter(contributor_id=user).order_by('-created') + animations = Animation.objects.filter( + contributor_id=user).order_by('-created') else: animations = Animation.objects.order_by('-created') paginator = Paginator(list(animations), 9) @@ -608,7 +628,8 @@ def delete_proposal_info(request, proposal_id=None): except EmptyPage: anime = paginator.page(paginator.num_pages) - return render(request, 'fossee_manim/proposal_status.html',{'anime': anime,'categories': categories}) + return render(request, 'fossee_manim/proposal_status.html', + {'anime': anime, 'categories': categories}) else: return redirect('/login/') @@ -618,14 +639,19 @@ def search(request): if request.method == 'POST': word = request.POST.get('sbox') anime_list = AnimationStats.objects.filter( - Q(animation__title__contains=word) | Q(animation__outline__contains=word) - | Q(animation__category__name__contains=word) | Q(animation__subcategory__contains=word), + Q( + animation__title__contains=word) | Q( + animation__outline__contains=word) | Q( + animation__category__name__contains=word) | Q( + animation__subcategory__contains=word), animation__status='released') return render(request, 'fossee_manim/search_results.html', {'s_result': anime_list, 'categories': categories}) # search results for proposal + + def search_proposal(request): user = request.user if is_email_checked(user) and user.is_authenticated(): @@ -651,6 +677,7 @@ def search_proposal(request): else: return redirect('/login/') + @login_required def upload_animation(request, proposal_id=None): user = request.user @@ -667,7 +694,7 @@ def upload_animation(request, proposal_id=None): anobj = anim.first() try: remove(anobj.thumbnail.path) - except: + except BaseException: pass remove(anobj.video_path.path) anobj.delete() @@ -678,7 +705,7 @@ def upload_animation(request, proposal_id=None): animation=proposal, video_path=request.FILES['video_path']) anobj._create_thumbnail() return render(request, 'fossee_manim/upload_success.html') - except: + except BaseException: messages.warning(request, 'Please Upload a valid File') return redirect('/edit_proposal/{}'.format(proposal_id)) @@ -698,7 +725,7 @@ def video(request, aid=None): video.update(like=F('like') + 1) anim_list = AnimationStats.objects.filter(animation__status="released") suggestion_list = [x for x in anim_list if ( - x.animation.category == video[0].animation.category)] + x.animation.category == video[0].animation.category)] reviewer_id = video[0].animation.reviewer.id comment_list = Comment.objects.filter(animation=video[0].animation) comments = [x for x in comment_list if x.animation_status not in @@ -741,44 +768,62 @@ def search_category(request, cat=None): def guidelines(request): categories = Category.objects.all() - return render(request, 'fossee_manim/guidelines.html', {'categories': categories}) + return render(request, + 'fossee_manim/guidelines.html', + {'categories': categories}) def about(request): categories = Category.objects.all() - return render(request, 'fossee_manim/about.html', {'categories': categories}) + return render(request, + 'fossee_manim/about.html', + {'categories': categories}) def honorarium(request): categories = Category.objects.all() - return render(request, 'fossee_manim/honorarium.html', {'categories': categories}) + return render(request, + 'fossee_manim/honorarium.html', + {'categories': categories}) def faqs(request): categories = Category.objects.all() - return render(request, 'fossee_manim/faqs.html', {'categories': categories}) + return render(request, + 'fossee_manim/faqs.html', + {'categories': categories}) def outreach(request): categories = Category.objects.all() - return render(request, 'fossee_manim/outreach.html', {'categories': categories}) + return render(request, + 'fossee_manim/outreach.html', + {'categories': categories}) def library(request): categories = Category.objects.all() - return render(request, 'fossee_manim/library.html', {'categories': categories}) + return render(request, + 'fossee_manim/library.html', + {'categories': categories}) def libraryMath(request): categories = Category.objects.all() - return render(request, 'fossee_manim/libraryMath.html', {'categories': categories}) + return render(request, + 'fossee_manim/libraryMath.html', + {'categories': categories}) def libraryPhys(request): categories = Category.objects.all() - return render(request, 'fossee_manim/libraryPhys.html', {'categories': categories}) + return render(request, + 'fossee_manim/libraryPhys.html', + {'categories': categories}) def libraryCS(request): categories = Category.objects.all() - return render(request, 'fossee_manim/libraryCS.html', {'categories': categories}) + return render(request, + 'fossee_manim/libraryCS.html', + {'categories': categories}) -- cgit From cfdc41deed280bddbcc6c3cf45e30f33ea139e88 Mon Sep 17 00:00:00 2001 From: Alwin1847207 Date: Mon, 28 Oct 2019 11:27:18 +0530 Subject: pep8 formatting --- fossee_manim/forms.py | 114 +++++++++++----------- fossee_manim/models.py | 134 +++++++++++++------------- fossee_manim/urls.py | 16 ++-- fossee_manim/views.py | 251 +++++++++++++++++++++++++++++-------------------- 4 files changed, 284 insertions(+), 231 deletions(-) diff --git a/fossee_manim/forms.py b/fossee_manim/forms.py index 1860bee..10be5b1 100644 --- a/fossee_manim/forms.py +++ b/fossee_manim/forms.py @@ -3,9 +3,9 @@ from django.utils import timezone from taggit.forms import TagWidget from .models import ( - Profile, User, Animation, - Comment, AnimationStats - ) + Profile, User, Animation, + Comment, AnimationStats +) from string import punctuation, digits try: from string import letters @@ -23,7 +23,7 @@ PWD_CHARS = letters + punctuation + digits position_choices = ( ("contributor", "Contributor"), ("reviewer", "Reviewer") - ) +) department_choices = ( ("computer", "Dept. of Computer Science/Engg."), @@ -38,7 +38,7 @@ department_choices = ( ("electronics", "Dept. of Electronics"), ("energy science and engineering", "Dept. of Energy Science and Engg"), ("others", "Others") - ) +) title = ( ("Professor", "Prof."), @@ -49,7 +49,7 @@ title = ( ("Mr", "Mr."), ("Mrs", "Mrs."), ("Miss", "Ms."), - ) +) source = ( ("FOSSEE Email", "FOSSEE Email"), @@ -58,46 +58,46 @@ source = ( ("Social Media", "Social Media"), ("From other College", "From other College"), ("others", "Others") - ) +) states = ( - ("IN-AP", "Andhra Pradesh"), - ("IN-AR", "Arunachal Pradesh"), - ("IN-AS", "Assam"), - ("IN-BR", "Bihar"), - ("IN-CT", "Chhattisgarh"), - ("IN-GA", "Goa"), - ("IN-GJ", "Gujarat"), - ("IN-HR", "Haryana"), - ("IN-HP", "Himachal Pradesh"), - ("IN-JK", "Jammu and Kashmir"), - ("IN-JH", "Jharkhand"), - ("IN-KA", "Karnataka"), - ("IN-KL", "Kerala"), - ("IN-MP", "Madhya Pradesh"), - ("IN-MH", "Maharashtra"), - ("IN-MN", "Manipur"), - ("IN-ML", "Meghalaya"), - ("IN-MZ", "Mizoram"), - ("IN-NL", "Nagaland"), - ("IN-OR", "Odisha"), - ("IN-PB", "Punjab"), - ("IN-RJ", "Rajasthan"), - ("IN-SK", "Sikkim"), - ("IN-TN", "Tamil Nadu"), - ("IN-TG", "Telangana"), - ("IN-TR", "Tripura"), - ("IN-UT", "Uttarakhand"), - ("IN-UP", "Uttar Pradesh"), - ("IN-WB", "West Bengal"), - ("IN-AN", "Andaman and Nicobar Islands"), - ("IN-CH", "Chandigarh"), - ("IN-DN", "Dadra and Nagar Haveli"), - ("IN-DD", "Daman and Diu"), - ("IN-DL", "Delhi"), - ("IN-LD", "Lakshadweep"), - ("IN-PY", "Puducherry") - ) + ("IN-AP", "Andhra Pradesh"), + ("IN-AR", "Arunachal Pradesh"), + ("IN-AS", "Assam"), + ("IN-BR", "Bihar"), + ("IN-CT", "Chhattisgarh"), + ("IN-GA", "Goa"), + ("IN-GJ", "Gujarat"), + ("IN-HR", "Haryana"), + ("IN-HP", "Himachal Pradesh"), + ("IN-JK", "Jammu and Kashmir"), + ("IN-JH", "Jharkhand"), + ("IN-KA", "Karnataka"), + ("IN-KL", "Kerala"), + ("IN-MP", "Madhya Pradesh"), + ("IN-MH", "Maharashtra"), + ("IN-MN", "Manipur"), + ("IN-ML", "Meghalaya"), + ("IN-MZ", "Mizoram"), + ("IN-NL", "Nagaland"), + ("IN-OR", "Odisha"), + ("IN-PB", "Punjab"), + ("IN-RJ", "Rajasthan"), + ("IN-SK", "Sikkim"), + ("IN-TN", "Tamil Nadu"), + ("IN-TG", "Telangana"), + ("IN-TR", "Tripura"), + ("IN-UT", "Uttarakhand"), + ("IN-UP", "Uttar Pradesh"), + ("IN-WB", "West Bengal"), + ("IN-AN", "Andaman and Nicobar Islands"), + ("IN-CH", "Chandigarh"), + ("IN-DN", "Dadra and Nagar Haveli"), + ("IN-DD", "Daman and Diu"), + ("IN-DL", "Delhi"), + ("IN-LD", "Lakshadweep"), + ("IN-PY", "Puducherry") +) def check_upper(uname): @@ -113,7 +113,8 @@ class UserRegistrationForm(forms.Form): a new user to the system""" required_css_class = 'required' errorlist_css_class = 'errorlist' - username = forms.CharField(max_length=32, help_text='''lowercase, letters, digits, + username = forms.CharField( + max_length=32, help_text='''lowercase, letters, digits, period and underscore only.''') email = forms.EmailField() password = forms.CharField(max_length=32, widget=forms.PasswordInput()) @@ -134,7 +135,9 @@ class UserRegistrationForm(forms.Form): department = forms.ChoiceField(help_text='Department you work/study', choices=department_choices) location = forms.CharField(max_length=255, help_text="Place/City") - pincode = forms.RegexField(regex=r'^.{6}$', error_messages={'invalid': "Please enter valid PINCODE"}) + pincode = forms.RegexField( + regex=r'^.{6}$', error_messages={ + 'invalid': "Please enter valid PINCODE"}) state = forms.ChoiceField(choices=states) how_did_you_hear_about_us = forms.ChoiceField(choices=source) @@ -215,11 +218,11 @@ class UserLoginForm(forms.Form): super(UserLoginForm, self).clean() try: u_name, pwd = self.cleaned_data["username"],\ - self.cleaned_data["password"] + self.cleaned_data["password"] user = authenticate(username=u_name, password=pwd) except Exception: - raise forms.ValidationError\ - ("Username and/or Password is not entered") + raise forms.ValidationError( + "Username and/or Password is not entered") if not user: raise forms.ValidationError("Invalid username/password") return user @@ -231,7 +234,7 @@ class ProfileForm(forms.ModelForm): class Meta: model = Profile fields = ['first_name', 'last_name', 'institute', 'department', - ] + ] first_name = forms.CharField(max_length=32) last_name = forms.CharField(max_length=32) @@ -255,13 +258,10 @@ class AnimationProposal(forms.ModelForm): # self.fields['outline'].widget.attrs['placeholder'] = 'NOTE: Do\ # add info about prerequisites (if any), possible textbooks and \ # any other related information' - self.fields['outline'].widget.attrs={ - 'id': 'custom_editor', - 'rows': 10, - 'cols': 50, - 'placeholder': ('NOTE: Do add info about prerequisites (if any), possible textbooks and ' - 'any other related information') - } + self.fields['outline'].widget.attrs = { + 'id': 'custom_editor', 'rows': 10, 'cols': 50, 'placeholder': ( + 'NOTE: Do add info about prerequisites (if any), possible textbooks and ' + 'any other related information')} class Meta: model = Animation diff --git a/fossee_manim/models.py b/fossee_manim/models.py index e49726e..21b2a3c 100644 --- a/fossee_manim/models.py +++ b/fossee_manim/models.py @@ -13,7 +13,7 @@ import subprocess position_choices = ( ("contributor", "Contributor"), ("reviewer", "Reviewer") - ) +) department_choices = ( ("computer", "Computers"), @@ -29,7 +29,7 @@ department_choices = ( ("electronics", "Electronics"), ("energy science and engineering", "Energy Science and Engineering"), ("others", "Others") - ) +) title = ( ("Professor", "Prof."), @@ -40,7 +40,7 @@ title = ( ("Mr", "Mr."), ("Mrs", "Mrs."), ("Miss", "Ms."), - ) +) source = ( ("FOSSEE website", "FOSSEE website"), @@ -48,46 +48,46 @@ source = ( ("Social Media", "Social Media"), ("From other College", "From other College"), ("others", "Others") - ) +) states = ( - ("IN-AP", "Andhra Pradesh"), - ("IN-AR", "Arunachal Pradesh"), - ("IN-AS", "Assam"), - ("IN-BR", "Bihar"), - ("IN-CT", "Chhattisgarh"), - ("IN-GA", "Goa"), - ("IN-GJ", "Gujarat"), - ("IN-HR", "Haryana"), - ("IN-HP", "Himachal Pradesh"), - ("IN-JK", "Jammu and Kashmir"), - ("IN-JH", "Jharkhand"), - ("IN-KA", "Karnataka"), - ("IN-KL", "Kerala"), - ("IN-MP", "Madhya Pradesh"), - ("IN-MH", "Maharashtra"), - ("IN-MN", "Manipur"), - ("IN-ML", "Meghalaya"), - ("IN-MZ", "Mizoram"), - ("IN-NL", "Nagaland"), - ("IN-OR", "Odisha"), - ("IN-PB", "Punjab"), - ("IN-RJ", "Rajasthan"), - ("IN-SK", "Sikkim"), - ("IN-TN", "Tamil Nadu"), - ("IN-TG", "Telangana"), - ("IN-TR", "Tripura"), - ("IN-UT", "Uttarakhand"), - ("IN-UP", "Uttar Pradesh"), - ("IN-WB", "West Bengal"), - ("IN-AN", "Andaman and Nicobar Islands"), - ("IN-CH", "Chandigarh"), - ("IN-DN", "Dadra and Nagar Haveli"), - ("IN-DD", "Daman and Diu"), - ("IN-DL", "Delhi"), - ("IN-LD", "Lakshadweep"), - ("IN-PY", "Puducherry") - ) + ("IN-AP", "Andhra Pradesh"), + ("IN-AR", "Arunachal Pradesh"), + ("IN-AS", "Assam"), + ("IN-BR", "Bihar"), + ("IN-CT", "Chhattisgarh"), + ("IN-GA", "Goa"), + ("IN-GJ", "Gujarat"), + ("IN-HR", "Haryana"), + ("IN-HP", "Himachal Pradesh"), + ("IN-JK", "Jammu and Kashmir"), + ("IN-JH", "Jharkhand"), + ("IN-KA", "Karnataka"), + ("IN-KL", "Kerala"), + ("IN-MP", "Madhya Pradesh"), + ("IN-MH", "Maharashtra"), + ("IN-MN", "Manipur"), + ("IN-ML", "Meghalaya"), + ("IN-MZ", "Mizoram"), + ("IN-NL", "Nagaland"), + ("IN-OR", "Odisha"), + ("IN-PB", "Punjab"), + ("IN-RJ", "Rajasthan"), + ("IN-SK", "Sikkim"), + ("IN-TN", "Tamil Nadu"), + ("IN-TG", "Telangana"), + ("IN-TR", "Tripura"), + ("IN-UT", "Uttarakhand"), + ("IN-UP", "Uttar Pradesh"), + ("IN-WB", "West Bengal"), + ("IN-AN", "Andaman and Nicobar Islands"), + ("IN-CH", "Chandigarh"), + ("IN-DN", "Dadra and Nagar Haveli"), + ("IN-DD", "Daman and Diu"), + ("IN-DL", "Delhi"), + ("IN-LD", "Lakshadweep"), + ("IN-PY", "Puducherry") +) status = ( ("pending", "Pending Acceptance"), @@ -107,6 +107,7 @@ def attachments(instance, filename): instance.animation.title, str(instance.animation.id), filename) + def validate_file_extension(value): import os from django.core.exceptions import ValidationError @@ -124,13 +125,13 @@ class Profile(models.Model): institute = models.CharField(max_length=150, blank=True) department = models.CharField(max_length=150, choices=department_choices) phone_number = models.CharField( - max_length=10, - validators=[RegexValidator( - regex=r'^.{10}$', message=( - "Phone number must be entered \ + max_length=10, + validators=[RegexValidator( + regex=r'^.{10}$', message=( + "Phone number must be entered \ in the format: '9999999999'.\ Up to 10 digits allowed.") - )], null=False) + )], null=False) position = models.CharField(max_length=32, choices=position_choices, default='contributor') how_did_you_hear_about_us = models.CharField(max_length=255, blank=True, @@ -140,21 +141,21 @@ class Profile(models.Model): state = models.CharField(max_length=255, choices=states, default="IN-MH") pincode = models.CharField(max_length=6, blank=True, validators=[RegexValidator( - regex=r'^.{6}$', message=( - "Please enter valid PINCODE" - ) - )]) + regex=r'^.{6}$', message=( + "Please enter valid PINCODE" + ) + )]) is_email_verified = models.BooleanField(default=False) activation_key = models.CharField(max_length=255, blank=True, null=True) key_expiry_time = models.DateTimeField(blank=True, null=True) def __str__(self): return u"id: {0}| {1} {2} | {3} ".format( - self.user.id, - self.user.first_name, - self.user.last_name, - self.user.email - ) + self.user.id, + self.user.first_name, + self.user.last_name, + self.user.email + ) class Category(models.Model): @@ -175,8 +176,11 @@ class Example(models.Model): class Animation(models.Model): title = models.CharField(max_length=255) contributor = models.ForeignKey(User, on_delete=models.CASCADE) - reviewer = models.ForeignKey(User, null=True, on_delete=models.CASCADE, - related_name="%(app_label)s_%(class)s_related") + reviewer = models.ForeignKey( + User, + null=True, + on_delete=models.CASCADE, + related_name="%(app_label)s_%(class)s_related") outline = models.TextField() status = models.CharField(max_length=255, choices=status) category = models.ForeignKey(Category, on_delete=models.CASCADE) @@ -209,16 +213,20 @@ class AnimationStats(models.Model): like = models.PositiveIntegerField(default=0) dislike = models.PositiveIntegerField(default=0) thumbnail = models.ImageField(null=True, blank=True, upload_to=attachments) - video_path = models.FileField(null=True, blank=True, upload_to=attachments, validators=[validate_file_extension]) + video_path = models.FileField( + null=True, + blank=True, + upload_to=attachments, + validators=[validate_file_extension]) def _create_thumbnail(self): video_path = self.video_path.path img_output = path.join( - tempfile.mkdtemp(), "{0}.jpg".format(self.animation.title) - ) + tempfile.mkdtemp(), "{0}.jpg".format(self.animation.title) + ) file_name = "{0}.jpg".format(self.animation.title) subprocess.call(['ffmpeg', '-i', video_path, '-ss', '00:00:02.000', - '-vframes', '1', img_output]) + '-vframes', '1', img_output]) if path.exists(img_output): que_file = open(img_output, 'rb') # Converting to Python file object with @@ -229,8 +237,8 @@ class AnimationStats(models.Model): def _create_ogv(self): video_input = self.video_path.path vid_output = path.join( - tempfile.mkdtemp(), "{0}.ogv".format(self.animation.title) - ) + tempfile.mkdtemp(), "{0}.ogv".format(self.animation.title) + ) file_name = "{0}.ogv".format(self.animation.title) subprocess.call(['ffmpeg', '-i', video_input, '-r', '24', vid_output]) if path.exists(vid_output): diff --git a/fossee_manim/urls.py b/fossee_manim/urls.py index dac61e2..a9af19e 100644 --- a/fossee_manim/urls.py +++ b/fossee_manim/urls.py @@ -26,17 +26,17 @@ urlpatterns = [ url(r'^faqs/$', views.faqs, name='faqs'), url(r'^search_category/(?P.+)$', views.search_category, name='search_category'), - url(r'^about/$',views.about, name='about'), - url(r'^outreach/$',views.outreach, name='outreach'), - url(r'^library/$',views.library, name='library'), - url(r'^libraryMath/$',views.libraryMath, name='libraryMath'), - url(r'^libraryPhys/$',views.libraryPhys, name='libraryPhys'), - url(r'^libraryCS/$',views.libraryCS, name='libraryCS'), + url(r'^about/$', views.about, name='about'), + url(r'^outreach/$', views.outreach, name='outreach'), + url(r'^library/$', views.library, name='library'), + url(r'^libraryMath/$', views.libraryMath, name='libraryMath'), + url(r'^libraryPhys/$', views.libraryPhys, name='libraryPhys'), + url(r'^libraryCS/$', views.libraryCS, name='libraryCS'), url(r'^explore/(?P.+)$', views.explore, name='explore'), ] urlpatterns += static( - settings.MEDIA_URL, - document_root=settings.MEDIA_ROOT + settings.MEDIA_URL, + document_root=settings.MEDIA_ROOT ) diff --git a/fossee_manim/views.py b/fossee_manim/views.py index 3732ce7..4f3cf44 100644 --- a/fossee_manim/views.py +++ b/fossee_manim/views.py @@ -1,14 +1,14 @@ from os import listdir, path, sep, makedirs, remove from .forms import ( - UserRegistrationForm, UserLoginForm, - ProfileForm, AnimationProposal, - CommentForm, UploadAnimationForm - ) + UserRegistrationForm, UserLoginForm, + ProfileForm, AnimationProposal, + CommentForm, UploadAnimationForm +) from .models import ( - Profile, User, AnimationStats, - has_profile, Animation, Comment, - Category - ) + Profile, User, AnimationStats, + has_profile, Animation, Comment, + Category +) from datetime import datetime, date from django.contrib.auth import login, logout, authenticate from django.contrib.auth.decorators import login_required @@ -34,38 +34,44 @@ except ImportError: from io import BytesIO as string_io __author__ = "Akshen Doke" -__credits__ = ["Prabhu Ramachandran", "Aditya P.", "KhushalSingh Rajput", - "Prathamesh Salunke", "Purusharth Saxsena", "Sharanya Achut", "Ankit Javalkar" - ] +__credits__ = [ + "Prabhu Ramachandran", + "Aditya P.", + "KhushalSingh Rajput", + "Prathamesh Salunke", + "Purusharth Saxsena", + "Sharanya Achut", + "Ankit Javalkar"] + def makepath(proposal_data, reject=None): if not path.exists(path.join(settings.MEDIA_ROOT, - proposal_data.category.name)): + proposal_data.category.name)): makedirs(path.join(settings.MEDIA_ROOT, - proposal_data.category.name)) + proposal_data.category.name)) if reject: try: shutil.rmtree(path.join( - settings.MEDIA_ROOT, proposal_data.category.name, - proposal_data.title.replace(" ", "_") - )) - except: + settings.MEDIA_ROOT, proposal_data.category.name, + proposal_data.title.replace(" ", "_") + )) + except BaseException: logging.info("Proposal rejected") - else: makedirs(path.join(settings.MEDIA_ROOT, proposal_data.category.name, - proposal_data.title.replace(" ", "_") - )) + proposal_data.title.replace(" ", "_") + )) def check_repo(link): try: return (get(link).status_code == 200) - except: + except BaseException: return False + def is_email_checked(user): if hasattr(user, 'profile'): return True if user.profile.is_email_verified else False @@ -85,7 +91,9 @@ def index(request): categories = Category.objects.all() if user.is_authenticated() and is_email_checked(user): return redirect('/proposal_status/') - return render(request, "fossee_manim/index.html", {"categories": categories}) + return render(request, + "fossee_manim/index.html", + {"categories": categories}) def is_reviewer(user): @@ -116,8 +124,8 @@ def user_login(request): return render(request, 'fossee_manim/login.html', {"form": form}) else: form = UserLoginForm() - return render(request, 'fossee_manim/login.html', {"form": form, - 'categories': categories }) + return render(request, 'fossee_manim/login.html', + {"form": form, 'categories': categories}) def user_logout(request): @@ -125,7 +133,7 @@ def user_logout(request): categories = Category.objects.all() logout(request) return render(request, 'fossee_manim/logout.html', - {'categories': categories }) + {'categories': categories}) def activate_user(request, key=None): @@ -133,25 +141,25 @@ def activate_user(request, key=None): if is_superuser(user): return redirect("/admin") if key is None: - if user.is_authenticated() and user.profile.is_email_verified==0 and \ - timezone.now() > user.profile.key_expiry_time: + if user.is_authenticated() and user.profile.is_email_verified == 0 and \ + timezone.now() > user.profile.key_expiry_time: status = "1" Profile.objects.get(user_id=user.profile.user_id).delete() User.objects.get(id=user.profile.user_id).delete() return render(request, 'fossee_manim/activation.html', - {'status':status}) - elif user.is_authenticated() and user.profile.is_email_verified==0: + {'status': status}) + elif user.is_authenticated() and user.profile.is_email_verified == 0: return render(request, 'fossee_manim/activation.html') elif user.is_authenticated() and user.profile.is_email_verified: status = "2" return render(request, 'fossee_manim/activation.html', - {'status':status}) + {'status': status}) else: return redirect('/register/') try: user = Profile.objects.get(activation_key=key) - except: + except BaseException: return redirect('/register/') if key == user.activation_key: @@ -162,7 +170,7 @@ def activate_user(request, key=None): logout(request) return redirect('/logout/') return render(request, 'fossee_manim/activation.html', - {"status": status}) + {"status": status}) def user_register(request): @@ -176,9 +184,9 @@ def user_register(request): login(request, new_user) user_position = request.user.profile.position send_email( - request, call_on='Registration', - key=key - ) + request, call_on='Registration', + key=key + ) return render(request, 'fossee_manim/activation.html') else: @@ -195,14 +203,19 @@ def user_register(request): elif request.user.is_authenticated(): return render(request, 'fossee_manim/activation.html') form = UserRegistrationForm() - return render(request, "fossee_manim/register.html", {'form': form, 'categories': categories}) + return render(request, "fossee_manim/register.html", + {'form': form, 'categories': categories}) def explore(request, category): - categories = Category.objects.all() #not related to category below - videos = AnimationStats.objects.filter(animation__category__name= category , animation__status="released") + categories = Category.objects.all() # not related to category below + videos = AnimationStats.objects.filter( + animation__category__name=category, + animation__status="released") + + return render(request, "fossee_manim/explore.html", + {"videos": videos, "categories": categories}) - return render(request, "fossee_manim/explore.html", {"videos": videos, "categories": categories}) @login_required def view_profile(request): @@ -221,7 +234,7 @@ def view_profile(request): try: logout(request) return redirect('/login/') - except: + except BaseException: return redirect('/register/') @@ -242,7 +255,7 @@ def edit_profile(request): try: logout(request) return redirect('/login/') - except: + except BaseException: return redirect('/register/') context = {'template': template} @@ -262,17 +275,16 @@ def edit_profile(request): form_data.save() return render( - request, 'fossee_manim/profile_updated.html', - {'categories': categories} - ) + request, 'fossee_manim/profile_updated.html', + {'categories': categories} + ) else: context['form'] = form return render(request, 'fossee_manim/edit_profile.html', context) else: form = ProfileForm(user=user, instance=profile) - return render(request, 'fossee_manim/edit_profile.html', {'form': form, - 'categories': categories} - ) + return render(request, 'fossee_manim/edit_profile.html', + {'form': form, 'categories': categories}) @login_required @@ -289,12 +301,12 @@ def send_proposal(request): form.save() else: return render(request, 'fossee_manim/send_proposal.html', - {'form': form, 'categories': categories}) + {'form': form, 'categories': categories}) return redirect('/proposal_status/') else: form = AnimationProposal() return render(request, 'fossee_manim/send_proposal.html', - {'form': form, 'categories': categories}) + {'form': form, 'categories': categories}) else: return redirect('/register/') @@ -306,7 +318,8 @@ def proposal_status(request): profile = Profile.objects.get(user_id=user) categories = Category.objects.all() if profile.position == 'contributor': - animations = Animation.objects.filter(contributor_id=user).order_by('-created') + animations = Animation.objects.filter( + contributor_id=user).order_by('-created') else: animations = Animation.objects.order_by('-created') # print(animations) @@ -315,18 +328,18 @@ def proposal_status(request): paginator = Paginator(list(animations), 9) page = request.GET.get('page') try: - anime = paginator.page(page) + anime = paginator.page(page) print(animations.count(), anime) except PageNotAnInteger: # If page is not an integer, deliver first page. - anime = paginator.page(1) + anime = paginator.page(1) except EmptyPage: # If page is out of range(e.g 999999), deliver last page. - anime = paginator.page(paginator.num_pages) + anime = paginator.page(paginator.num_pages) return render(request, 'fossee_manim/proposal_status.html', - {'anime': anime, - 'categories': categories}) + {'anime': anime, + 'categories': categories}) else: return redirect('/login/') @@ -341,15 +354,16 @@ def edit_proposal(request, proposal_id=None): upload_form = UploadAnimationForm() categories = Category.objects.all() video = AnimationStats.objects.filter(animation=proposal_id) - if len(video)>0: - msg = ('Previously a video was uploaded for '+ video[0].animation.title) + if len(video) > 0: + msg = ( + 'Previously a video was uploaded for ' + + video[0].animation.title) else: msg = ('No video uploaded') try: - comments = Comment.objects.filter(animation_id=proposal_id).order_by( - '-created_date' - ) - except: + comments = Comment.objects.filter( + animation_id=proposal_id).order_by('-created_date') + except BaseException: comments = None if request.method == 'POST': text = request.POST.get('comment') @@ -361,16 +375,16 @@ def edit_proposal(request, proposal_id=None): if status1: proposal.status = 'released' send_email(request, call_on='released', - contributor=proposal.contributor) + contributor=proposal.contributor) elif status3: send_email(request, call_on='proposal_form', - contributor=proposal.contributor) + contributor=proposal.contributor) return redirect('/proposal_status/') else: proposal.status = 'rejected' makepath(proposal, reject=1) send_email(request, call_on='rejected', - contributor=proposal.contributor) + contributor=proposal.contributor) proposal.reviewer = user proposal.save() return redirect('/proposal_status/') @@ -385,8 +399,8 @@ def edit_proposal(request, proposal_id=None): proposal.status = 'changes' proposal.save() send_email(request, call_on='changes', - contributor=proposal.contributor, - proposal=proposal) + contributor=proposal.contributor, + proposal=proposal) form_data.save() return redirect('/edit_proposal/{}'.format(proposal_id)) proposal_form = AnimationProposal(request.POST, instance=proposal) @@ -403,25 +417,25 @@ def edit_proposal(request, proposal_id=None): return redirect('/register/') if comments is not None: - #Show upto 12 Workshops per page - paginator = Paginator(comments, 9) - page = request.GET.get('page') - try: - comments = paginator.page(page) - except PageNotAnInteger: - #If page is not an integer, deliver first page. - comments = paginator.page(1) - except EmptyPage: - #If page is out of range(e.g 999999), deliver last page. - comments = paginator.page(paginator.num_pages) + # Show upto 12 Workshops per page + paginator = Paginator(comments, 9) + page = request.GET.get('page') + try: + comments = paginator.page(page) + except PageNotAnInteger: + # If page is not an integer, deliver first page. + comments = paginator.page(1) + except EmptyPage: + # If page is out of range(e.g 999999), deliver last page. + comments = paginator.page(paginator.num_pages) return render(request, 'fossee_manim/edit_proposal.html', - {'proposal_form': proposal_form, - "comments": comments, - "comment_form": comment_form, - "upload_form": upload_form, - 'video': video, - 'categories': categories, - 'msg': msg}) + {'proposal_form': proposal_form, + "comments": comments, + "comment_form": comment_form, + "upload_form": upload_form, + 'video': video, + 'categories': categories, + 'msg': msg}) def search(request): @@ -429,8 +443,11 @@ def search(request): if request.method == 'POST': word = request.POST.get('sbox') anime_list = AnimationStats.objects.filter( - Q(animation__title__contains=word) | Q(animation__outline__contains=word) - | Q(animation__category__name__contains=word) | Q(animation__subcategory__contains=word), + Q( + animation__title__contains=word) | Q( + animation__outline__contains=word) | Q( + animation__category__name__contains=word) | Q( + animation__subcategory__contains=word), animation__status='released') return render(request, 'fossee_manim/search_results.html', @@ -444,16 +461,16 @@ def upload_animation(request, proposal_id=None): if request.method == 'POST': proposal = Animation.objects.get(id=proposal_id) anim_stats = UploadAnimationForm(request.POST or None, - request.FILES or None) + request.FILES or None) if anim_stats.is_valid(): try: anim = AnimationStats.objects.filter( - animation=proposal) + animation=proposal) if anim.exists(): anobj = anim.first() try: remove(anobj.thumbnail.path) - except: + except BaseException: pass remove(anobj.video_path.path) anobj.delete() @@ -464,7 +481,7 @@ def upload_animation(request, proposal_id=None): animation=proposal, video_path=request.FILES['video_path']) anobj._create_thumbnail() return render(request, 'fossee_manim/upload_success.html') - except: + except BaseException: messages.warning(request, 'Please Upload a valid File') return redirect('/edit_proposal/{}'.format(proposal_id)) @@ -480,15 +497,15 @@ def video(request, aid=None): if len(video): comment_form = CommentForm() # if views crosses limit comment the line below - video.update(views=F('views')+1) - video.update(like=F('like')+1) + video.update(views=F('views') + 1) + video.update(like=F('like') + 1) anim_list = AnimationStats.objects.filter(animation__status="released") suggestion_list = [x for x in anim_list if ( x.animation.category == video[0].animation.category)] reviewer_id = video[0].animation.reviewer.id comment_list = Comment.objects.filter(animation=video[0].animation) comments = [x for x in comment_list if x.animation_status not in - ('pending', 'changes')] + ('pending', 'changes')] if request.method == 'POST': if is_email_checked(user): comment_form = CommentForm(request.POST) @@ -503,7 +520,7 @@ def video(request, aid=None): else: return redirect('/view_profile/') - if len(suggestion_list)>3: + if len(suggestion_list) > 3: suggestion_list = sample(suggestion_list, 3) else: suggestion_list = [x for x in anim_list if x.id != int(aid)][:3] @@ -527,34 +544,62 @@ def search_category(request, cat=None): def guidelines(request): categories = Category.objects.all() - return render(request, 'fossee_manim/guidelines.html', {'categories': categories}) + return render(request, + 'fossee_manim/guidelines.html', + {'categories': categories}) + def about(request): categories = Category.objects.all() - return render(request, 'fossee_manim/about.html', {'categories': categories}) + return render(request, + 'fossee_manim/about.html', + {'categories': categories}) + def honorarium(request): categories = Category.objects.all() - return render(request, 'fossee_manim/honorarium.html', {'categories': categories}) + return render(request, + 'fossee_manim/honorarium.html', + {'categories': categories}) + def faqs(request): categories = Category.objects.all() - return render(request, 'fossee_manim/faqs.html', {'categories': categories}) + return render(request, + 'fossee_manim/faqs.html', + {'categories': categories}) + def outreach(request): categories = Category.objects.all() - return render(request, 'fossee_manim/outreach.html', {'categories': categories}) + return render(request, + 'fossee_manim/outreach.html', + {'categories': categories}) + def library(request): categories = Category.objects.all() - return render(request, 'fossee_manim/library.html', {'categories': categories}) + return render(request, + 'fossee_manim/library.html', + {'categories': categories}) + def libraryMath(request): categories = Category.objects.all() - return render(request, 'fossee_manim/libraryMath.html', {'categories': categories}) + return render(request, + 'fossee_manim/libraryMath.html', + {'categories': categories}) + + def libraryPhys(request): categories = Category.objects.all() - return render(request, 'fossee_manim/libraryPhys.html', {'categories': categories}) + return render(request, + 'fossee_manim/libraryPhys.html', + {'categories': categories}) + + def libraryCS(request): categories = Category.objects.all() - return render(request, 'fossee_manim/libraryCS.html', {'categories': categories}) + return render(request, + 'fossee_manim/libraryCS.html', + {'categories': categories}) -- cgit From 9a63fcaff0974fa6401d48c5dae53782f50c4ddc Mon Sep 17 00:00:00 2001 From: Alwin1847207 Date: Mon, 4 Nov 2019 16:41:44 +0530 Subject: changes --- .idea/dataSources.local.xml | 17 + .../c2ec2b16-9a8a-4975-be60-2a0417af82c8.xml | 954 +++++++++++++++++++++ .idea/workspace.xml | 95 ++ 3 files changed, 1066 insertions(+) create mode 100644 .idea/dataSources.local.xml create mode 100644 .idea/dataSources/c2ec2b16-9a8a-4975-be60-2a0417af82c8.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml new file mode 100644 index 0000000..d91079c --- /dev/null +++ b/.idea/dataSources.local.xml @@ -0,0 +1,17 @@ + + + + + + " + + + false + + + + + + + + \ No newline at end of file diff --git a/.idea/dataSources/c2ec2b16-9a8a-4975-be60-2a0417af82c8.xml b/.idea/dataSources/c2ec2b16-9a8a-4975-be60-2a0417af82c8.xml new file mode 100644 index 0000000..766dfa4 --- /dev/null +++ b/.idea/dataSources/c2ec2b16-9a8a-4975-be60-2a0417af82c8.xml @@ -0,0 +1,954 @@ + + + + + 3.25.1 + + + 1 + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1 +
+ + 1 +
+ +
+ + 1 + integer|0s + 1 + 1 + + + 2 + varchar(80)|0s + 1 + + + 1 + name + + 1 + + + id + 1 + + + name + sqlite_autoindex_auth_group_1 + + + 1 + integer|0s + 1 + 1 + + + 2 + integer|0s + 1 + + + 3 + integer|0s + 1 + + + group_id +permission_id + + 1 + + + group_id + + + + permission_id + + + + id + 1 + + + group_id + auth_group + id + + + permission_id + auth_permission__old + id + + + 1 + integer|0s + 1 + 1 + + + 2 + integer|0s + 1 + + + 3 + varchar(100)|0s + 1 + + + 4 + varchar(255)|0s + 1 + + + content_type_id +codename + + 1 + + + content_type_id + + + + id + 1 + + + content_type_id + django_content_type + id + + + 1 + integer|0s + 1 + 1 + + + 2 + varchar(128)|0s + 1 + + + 3 + datetime|0s + + + 4 + bool|0s + 1 + + + 5 + varchar(30)|0s + 1 + + + 6 + varchar(30)|0s + 1 + + + 7 + varchar(254)|0s + 1 + + + 8 + bool|0s + 1 + + + 9 + bool|0s + 1 + + + 10 + datetime|0s + 1 + + + 11 + varchar(150)|0s + 1 + + + 1 + username + + 1 + + + id + 1 + + + username + sqlite_autoindex_auth_user_1 + + + 1 + integer|0s + 1 + 1 + + + 2 + integer|0s + 1 + + + 3 + integer|0s + 1 + + + user_id +group_id + + 1 + + + user_id + + + + group_id + + + + id + 1 + + + user_id + auth_user__old + id + + + group_id + auth_group + id + + + 1 + integer|0s + 1 + 1 + + + 2 + integer|0s + 1 + + + 3 + integer|0s + 1 + + + user_id +permission_id + + 1 + + + user_id + + + + permission_id + + + + id + 1 + + + user_id + auth_user__old + id + + + permission_id + auth_permission__old + id + + + 1 + integer|0s + 1 + 1 + + + 2 + text|0s + + + 3 + varchar(200)|0s + 1 + + + 4 + smallint unsigned|0s + 1 + + + 5 + text|0s + 1 + + + 6 + integer|0s + + + 7 + integer|0s + 1 + + + 8 + datetime|0s + 1 + + + content_type_id + + + + user_id + + + + id + 1 + + + content_type_id + django_content_type__old + id + + + user_id + auth_user__old + id + + + 1 + integer|0s + 1 + 1 + + + 2 + varchar(100)|0s + 1 + + + 3 + varchar(100)|0s + 1 + + + app_label +model + + 1 + + + id + 1 + + + 1 + integer|0s + 1 + 1 + + + 2 + varchar(255)|0s + 1 + + + 3 + varchar(255)|0s + 1 + + + 4 + datetime|0s + 1 + + + id + 1 + + + 1 + varchar(40)|0s + 1 + + + 2 + text|0s + 1 + + + 3 + datetime|0s + 1 + + + 1 + session_key + + 1 + + + expire_date + + + + session_key + 1 + sqlite_autoindex_django_session_1 + + + 1 + integer|0s + 1 + 1 + + + 2 + varchar(255)|0s + 1 + + + 3 + varchar(255)|0s + 1 + + + 4 + varchar(255)|0s + 1 + + + 5 + datetime|0s + 1 + + + 6 + integer|0s + 1 + + + 7 + integer|0s + 1 + + + 8 + integer|0s + + + 9 + text|0s + 1 + + + category_id + + + + contributor_id + + + + reviewer_id + + + + id + 1 + + + category_id + fossee_manim_category + id + + + contributor_id + auth_user + id + + + reviewer_id + auth_user + id + + + 1 + integer|0s + 1 + 1 + + + 2 + integer unsigned|0s + 1 + + + 3 + integer unsigned|0s + 1 + + + 4 + integer unsigned|0s + 1 + + + 5 + varchar(100)|0s + + + 6 + varchar(100)|0s + + + 7 + integer|0s + 1 + + + id + 1 + + + animation_id + fossee_manim_animation__old + id + + + 1 + integer|0s + 1 + 1 + + + 2 + varchar(255)|0s + 1 + + + 3 + datetime|0s + 1 + + + 4 + text|0s + 1 + + + 1 + name + + 1 + + + id + 1 + + + name + sqlite_autoindex_fossee_manim_category_1 + + + 1 + integer|0s + 1 + 1 + + + 2 + text|0s + 1 + + + 3 + datetime|0s + 1 + + + 4 + varchar(255)|0s + 1 + + + 5 + integer|0s + 1 + + + 6 + integer|0s + 1 + + + animation_id + + + + commentor_id + + + + id + 1 + + + animation_id + fossee_manim_animation__old + id + + + commentor_id + auth_user + id + + + 1 + integer|0s + 1 + + + 2 + varchar(255)|0s + 1 + + + 3 + varchar(255)|0s + 1 + + + 4 + varchar(255)|0s + 1 + + + 5 + datetime|0s + 1 + + + 6 + integer|0s + 1 + 1 + + + 7 + datetime|0s + 1 + + + 8 + varchar(100)|0s + + + 9 + varchar(1)|0s + 1 + + + 10 + integer|0s + + + 11 + integer|0s + + + 12 + integer|0s + + + 13 + integer|0s + + + 14 + text|0s + 1 + + + id + + + + category_id + + + + contributor_id + + + + history_user_id + + + + reviewer_id + + + + history_id + 1 + + + history_user_id + auth_user + id + + + 1 + integer|0s + 1 + 1 + + + 2 + varchar(32)|0s + 1 + + + 3 + varchar(150)|0s + 1 + + + 4 + varchar(150)|0s + 1 + + + 5 + varchar(10)|0s + 1 + + + 6 + varchar(32)|0s + 1 + + + 7 + varchar(255)|0s + 1 + + + 8 + varchar(255)|0s + 1 + + + 9 + varchar(255)|0s + 1 + + + 10 + varchar(6)|0s + 1 + + + 11 + bool|0s + 1 + + + 12 + varchar(255)|0s + + + 13 + datetime|0s + + + 14 + integer|0s + 1 + + + 1 + user_id + + 1 + + + id + 1 + + + user_id + sqlite_autoindex_fossee_manim_profile_1 + + + user_id + auth_user + id + + + 1 + text|0s + + + 2 + text|0s + + + 3 + text|0s + + + 4 + int|0s + + + 5 + text|0s + + + 1 + + + 2 + + + 1 + integer|0s + 1 + 1 + + + 2 + varchar(100)|0s + 1 + + + 3 + varchar(100)|0s + 1 + + + 1 + name + + 1 + + + 1 + slug + + 1 + + + id + 1 + + + name + sqlite_autoindex_taggit_tag_1 + + + slug + sqlite_autoindex_taggit_tag_2 + + + 1 + integer|0s + 1 + 1 + + + 2 + integer|0s + 1 + + + 3 + integer|0s + 1 + + + 4 + integer|0s + 1 + + + object_id + + + + content_type_id +object_id + + + + content_type_id + + + + tag_id + + + + id + 1 + + + content_type_id + django_content_type + id + + + tag_id + taggit_tag + id + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..626182e --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1570091761379 + + + + + + + + + \ No newline at end of file -- cgit From 6c741569e8ef73fe1e8773419f241891dd69a1ad Mon Sep 17 00:00:00 2001 From: Alwin1847207 Date: Mon, 4 Nov 2019 17:26:27 +0530 Subject: removed merge conflicts --- fossee_manim/forms.py | 190 ++++++++++++++------- fossee_manim/templates/fossee_manim/base.html | 20 --- fossee_manim/templates/fossee_manim/index.html | 15 -- fossee_manim/templates/fossee_manim/logout.html | 12 +- .../templates/fossee_manim/proposal_status.html | 114 +++++++------ fossee_manim/urls.py | 11 +- fossee_manim/views.py | 2 +- 7 files changed, 202 insertions(+), 162 deletions(-) diff --git a/fossee_manim/forms.py b/fossee_manim/forms.py index b7555fc..7cc1971 100644 --- a/fossee_manim/forms.py +++ b/fossee_manim/forms.py @@ -1,11 +1,9 @@ from django import forms from django.utils import timezone -from taggit.forms import TagWidget - from .models import ( - Profile, User, Animation, - Comment, AnimationStats -) + Profile, User, Animation, + Comment, AnimationStats + ) from string import punctuation, digits try: from string import letters @@ -23,7 +21,7 @@ PWD_CHARS = letters + punctuation + digits position_choices = ( ("contributor", "Contributor"), ("reviewer", "Reviewer") -) + ) department_choices = ( ("computer", "Dept. of Computer Science/Engg."), @@ -38,7 +36,7 @@ department_choices = ( ("electronics", "Dept. of Electronics"), ("energy science and engineering", "Dept. of Energy Science and Engg"), ("others", "Others") -) + ) title = ( ("Professor", "Prof."), @@ -49,7 +47,7 @@ title = ( ("Mr", "Mr."), ("Mrs", "Mrs."), ("Miss", "Ms."), -) + ) source = ( ("FOSSEE Email", "FOSSEE Email"), @@ -58,46 +56,46 @@ source = ( ("Social Media", "Social Media"), ("From other College", "From other College"), ("others", "Others") -) + ) states = ( - ("IN-AP", "Andhra Pradesh"), - ("IN-AR", "Arunachal Pradesh"), - ("IN-AS", "Assam"), - ("IN-BR", "Bihar"), - ("IN-CT", "Chhattisgarh"), - ("IN-GA", "Goa"), - ("IN-GJ", "Gujarat"), - ("IN-HR", "Haryana"), - ("IN-HP", "Himachal Pradesh"), - ("IN-JK", "Jammu and Kashmir"), - ("IN-JH", "Jharkhand"), - ("IN-KA", "Karnataka"), - ("IN-KL", "Kerala"), - ("IN-MP", "Madhya Pradesh"), - ("IN-MH", "Maharashtra"), - ("IN-MN", "Manipur"), - ("IN-ML", "Meghalaya"), - ("IN-MZ", "Mizoram"), - ("IN-NL", "Nagaland"), - ("IN-OR", "Odisha"), - ("IN-PB", "Punjab"), - ("IN-RJ", "Rajasthan"), - ("IN-SK", "Sikkim"), - ("IN-TN", "Tamil Nadu"), - ("IN-TG", "Telangana"), - ("IN-TR", "Tripura"), - ("IN-UT", "Uttarakhand"), - ("IN-UP", "Uttar Pradesh"), - ("IN-WB", "West Bengal"), - ("IN-AN", "Andaman and Nicobar Islands"), - ("IN-CH", "Chandigarh"), - ("IN-DN", "Dadra and Nagar Haveli"), - ("IN-DD", "Daman and Diu"), - ("IN-DL", "Delhi"), - ("IN-LD", "Lakshadweep"), - ("IN-PY", "Puducherry") -) + ("IN-AP", "Andhra Pradesh"), + ("IN-AR", "Arunachal Pradesh"), + ("IN-AS", "Assam"), + ("IN-BR", "Bihar"), + ("IN-CT", "Chhattisgarh"), + ("IN-GA", "Goa"), + ("IN-GJ", "Gujarat"), + ("IN-HR", "Haryana"), + ("IN-HP", "Himachal Pradesh"), + ("IN-JK", "Jammu and Kashmir"), + ("IN-JH", "Jharkhand"), + ("IN-KA", "Karnataka"), + ("IN-KL", "Kerala"), + ("IN-MP", "Madhya Pradesh"), + ("IN-MH", "Maharashtra"), + ("IN-MN", "Manipur"), + ("IN-ML", "Meghalaya"), + ("IN-MZ", "Mizoram"), + ("IN-NL", "Nagaland"), + ("IN-OR", "Odisha"), + ("IN-PB", "Punjab"), + ("IN-RJ", "Rajasthan"), + ("IN-SK", "Sikkim"), + ("IN-TN", "Tamil Nadu"), + ("IN-TG", "Telangana"), + ("IN-TR", "Tripura"), + ("IN-UT", "Uttarakhand"), + ("IN-UP", "Uttar Pradesh"), + ("IN-WB", "West Bengal"), + ("IN-AN", "Andaman and Nicobar Islands"), + ("IN-CH", "Chandigarh"), + ("IN-DN", "Dadra and Nagar Haveli"), + ("IN-DD", "Daman and Diu"), + ("IN-DL", "Delhi"), + ("IN-LD", "Lakshadweep"), + ("IN-PY", "Puducherry") + ) def check_upper(uname): @@ -113,8 +111,7 @@ class UserRegistrationForm(forms.Form): a new user to the system""" required_css_class = 'required' errorlist_css_class = 'errorlist' - username = forms.CharField( - max_length=32, help_text='''lowercase, letters, digits, + username = forms.CharField(max_length=32, help_text='''lowercase, letters, digits, period and underscore only.''') email = forms.EmailField() password = forms.CharField(max_length=32, widget=forms.PasswordInput()) @@ -135,9 +132,7 @@ class UserRegistrationForm(forms.Form): department = forms.ChoiceField(help_text='Department you work/study', choices=department_choices) location = forms.CharField(max_length=255, help_text="Place/City") - pincode = forms.RegexField( - regex=r'^.{6}$', error_messages={ - 'invalid': "Please enter valid PINCODE"}) + pincode = forms.RegexField(regex=r'^.{6}$', error_messages={'invalid': "Please enter valid PINCODE"}) state = forms.ChoiceField(choices=states) how_did_you_hear_about_us = forms.ChoiceField(choices=source) @@ -218,11 +213,11 @@ class UserLoginForm(forms.Form): super(UserLoginForm, self).clean() try: u_name, pwd = self.cleaned_data["username"],\ - self.cleaned_data["password"] + self.cleaned_data["password"] user = authenticate(username=u_name, password=pwd) except Exception: - raise forms.ValidationError( - "Username and/or Password is not entered") + raise forms.ValidationError\ + ("Username and/or Password is not entered") if not user: raise forms.ValidationError("Invalid username/password") return user @@ -234,7 +229,7 @@ class ProfileForm(forms.ModelForm): class Meta: model = Profile fields = ['first_name', 'last_name', 'institute', 'department', - ] + ] first_name = forms.CharField(max_length=32) last_name = forms.CharField(max_length=32) @@ -258,18 +253,91 @@ class AnimationProposal(forms.ModelForm): # self.fields['outline'].widget.attrs['placeholder'] = 'NOTE: Do\ # add info about prerequisites (if any), possible textbooks and \ # any other related information' + self.fields['outline'].widget.attrs={ + 'id': 'custom_editor', + 'rows': 10, + 'cols': 50, + 'placeholder': ('NOTE: Do add info about prerequisites (if any), possible textbooks and ' + 'any other related information') + } + + class Meta: + model = Animation + widgets = { + 'sketch': forms.FileInput(), + } + fields = ['category', 'subcategory', 'title', 'outline', 'tags'] + + +class AnimationProposal_edit(forms.ModelForm): + """Animation form """ + required_css_class = 'required' + errorlist_css_class = 'errorlist' + + def __init__(self, *args, **kwargs): + super(AnimationProposal_edit, self).__init__(*args, **kwargs) + self.fields['subcategory'].widget.attrs['placeholder'] = 'Eg: Quantum Mechanics, Topology' + self.fields['outline'].widget.attrs = { - 'id': 'custom_editor', 'rows': 10, 'cols': 50, 'placeholder': ( - 'NOTE: Do add info about prerequisites (if any), possible textbooks and ' - 'any other related information')} + 'id': 'custom_editor', + 'rows': 10, + 'cols': 50, + 'placeholder': ('NOTE: Do add info about prerequisites (if any), possible textbooks and ' + 'any other related information') + } + self.fields['concepts'].widget.attrs = { + 'id': 'custom_editor', + 'rows': 10, + 'cols': 50, + 'placeholder': ('Which concept(s) do you want to animate?' + 'Example: Animation of how data flows in Ring Topology') + } + self.fields['audience'].widget.attrs = { + 'id': 'custom_editor', + 'rows': 10, + 'cols': 50, + 'placeholder': ('Who would be the target audience for your video?\n' + 'Example: High School Students, Mechanical Engineers, etc.') + } + self.fields['reference'].widget.attrs = { + 'id': 'custom_editor', + 'rows': 10, + 'cols': 50, + 'placeholder': ('Please try to be as specific as possible. For example,\n' + 'Book used: Linear Algebra.\n' + 'Author: Kenneth Hoffman, Ray Kunze\n' + 'Edition: Second\n' + 'Chapter: 2 ; Page: 40') + } + self.fields['tools'].widget.attrs = { + 'id': 'custom_editor', + 'rows': 10, + 'cols': 50, + 'placeholder': ('What all tools would you be using for animation?\n' + 'Example: manim, blender, mayavi, mathbox, etc') + } + self.fields['detaled_description'].widget.attrs = { + 'id': 'custom_editor', + 'rows': 10, + 'cols': 50, + 'placeholder': ('Give a detailed description of your animation') + } + self.fields['link'].widget.attrs = { + 'id': 'custom_editor', + 'rows': 10, + 'cols': 50, + 'placeholder': ('Along with the video you will have to submit the source code github link below.\n') + } + self.fields['sketch'].label = "Sketch(.jpeg/.jpg only)" class Meta: model = Animation - fields = ['category', 'subcategory', 'title', 'outline', 'tags'] widgets = { - 'tags': TagWidget(), + 'sketch': forms.FileInput(), } + fields = ['category', 'subcategory', 'title', 'outline', 'tags', 'concepts', 'audience', 'reference', 'tools', + 'detaled_description', 'link', 'sketch'] class CommentForm(forms.ModelForm): @@ -299,4 +367,4 @@ class UploadAnimationForm(forms.ModelForm): exclude = ['animation', 'views', 'like', 'dislike', 'thumbnail'] widgets = { 'video_path': forms.FileInput(), - } + } \ No newline at end of file diff --git a/fossee_manim/templates/fossee_manim/base.html b/fossee_manim/templates/fossee_manim/base.html index ae45a6a..5e6326e 100644 --- a/fossee_manim/templates/fossee_manim/base.html +++ b/fossee_manim/templates/fossee_manim/base.html @@ -34,11 +34,7 @@ {% block header %} -<<<<<<< HEAD -
@@ -19,7 +64,6 @@ {% if request.user.profile.position == 'reviewer' %} - {% endif %} @@ -35,62 +79,30 @@ {% endif %} + + {% if request.user.profile.position == 'reviewer' %} - - + {% endif %} - - {% if request.user.profile.position == 'reviewer' %} - - {% endif %} {% endfor %}
Created DateContributor NameMail Status
{{ an.status }}{{ an.created }} + {% if request.user.profile.position == 'reviewer' %} + {{ an.contributor.get_full_name }} + {% endif %} + + {% if an.status == 'released' or an.status == 'changes' or request.user.profile.position == 'reviewer'%} + + + + {% endif %} + {{ an.contributor.get_full_name }}{{ an.contributor.get_full_name }} + + - - - -
-======= -

Proposal Status

-
- - - - - - - {% if request.user.profile.position == 'reviewer' %} - - - {% endif %} - - - {% for an in anime %} - - - - {% if an.status == 'rejected' %} - - {% elif an.status == 'released' %} - - {% else %} - - {% endif %} - - {% if request.user.profile.position == 'reviewer' %} - - {% endif %} - - - - {% endfor %} -
TitleStatusCreated DateContributor Name
{{ an.title }}{{ an.status }}{{ an.status }}{{ an.status }}{{ an.created }}{{ an.contributor.get_full_name }}
- ->>>>>>> cfdc41deed280bddbcc6c3cf45e30f33ea139e88 diff --git a/fossee_manim/urls.py b/fossee_manim/urls.py index d7b228b..3a9211a 100644 --- a/fossee_manim/urls.py +++ b/fossee_manim/urls.py @@ -33,9 +33,14 @@ urlpatterns = [ url(r'^libraryPhys/$', views.libraryPhys, name='libraryPhys'), url(r'^libraryCS/$', views.libraryCS, name='libraryCS'), url(r'^explore/(?P.+)$', views.explore, - 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'), + name='explore'), + url(r'^show_proposal_detail/([1-9][0-9]*)$', views.show_proposal_detail, name='show_proposal_detail'), + url(r'^delete_proposal/([1-9][0-9]*)$', views.delete_proposal, name='delete_proposal'), + 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'), + url(r'^search_proposal/$', views.search_proposal, name='search_proposal'), ] urlpatterns += static( diff --git a/fossee_manim/views.py b/fossee_manim/views.py index 3ea851e..b8ab7b0 100644 --- a/fossee_manim/views.py +++ b/fossee_manim/views.py @@ -3,7 +3,7 @@ from .forms import ( UserRegistrationForm, UserLoginForm, ProfileForm, AnimationProposal, CommentForm, UploadAnimationForm, - AnimationProposal_edit + AnimationProposal_edit, ) from .models import ( Profile, User, AnimationStats, -- cgit From 4f9cd4c7323eb7d70b422f6add612e42c7b134fd Mon Sep 17 00:00:00 2001 From: Alwin1847207 Date: Fri, 8 Nov 2019 22:44:30 +0530 Subject: fixing some merge conflicts that have missed --- fossee_manim/templates/fossee_manim/about.html | 13 ------------- fossee_manim/templates/fossee_manim/honorarium.html | 15 --------------- fossee_manim/templates/fossee_manim/outreach.html | 9 --------- 3 files changed, 37 deletions(-) diff --git a/fossee_manim/templates/fossee_manim/about.html b/fossee_manim/templates/fossee_manim/about.html index 4688740..3ce076d 100644 --- a/fossee_manim/templates/fossee_manim/about.html +++ b/fossee_manim/templates/fossee_manim/about.html @@ -5,16 +5,10 @@ About {% endblock %} {% block content %} -<<<<<<< HEAD
-======= -
- {% comment %}style="padding-top:120px"> {% endcomment %} -
->>>>>>> cfdc41deed280bddbcc6c3cf45e30f33ea139e88

About FOSSEE Animations

What do we do and why?

@@ -22,12 +16,5 @@ About

-<<<<<<< HEAD
{% endblock content %} -======= -
- {% endblock content %} -
- ->>>>>>> cfdc41deed280bddbcc6c3cf45e30f33ea139e88 diff --git a/fossee_manim/templates/fossee_manim/honorarium.html b/fossee_manim/templates/fossee_manim/honorarium.html index b844482..968ff87 100644 --- a/fossee_manim/templates/fossee_manim/honorarium.html +++ b/fossee_manim/templates/fossee_manim/honorarium.html @@ -64,7 +64,6 @@ Honorarium you do not receive your money within 45 days of acknowledgement of forms received, please feel free to contact us; we are happy to assist you. -<<<<<<< HEAD

Please note that the honorarium processing only starts after we receive your completed honorarium forms. Ensure that you have made a PAN card and submit the forms in time to avoid delays.

@@ -83,20 +82,6 @@ Honorarium Form

  • Receipt
  • -======= -

    Please note that the honorarium processing only starts after we receive your completed honorarium forms. Ensure that you have made a PAN card and submit the forms in time to avoid delays.

    -

    -

    Forms

    -
    -

    Kindly print out the forms below, fill the required fields and mail them to the address:

    -

    -
    ->>>>>>> cfdc41deed280bddbcc6c3cf45e30f33ea139e88 {% endblock %} \ No newline at end of file diff --git a/fossee_manim/templates/fossee_manim/outreach.html b/fossee_manim/templates/fossee_manim/outreach.html index f0314eb..2bdf740 100644 --- a/fossee_manim/templates/fossee_manim/outreach.html +++ b/fossee_manim/templates/fossee_manim/outreach.html @@ -5,18 +5,9 @@ FOSSEE Animations | Outreach {% endblock %} {% block content %} -<<<<<<< HEAD -
    -
    -

    FOSSEE Animations Outreach

    -
    -
    -
    -=======

    FOSSEE Animations Outreach


    ->>>>>>> cfdc41deed280bddbcc6c3cf45e30f33ea139e88 {% endblock %} \ No newline at end of file -- cgit From b80625d1e69202846ab292ac4c84a25c5a8a5367 Mon Sep 17 00:00:00 2001 From: Alwin1847207 Date: Thu, 14 Nov 2019 13:32:24 +0530 Subject: removing .idea folder --- .idea/.gitignore | 6 - .idea/FOSSEE_animations.iml | 35 - .idea/dataSources.local.xml | 17 - .idea/dataSources.xml | 37 - .../c2ec2b16-9a8a-4975-be60-2a0417af82c8.xml | 954 --------------------- .idea/inspectionProfiles/profiles_settings.xml | 6 - .idea/misc.xml | 11 - .idea/modules.xml | 8 - .idea/vcs.xml | 6 - .idea/workspace.xml | 95 -- 10 files changed, 1175 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/FOSSEE_animations.iml delete mode 100644 .idea/dataSources.local.xml delete mode 100644 .idea/dataSources.xml delete mode 100644 .idea/dataSources/c2ec2b16-9a8a-4975-be60-2a0417af82c8.xml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 3889a9e..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ - -# 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 deleted file mode 100644 index 03a8da7..0000000 --- a/.idea/FOSSEE_animations.iml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - -<<<<<<< HEAD - -======= - ->>>>>>> f79913639bc283c945a392d641e84b0a70a97eda - - - - - - - - \ No newline at end of file diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml deleted file mode 100644 index d91079c..0000000 --- a/.idea/dataSources.local.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - " - - - false - - - - - - - - \ No newline at end of file diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml deleted file mode 100644 index ab6c21f..0000000 --- a/.idea/dataSources.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - -<<<<<<< HEAD - - sqlite.xerial - true - org.sqlite.JDBC - jdbc:sqlite:$PROJECT_DIR$/db.sqlite3 - - - - - - file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.25.1/sqlite-jdbc-3.25.1.jar - - - file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.25.1/license.txt - - - - -======= - ->>>>>>> f79913639bc283c945a392d641e84b0a70a97eda - 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/dataSources/c2ec2b16-9a8a-4975-be60-2a0417af82c8.xml b/.idea/dataSources/c2ec2b16-9a8a-4975-be60-2a0417af82c8.xml deleted file mode 100644 index 766dfa4..0000000 --- a/.idea/dataSources/c2ec2b16-9a8a-4975-be60-2a0417af82c8.xml +++ /dev/null @@ -1,954 +0,0 @@ - - - - - 3.25.1 - - - 1 - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - 1 -
    - - 1 -
    - -
    - - 1 - integer|0s - 1 - 1 - - - 2 - varchar(80)|0s - 1 - - - 1 - name - - 1 - - - id - 1 - - - name - sqlite_autoindex_auth_group_1 - - - 1 - integer|0s - 1 - 1 - - - 2 - integer|0s - 1 - - - 3 - integer|0s - 1 - - - group_id -permission_id - - 1 - - - group_id - - - - permission_id - - - - id - 1 - - - group_id - auth_group - id - - - permission_id - auth_permission__old - id - - - 1 - integer|0s - 1 - 1 - - - 2 - integer|0s - 1 - - - 3 - varchar(100)|0s - 1 - - - 4 - varchar(255)|0s - 1 - - - content_type_id -codename - - 1 - - - content_type_id - - - - id - 1 - - - content_type_id - django_content_type - id - - - 1 - integer|0s - 1 - 1 - - - 2 - varchar(128)|0s - 1 - - - 3 - datetime|0s - - - 4 - bool|0s - 1 - - - 5 - varchar(30)|0s - 1 - - - 6 - varchar(30)|0s - 1 - - - 7 - varchar(254)|0s - 1 - - - 8 - bool|0s - 1 - - - 9 - bool|0s - 1 - - - 10 - datetime|0s - 1 - - - 11 - varchar(150)|0s - 1 - - - 1 - username - - 1 - - - id - 1 - - - username - sqlite_autoindex_auth_user_1 - - - 1 - integer|0s - 1 - 1 - - - 2 - integer|0s - 1 - - - 3 - integer|0s - 1 - - - user_id -group_id - - 1 - - - user_id - - - - group_id - - - - id - 1 - - - user_id - auth_user__old - id - - - group_id - auth_group - id - - - 1 - integer|0s - 1 - 1 - - - 2 - integer|0s - 1 - - - 3 - integer|0s - 1 - - - user_id -permission_id - - 1 - - - user_id - - - - permission_id - - - - id - 1 - - - user_id - auth_user__old - id - - - permission_id - auth_permission__old - id - - - 1 - integer|0s - 1 - 1 - - - 2 - text|0s - - - 3 - varchar(200)|0s - 1 - - - 4 - smallint unsigned|0s - 1 - - - 5 - text|0s - 1 - - - 6 - integer|0s - - - 7 - integer|0s - 1 - - - 8 - datetime|0s - 1 - - - content_type_id - - - - user_id - - - - id - 1 - - - content_type_id - django_content_type__old - id - - - user_id - auth_user__old - id - - - 1 - integer|0s - 1 - 1 - - - 2 - varchar(100)|0s - 1 - - - 3 - varchar(100)|0s - 1 - - - app_label -model - - 1 - - - id - 1 - - - 1 - integer|0s - 1 - 1 - - - 2 - varchar(255)|0s - 1 - - - 3 - varchar(255)|0s - 1 - - - 4 - datetime|0s - 1 - - - id - 1 - - - 1 - varchar(40)|0s - 1 - - - 2 - text|0s - 1 - - - 3 - datetime|0s - 1 - - - 1 - session_key - - 1 - - - expire_date - - - - session_key - 1 - sqlite_autoindex_django_session_1 - - - 1 - integer|0s - 1 - 1 - - - 2 - varchar(255)|0s - 1 - - - 3 - varchar(255)|0s - 1 - - - 4 - varchar(255)|0s - 1 - - - 5 - datetime|0s - 1 - - - 6 - integer|0s - 1 - - - 7 - integer|0s - 1 - - - 8 - integer|0s - - - 9 - text|0s - 1 - - - category_id - - - - contributor_id - - - - reviewer_id - - - - id - 1 - - - category_id - fossee_manim_category - id - - - contributor_id - auth_user - id - - - reviewer_id - auth_user - id - - - 1 - integer|0s - 1 - 1 - - - 2 - integer unsigned|0s - 1 - - - 3 - integer unsigned|0s - 1 - - - 4 - integer unsigned|0s - 1 - - - 5 - varchar(100)|0s - - - 6 - varchar(100)|0s - - - 7 - integer|0s - 1 - - - id - 1 - - - animation_id - fossee_manim_animation__old - id - - - 1 - integer|0s - 1 - 1 - - - 2 - varchar(255)|0s - 1 - - - 3 - datetime|0s - 1 - - - 4 - text|0s - 1 - - - 1 - name - - 1 - - - id - 1 - - - name - sqlite_autoindex_fossee_manim_category_1 - - - 1 - integer|0s - 1 - 1 - - - 2 - text|0s - 1 - - - 3 - datetime|0s - 1 - - - 4 - varchar(255)|0s - 1 - - - 5 - integer|0s - 1 - - - 6 - integer|0s - 1 - - - animation_id - - - - commentor_id - - - - id - 1 - - - animation_id - fossee_manim_animation__old - id - - - commentor_id - auth_user - id - - - 1 - integer|0s - 1 - - - 2 - varchar(255)|0s - 1 - - - 3 - varchar(255)|0s - 1 - - - 4 - varchar(255)|0s - 1 - - - 5 - datetime|0s - 1 - - - 6 - integer|0s - 1 - 1 - - - 7 - datetime|0s - 1 - - - 8 - varchar(100)|0s - - - 9 - varchar(1)|0s - 1 - - - 10 - integer|0s - - - 11 - integer|0s - - - 12 - integer|0s - - - 13 - integer|0s - - - 14 - text|0s - 1 - - - id - - - - category_id - - - - contributor_id - - - - history_user_id - - - - reviewer_id - - - - history_id - 1 - - - history_user_id - auth_user - id - - - 1 - integer|0s - 1 - 1 - - - 2 - varchar(32)|0s - 1 - - - 3 - varchar(150)|0s - 1 - - - 4 - varchar(150)|0s - 1 - - - 5 - varchar(10)|0s - 1 - - - 6 - varchar(32)|0s - 1 - - - 7 - varchar(255)|0s - 1 - - - 8 - varchar(255)|0s - 1 - - - 9 - varchar(255)|0s - 1 - - - 10 - varchar(6)|0s - 1 - - - 11 - bool|0s - 1 - - - 12 - varchar(255)|0s - - - 13 - datetime|0s - - - 14 - integer|0s - 1 - - - 1 - user_id - - 1 - - - id - 1 - - - user_id - sqlite_autoindex_fossee_manim_profile_1 - - - user_id - auth_user - id - - - 1 - text|0s - - - 2 - text|0s - - - 3 - text|0s - - - 4 - int|0s - - - 5 - text|0s - - - 1 - - - 2 - - - 1 - integer|0s - 1 - 1 - - - 2 - varchar(100)|0s - 1 - - - 3 - varchar(100)|0s - 1 - - - 1 - name - - 1 - - - 1 - slug - - 1 - - - id - 1 - - - name - sqlite_autoindex_taggit_tag_1 - - - slug - sqlite_autoindex_taggit_tag_2 - - - 1 - integer|0s - 1 - 1 - - - 2 - integer|0s - 1 - - - 3 - integer|0s - 1 - - - 4 - integer|0s - 1 - - - object_id - - - - content_type_id -object_id - - - - content_type_id - - - - tag_id - - - - id - 1 - - - content_type_id - django_content_type - id - - - tag_id - taggit_tag - id - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index a7e5d8b..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - -<<<<<<< HEAD - -======= - ->>>>>>> f79913639bc283c945a392d641e84b0a70a97eda - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 3dd842f..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 626182e..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1570091761379 - - - - - - - - - \ No newline at end of file -- cgit From f2ac50021461637225c77f633c0818f100e87ed1 Mon Sep 17 00:00:00 2001 From: Alwin1847207 Date: Thu, 14 Nov 2019 21:30:24 +0530 Subject: This commit will enable 'edit' button for all proposals for all users in their proposal_status page --- fossee_manim/templates/fossee_manim/proposal_status.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/fossee_manim/templates/fossee_manim/proposal_status.html b/fossee_manim/templates/fossee_manim/proposal_status.html index fe2aa5e..012ba4f 100644 --- a/fossee_manim/templates/fossee_manim/proposal_status.html +++ b/fossee_manim/templates/fossee_manim/proposal_status.html @@ -85,13 +85,11 @@ {% endif %} {% if request.user.profile.position == 'reviewer' %}
    - {% if an.status == 'released' or an.status == 'changes' or request.user.profile.position == 'reviewer'%} - {% endif %} -- cgit