From af4a10b4913cece224e0bc352c9ac62f61bcad19 Mon Sep 17 00:00:00 2001 From: Sharanya A Date: Wed, 31 Jul 2019 16:19:55 +0530 Subject: changes to urls, views --- fossee_anime/settings.py | 2 +- fossee_anime/urls.py | 4 ++-- fossee_manim/forms.py | 13 ++++++++++--- fossee_manim/models.py | 5 ++--- fossee_manim/urls.py | 3 ++- fossee_manim/views.py | 17 ++++++++++------- static/css/index.css | 6 +++--- static/img/logo.png | Bin 7537 -> 17220 bytes 8 files changed, 30 insertions(+), 20 deletions(-) diff --git a/fossee_anime/settings.py b/fossee_anime/settings.py index b620525..8b5f93a 100644 --- a/fossee_anime/settings.py +++ b/fossee_anime/settings.py @@ -165,4 +165,4 @@ ADMIN_EMAIL = 'your admin email' FILE_UPLOAD_PERMISSIONS = 0o644 SESSION_EXPIRE_AT_BROWSER_CLOSE = True SESSION_SAVE_EVERY_REQUEST = True -SESSION_COOKIE_AGE = 36000 \ No newline at end of file +SESSION_COOKIE_AGE = 36000 diff --git a/fossee_anime/urls.py b/fossee_anime/urls.py index 9fb65d5..0db0fe5 100644 --- a/fossee_anime/urls.py +++ b/fossee_anime/urls.py @@ -23,7 +23,7 @@ from django.conf.urls.static import static urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^', include('fossee_manim.urls')), - url(r'^', include('fossee_manim.urls_password_reset')) + url(r'^', include('fossee_manim.urls_password_reset')), ] urlpatterns += static(settings.MEDIA_URL, - document_root=settings.MEDIA_ROOT) \ No newline at end of file + document_root=settings.MEDIA_ROOT) diff --git a/fossee_manim/forms.py b/fossee_manim/forms.py index 7dfdc77..69f8458 100644 --- a/fossee_manim/forms.py +++ b/fossee_manim/forms.py @@ -250,9 +250,16 @@ class AnimationProposal(forms.ModelForm): def __init__(self, *args, **kwargs): super(AnimationProposal, self).__init__(*args, **kwargs) self.fields['subcategory'].widget.attrs['placeholder'] = 'Eg: Quantum Mechanics, Topology' - 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['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 e2ff72c..273ebe6 100644 --- a/fossee_manim/models.py +++ b/fossee_manim/models.py @@ -10,7 +10,6 @@ from os import path, sep import tempfile import subprocess - position_choices = ( ("contributor", "Contributor"), ("reviewer", "Reviewer") @@ -220,7 +219,7 @@ class AnimationStats(models.Model): # some Django-specific additions django_file = File(que_file) self.thumbnail.save(file_name, django_file, save=True) - + def _create_ogv(self): video_input = self.video_path.path vid_output = path.join( @@ -233,4 +232,4 @@ class AnimationStats(models.Model): # Converting to Python file object with # some Django-specific additions django_file = File(que_file) - self.video_path.save(file_name, django_file, save=True) \ No newline at end of file + self.video_path.save(file_name, django_file, save=True) diff --git a/fossee_manim/urls.py b/fossee_manim/urls.py index 6d24111..c41dd11 100644 --- a/fossee_manim/urls.py +++ b/fossee_manim/urls.py @@ -25,7 +25,8 @@ urlpatterns = [ url(r'^honorarium/$', views.honorarium, name='honorarium'), url(r'^faqs/$', views.faqs, name='faqs'), url(r'^search_category/(?P.+)$', views.search_category, - name='search_category') + name='search_category'), + url(r'^about/$',views.about, name='about'), ] urlpatterns += static( diff --git a/fossee_manim/views.py b/fossee_manim/views.py index a0d0c22..06c7b3b 100644 --- a/fossee_manim/views.py +++ b/fossee_manim/views.py @@ -35,7 +35,7 @@ except ImportError: __author__ = "Akshen Doke" __credits__ = ["Prabhu Ramachandran", "Aditya P.", "KhushalSingh Rajput", - "Prathamesh Salunke", "Purusharth Saxsena", "Sharanya Achut" + "Prathamesh Salunke", "Purusharth Saxsena", "Sharanya Achut", "Ankit Javalkar" ] def makepath(proposal_data, reject=None): @@ -88,7 +88,7 @@ def index(request): def is_reviewer(user): - '''Check if the user is having reviewer rights''' + '''Check if the user has reviewer rights''' return user.groups.filter(name='reviewer').exists() @@ -304,7 +304,7 @@ def proposal_status(request): anime = Animation.objects.filter(contributor_id=user).order_by('-created') else: anime_list = Animation.objects.order_by('-created') - + # Show upto 9 proposals per page paginator_c = Paginator(list(anime), 9) paginator_r = Paginator(list(anime_list), 9) @@ -429,7 +429,7 @@ def search(request): 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}) @@ -499,7 +499,7 @@ def video(request, aid=None): return redirect('/login/') else: return redirect('/view_profile/') - + if len(suggestion_list)>3: suggestion_list = sample(suggestion_list, 3) else: @@ -525,7 +525,10 @@ def search_category(request, cat=None): def guidelines(request): categories = Category.objects.all() 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}) def honorarium(request): categories = Category.objects.all() @@ -533,4 +536,4 @@ def honorarium(request): def faqs(request): categories = Category.objects.all() - return render(request, 'fossee_manim/faqs.html', {'categories': categories}) \ No newline at end of file + return render(request, 'fossee_manim/faqs.html', {'categories': categories}) diff --git a/static/css/index.css b/static/css/index.css index f1b32bc..9d7643a 100644 --- a/static/css/index.css +++ b/static/css/index.css @@ -24,7 +24,7 @@ #container_img { margin: auto; - + } form.example input[type=text] { @@ -64,7 +64,7 @@ form.example::after { #btns { padding: 25 25 25 25; font-size: 155%; - font-family: Verdana, Geneva, Tahoma, sans-serif; + font-family: 'Lato', sans-serif; } #btns > a { @@ -123,4 +123,4 @@ hr { #circle:hover { background-color: #ffe0b2; border-radius: 50%; - } \ No newline at end of file +} diff --git a/static/img/logo.png b/static/img/logo.png index 8389fa1..2fef43b 100644 Binary files a/static/img/logo.png and b/static/img/logo.png differ -- cgit