diff options
author | Akshen | 2019-04-10 10:34:58 +0530 |
---|---|---|
committer | Akshen | 2019-04-10 10:36:31 +0530 |
commit | 126558d2dd503efdbdce7545dc4353388c1f405a (patch) | |
tree | 59ee8ba44cd6629edd75ae692a0e572c62d7de36 /fossee_manim | |
parent | e5a0299855a9367eb6e32abfd356ed53c3fb765b (diff) | |
download | FOSSEE_animations-126558d2dd503efdbdce7545dc4353388c1f405a.tar.gz FOSSEE_animations-126558d2dd503efdbdce7545dc4353388c1f405a.tar.bz2 FOSSEE_animations-126558d2dd503efdbdce7545dc4353388c1f405a.zip |
Adds how_to_contribute page and videos on index page
Diffstat (limited to 'fossee_manim')
-rw-r--r-- | fossee_manim/forms.py | 2 | ||||
-rw-r--r-- | fossee_manim/models.py | 16 | ||||
-rw-r--r-- | fossee_manim/templates/fossee_manim/base.html | 1 | ||||
-rw-r--r-- | fossee_manim/templates/fossee_manim/how_to.html | 21 | ||||
-rw-r--r-- | fossee_manim/templates/fossee_manim/index.html | 50 | ||||
-rw-r--r-- | fossee_manim/templates/fossee_manim/video.html | 22 | ||||
-rw-r--r-- | fossee_manim/urls.py | 1 | ||||
-rw-r--r-- | fossee_manim/views.py | 15 |
8 files changed, 95 insertions, 33 deletions
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 @@ </a> {% if request.user.profile.position == 'contributor' %} <div class="dropdown-menu" aria-labelledby="navbarDropdown"> + <a class="dropdown-item" href="{% url 'how_to' %}">How To</a> <a class="dropdown-item" href="{% url 'send_proposal' %}">Send Proposal</a> <a class="dropdown-item" href="{% url 'proposal_status' %}">Proposal Status</a> <a class="dropdown-item" href="{% url 'view_profile' %}">View Profile</a> diff --git a/fossee_manim/templates/fossee_manim/how_to.html b/fossee_manim/templates/fossee_manim/how_to.html new file mode 100644 index 0000000..830bdff --- /dev/null +++ b/fossee_manim/templates/fossee_manim/how_to.html @@ -0,0 +1,21 @@ +{% extends 'fossee_manim/base.html' %} + + {% block title %} + FOSSEE Animation + {% endblock %} + +{% block content %} + <div class="container-fluid"> + <br> + <h1>How to contribute</h1> + <ul> + <li><a class="nav-link" href="{% url 'register' %}">Register</a></li> + <li><a class="nav-link" href="https://purusharthsaxena.wordpress.com/getting-started-with-manim/" target="_blank">Visit here to know about manim(python based animation library)</a></li> + <li>Send proposal for a topic</li> + <li>Wait for the reviewer to respond</li> + <li>Upload animation video</li> + <li>Once approved, video will be released</li> + <li>Get Honorarium</li> + </ul> + </div> +{% endblock %}
\ No newline at end of file diff --git a/fossee_manim/templates/fossee_manim/index.html b/fossee_manim/templates/fossee_manim/index.html index 3d39b41..0753918 100644 --- a/fossee_manim/templates/fossee_manim/index.html +++ b/fossee_manim/templates/fossee_manim/index.html @@ -4,12 +4,11 @@ <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="Akshen Doke" content="PRE, FOSSEE-IITB"> - <meta name="title" content="Welcome to FOSSEE's Python Workshops"> + <meta name="title" content="Welcome to FOSSEE's Animation for Education"> <meta name="description" content="The FOSSEE team at IIT Bombay conducts remote-assisted training programs in Python. These are interactive workshop sessions with hands-on experience, live assistance, practice sessions and evaluation quizzes. - These programs can be conducted at your institution / organisation, free of charge. - Please note that you will require a coordinator and a minimum number of 25 participants to request for these workshops."> - <meta name="keywords" content="learn python for free, fossee, iit bombay, python workshops, fossee python, python workshops"> + These programs can be conducted at your institution / organisation, free of charge."> + <meta name="keywords" content="fossee, iit bombay, animation based learning math, manim, python based animations"> <!-- favicon --> <link rel="shortcut icon" type="image/png" href="{{ URL_ROOT}}/static/img/fevicon_python.png"/> @@ -37,22 +36,23 @@ <div class="container-fluid" style="height:100%; background-color: #3D5A50;"> <div class="row" id="r1" style="background-color:#ffffff"> <div class="col-md-2" id="brand"><strong>FOSSEE</strong> <br>Animation</div> - <div class="col-md-10" style="text-align:center;" id="tag"><strong>Python based animation for math</strong></div> + <div class="col-md-10" style="text-align:center;" id="tag"><strong>Animation based learning</strong></div> </div> <div class="row" id="r2" style="background-color:#3D5A50"> <div class="col-md-8"> - <form class="example" action="" id="search_bar"> - <input type="text" placeholder="Search." name="search" id="search_tab"> + <form class="example" id="search_bar" method="POST" action="/search/"> + {% csrf_token %} + <input type="text" id="sbox" name="sbox" type="search" placeholder="Search" id="search_tab"> <button type="submit"><i class="fa fa-search"></i></button> </form> </div> <div class="col-md-2" id="btns" style="text-align:center;"> - <a href="{{URL_ROOT}}/login"><strong>Login</strong></a> + <a href="{% url 'login' %}"><strong>Login</strong></a> </div> <div class="col-md-2" id="btns" style="text-align:center;"> - <a href="{{URL_ROOT}}/register"><strong>Register</strong></a> + <a href="{% url 'register' %}"><strong>Register</strong></a> </div> </div> @@ -71,28 +71,28 @@ <div class="row" id="r4" style="background-color:ghostwhite"> <hr style="height:3px;"> <div class="col-md-3" style="text-align:center;"> - <iframe width="240" height="125" - src="https://www.youtube.com/embed/JGLfa66Os0Q" frameborder="0" allow="accelerometer; - encrypted-media; gyroscope; picture-in-picture" allowfullscreen> - </iframe> + <a href="{% url 'video' anime.0.id %}" > + <span class="fa fa-play fa-4x" id="play-btn"></span> + <img height="25%" width="65%" src="{{ anime.0.thumbnail.url }}"> + </a> </div> <div class="col-md-3" style="text-align:center;"> - <iframe width="240" height="125" - src="https://www.youtube.com/embed/JGLfa66Os0Q" frameborder="0" allow="accelerometer; - encrypted-media; gyroscope; picture-in-picture" allowfullscreen> - </iframe> + <a href="{% url 'video' anime.1.id %}" > + <span class="fa fa-play fa-4x" id="play-btn"></span> + <img height="25%" width="65%" src="{{ anime.1.thumbnail.url }}"> + </a> </div> <div class="col-md-3" style="text-align:center;"> - <iframe width="240" height="125" - src="https://www.youtube.com/embed/JGLfa66Os0Q" frameborder="0" allow="accelerometer; - encrypted-media; gyroscope; picture-in-picture" allowfullscreen> - </iframe> + <a href="{% url 'video' anime.2.id %}" > + <span class="fa fa-play fa-4x" id="play-btn"></span> + <img height="25%" width="65%" src="{{ anime.2.thumbnail.url }}"> + </a> </div> <div class="col-md-3" style="text-align:center;"> - <iframe width="240" height="125" - src="https://www.youtube.com/embed/JGLfa66Os0Q" frameborder="0" allow="accelerometer; - encrypted-media; gyroscope; picture-in-picture" allowfullscreen> - </iframe> + <a href="{% url 'video' anime.3.id %}" > + <span class="fa fa-play fa-4x" id="play-btn"></span> + <img height="25%" width="65%" src="{{ anime.3.thumbnail.url }}"> + </a> </div> </div> diff --git a/fossee_manim/templates/fossee_manim/video.html b/fossee_manim/templates/fossee_manim/video.html index fa09010..b94a34e 100644 --- a/fossee_manim/templates/fossee_manim/video.html +++ b/fossee_manim/templates/fossee_manim/video.html @@ -34,8 +34,28 @@ <br> </div> </div> + <hr> + <div class="row"> + <div class="col-md-4"> + <a href="{% url 'video' reco.0.id %}" > + <span class="fa fa-play fa-4x" id="play-btn"></span> + <img height="95%" width="95%" src="{{ reco.0.thumbnail.url }}"> + </a> + </div> + <div class="col-md-4"> + <a href="{% url 'video' reco.1.id %}" > + <span class="fa fa-play fa-4x" id="play-btn"></span> + <img height="95%" width="95%" src="{{ reco.1.thumbnail.url }}"> + </a> + </div> + <div class="col-md-4"> + <a href="{% url 'video' reco.2.id %}" > + <span class="fa fa-play fa-4x" id="play-btn"></span> + <img height="95%" width="95%" src="{{ reco.2.thumbnail.url }}"> + </a> + </div> + </div> <div> - <hr> <br> <br> <h2>Comments</h2> <div> diff --git a/fossee_manim/urls.py b/fossee_manim/urls.py index 278dee2..6181b67 100644 --- a/fossee_manim/urls.py +++ b/fossee_manim/urls.py @@ -18,6 +18,7 @@ urlpatterns = [ name='upload_animation'), url(r'^proposal_status/$', views.proposal_status, name='proposal_status'), url(r'^search/$', views.search, name='search'), + url(r'^how_to/$', views.how_to, name='how_to'), 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'), diff --git a/fossee_manim/views.py b/fossee_manim/views.py index 93a1763..44f20c1 100644 --- a/fossee_manim/views.py +++ b/fossee_manim/views.py @@ -23,6 +23,7 @@ from django.db.models import F, Subquery, OuterRef, Q from zipfile import ZipFile from textwrap import dedent from requests import get +from random import sample from .send_mails import send_email import datetime as dt import shutil @@ -112,7 +113,7 @@ def user_login(request): login(request, user) if user.groups.filter(name='reviewer').count() > 0: return redirect('/view_profile/') - return redirect('/view_profile/') + return redirect('/how_to/') else: return render(request, 'fossee_manim/login.html', {"form": form}) else: @@ -460,12 +461,14 @@ def video(request, aid=None): else: return redirect('/view_profile/') - - + 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] categories = Category.objects.all() return render(request, 'fossee_manim/video.html', {'video': video, 'categories': categories, - 'suggestion_list': suggestion_list, + 'reco': suggestion_list, "comment_form": comment_form, 'comments': comments}) @@ -478,3 +481,7 @@ def search_category(request, cat=None): return render(request, 'fossee_manim/categorical_list.html', {'categorial_list': cat_video_list, 'categories': categories }) + + +def how_to(request): + return render(request, 'fossee_manim/how_to.html')
\ No newline at end of file |