From 126558d2dd503efdbdce7545dc4353388c1f405a Mon Sep 17 00:00:00 2001 From: Akshen Date: Wed, 10 Apr 2019 10:34:58 +0530 Subject: Adds how_to_contribute page and videos on index page --- fossee_manim/forms.py | 2 - fossee_manim/models.py | 16 +++++++- fossee_manim/templates/fossee_manim/base.html | 1 + fossee_manim/templates/fossee_manim/how_to.html | 21 +++++++++++ fossee_manim/templates/fossee_manim/index.html | 50 ++++++++++++------------- fossee_manim/templates/fossee_manim/video.html | 22 ++++++++++- fossee_manim/urls.py | 1 + fossee_manim/views.py | 15 ++++++-- 8 files changed, 95 insertions(+), 33 deletions(-) create mode 100644 fossee_manim/templates/fossee_manim/how_to.html (limited to 'fossee_manim') diff --git a/fossee_manim/forms.py b/fossee_manim/forms.py index 72e5c83..7543935 100644 --- a/fossee_manim/forms.py +++ b/fossee_manim/forms.py @@ -258,8 +258,6 @@ class CommentForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(CommentForm, self).__init__(*args, **kwargs) self.fields['comment'].label = "" - self.fields['comment'].widget.attrs['rows'] = 5 - self.fields['comment'].widget.attrs['cols'] = 95 class Meta: model = Comment diff --git a/fossee_manim/models.py b/fossee_manim/models.py index 9a85c4d..a3b3537 100644 --- a/fossee_manim/models.py +++ b/fossee_manim/models.py @@ -209,4 +209,18 @@ class AnimationStats(models.Model): # Converting to Python file object with # some Django-specific additions django_file = File(que_file) - self.thumbnail.save(file_name, django_file, save=True) \ No newline at end of file + self.thumbnail.save(file_name, django_file, save=True) + + def _create_ogv(self): + video_input = self.video_path.path + vid_output = path.join( + 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): + que_file = open(vid_output, 'rb') + # 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 diff --git a/fossee_manim/templates/fossee_manim/base.html b/fossee_manim/templates/fossee_manim/base.html index 3fdd977..1a4945d 100644 --- a/fossee_manim/templates/fossee_manim/base.html +++ b/fossee_manim/templates/fossee_manim/base.html @@ -60,6 +60,7 @@ {% if request.user.profile.position == 'contributor' %}
+