summaryrefslogtreecommitdiff
path: root/fossee_manim
diff options
context:
space:
mode:
Diffstat (limited to 'fossee_manim')
-rw-r--r--fossee_manim/forms.py2
-rw-r--r--fossee_manim/models.py10
-rw-r--r--fossee_manim/templates/fossee_manim/faqs.html8
-rw-r--r--fossee_manim/templates/fossee_manim/guidelines.html4
-rw-r--r--fossee_manim/templates/fossee_manim/honorarium.html8
-rw-r--r--fossee_manim/urls.py3
-rw-r--r--fossee_manim/views.py3
7 files changed, 33 insertions, 5 deletions
diff --git a/fossee_manim/forms.py b/fossee_manim/forms.py
index 8edfb5c..3b9ca2e 100644
--- a/fossee_manim/forms.py
+++ b/fossee_manim/forms.py
@@ -280,7 +280,7 @@ class UploadAnimationForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(UploadAnimationForm, self).__init__(*args, **kwargs)
- self.fields['video_path'].label = "Animation"
+ self.fields['video_path'].label = "Animation(.mp4 only)"
class Meta:
model = AnimationStats
diff --git a/fossee_manim/models.py b/fossee_manim/models.py
index 7dbfe29..e2ff72c 100644
--- a/fossee_manim/models.py
+++ b/fossee_manim/models.py
@@ -108,6 +108,14 @@ 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
+ ext = os.path.splitext(value.name)[1] # [0] returns path+filename
+ valid_extensions = ['.mp4']
+ if not ext.lower() in valid_extensions:
+ raise ValidationError(u'Unsupported file extension.')
+
class Profile(models.Model):
"""Profile for users(instructors and coordinators)"""
@@ -196,7 +204,7 @@ 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)
+ 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
diff --git a/fossee_manim/templates/fossee_manim/faqs.html b/fossee_manim/templates/fossee_manim/faqs.html
new file mode 100644
index 0000000..72c3f44
--- /dev/null
+++ b/fossee_manim/templates/fossee_manim/faqs.html
@@ -0,0 +1,8 @@
+{% extends 'fossee_manim/base.html' %}
+
+ {% block title %}
+ Animation Guidelines
+ {% endblock %}
+
+{% block content %}
+{% endblock %} \ No newline at end of file
diff --git a/fossee_manim/templates/fossee_manim/guidelines.html b/fossee_manim/templates/fossee_manim/guidelines.html
index 2d034a2..1ab7eef 100644
--- a/fossee_manim/templates/fossee_manim/guidelines.html
+++ b/fossee_manim/templates/fossee_manim/guidelines.html
@@ -1,7 +1,7 @@
{% extends 'fossee_manim/base.html' %}
{% block title %}
- FOSSEE Animation
+ Animation Guidelines
{% endblock %}
{% block content %}
@@ -93,7 +93,7 @@
<li>The final video has to be submitted in a <strong>.mp4 format.</strong></li>
<li>
In case you feel that the animation video requires narration, a complementary script can be provided in a .txt file over email. A voiceover would be provided for the animations from FOSSEE. You may refer to the videos already published on the website for instances of animations with and without an additional script.
- You may refer to this blog for getting started with manim. Here’s the link for getting started with mayavi.
+ You may refer to <a href="https://purusharthsaxena.wordpress.com/">this</a> blog for getting started with manim. <a href="https://www.youtube.com/watch?v=r6OD07Qq2mw">Here’s the link</a> for getting started with mayavi.
</li>
</ul>
<br>
diff --git a/fossee_manim/templates/fossee_manim/honorarium.html b/fossee_manim/templates/fossee_manim/honorarium.html
new file mode 100644
index 0000000..72c3f44
--- /dev/null
+++ b/fossee_manim/templates/fossee_manim/honorarium.html
@@ -0,0 +1,8 @@
+{% extends 'fossee_manim/base.html' %}
+
+ {% block title %}
+ Animation Guidelines
+ {% endblock %}
+
+{% block content %}
+{% endblock %} \ No newline at end of file
diff --git a/fossee_manim/urls.py b/fossee_manim/urls.py
index f3c65b6..6d24111 100644
--- a/fossee_manim/urls.py
+++ b/fossee_manim/urls.py
@@ -22,7 +22,8 @@ urlpatterns = [
url(r'^view_profile/$', views.view_profile, name='view_profile'),
url(r'^edit_profile/$', views.edit_profile, name='edit_profile'),
url(r'^video/([1-9][0-9]*)$', views.video, name='video'),
- url(r'^honorarium/([1-9][0-9]*)$', views.honorarium, name='honorarium'),
+ url(r'^honorarium/$', views.honorarium, name='honorarium'),
+ url(r'^faqs/$', views.faqs, name='faqs'),
url(r'^search_category/(?P<cat>.+)$', views.search_category,
name='search_category')
]
diff --git a/fossee_manim/views.py b/fossee_manim/views.py
index c1973e6..b950c45 100644
--- a/fossee_manim/views.py
+++ b/fossee_manim/views.py
@@ -537,4 +537,7 @@ def guidelines(request):
def honorarium(request):
+ pass
+
+def faqs(request):
pass \ No newline at end of file