summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fossee_manim/templates/fossee_manim/base.html16
-rw-r--r--fossee_manim/templates/fossee_manim/explore.html38
-rw-r--r--fossee_manim/urls.py2
-rw-r--r--fossee_manim/views.py7
4 files changed, 61 insertions, 2 deletions
diff --git a/fossee_manim/templates/fossee_manim/base.html b/fossee_manim/templates/fossee_manim/base.html
index 395177c..a7115ab 100644
--- a/fossee_manim/templates/fossee_manim/base.html
+++ b/fossee_manim/templates/fossee_manim/base.html
@@ -13,8 +13,9 @@
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.bundle.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="{{ URL_ROOT }}/static/css/sticky-footer.css" type="text/css" />
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Wruczek/Bootstrap-Cookie-Alert@gh-pages/cookiealert.css">
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Wruczek/Bootstrap-Cookie-Alert@gh-pages/cookiealert.css">
+ <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- <link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script> -->
@@ -40,6 +41,19 @@
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
+
+ <i class="material-icons md-24" style="color: #1facb3;">
+ explore
+ </i>
+ <a class="nav-link dropdown-toggle" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="color:#1fabc3"> Explore</a>
+ <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
+ {% for c in categories %}
+ <a class="dropdown-item" href="{% url 'explore' c.name %}">{{c.name}}</a>
+ <div class="dropdown-divider">
+ </div>
+ {% endfor %}
+ </div>
+
<form class="form-inline" method="POST" action="/search/" style="margin-left: 10px; margin-top: 10px; ">
{% csrf_token %}
<input class="form-control mr-sm-2" type="search" id="sbox" name="sbox" placeholder="Search for animations">
diff --git a/fossee_manim/templates/fossee_manim/explore.html b/fossee_manim/templates/fossee_manim/explore.html
new file mode 100644
index 0000000..e634a36
--- /dev/null
+++ b/fossee_manim/templates/fossee_manim/explore.html
@@ -0,0 +1,38 @@
+{% extends 'fossee_manim/base.html' %}
+
+ {% block title %}
+ Explore
+ {% endblock %}
+
+{% block content %}
+<div class="album py-5 bg-light">
+ <div class="container">
+
+ <div class="row">
+{% for video in videos %}
+ <div class="col-md-4">
+ <div class="card mb-4 box-shadow">
+ <a href="{% url 'video' video.id %}" >
+ <img class="card-img-top" alt="Video Thumbnail" src="{{ video.thumbnail.url }}">
+ </a>
+ <div class="card-body">
+ <a href="{% url 'video' video.id %}">
+ <h4 class="card-text" style="color: #157b80;"> {{video.animation.title}} </h4>
+ </a>
+ <p class="card-text"> {{video.animation.outline}}</p>
+ <!-- <div class="d-flex justify-content-between align-items-center"> -->
+ <!-- <div class="btn-group">
+ <button type="button" class="btn btn-sm btn-outline-secondary">View</button>
+ <button type="button" class="btn btn-sm btn-outline-secondary">Edit</button>
+ </div>
+ <small class="text-muted">9 mins</small> -->
+ <!-- </div> -->
+ </div>
+ </div>
+ </div>
+{% endfor %}
+ </div>
+ </div>
+</div>
+
+{% endblock %}
diff --git a/fossee_manim/urls.py b/fossee_manim/urls.py
index c41dd11..e22df91 100644
--- a/fossee_manim/urls.py
+++ b/fossee_manim/urls.py
@@ -27,6 +27,8 @@ urlpatterns = [
url(r'^search_category/(?P<cat>.+)$', views.search_category,
name='search_category'),
url(r'^about/$',views.about, name='about'),
+ url(r'^explore/(?P<category>.+)$', views.explore,
+ name='explore'),
]
urlpatterns += static(
diff --git a/fossee_manim/views.py b/fossee_manim/views.py
index 27173a5..cc62d0e 100644
--- a/fossee_manim/views.py
+++ b/fossee_manim/views.py
@@ -82,9 +82,10 @@ def index(request):
user = request.user
form = UserLoginForm()
+ categories = Category.objects.all()
if user.is_authenticated() and is_email_checked(user):
return redirect('/proposal_status/')
- return render(request, "fossee_manim/index.html")
+ return render(request, "fossee_manim/index.html", {"categories": categories})
def is_reviewer(user):
@@ -197,6 +198,10 @@ def user_register(request):
return render(request, "fossee_manim/register.html", {'form': form, 'categories': categories})
+def explore(request, category):
+ videos = AnimationStats.objects.filter(animation__category__name= category , animation__status="released")
+ return render(request, "fossee_manim/explore.html", {"videos": videos})
+
@login_required
def view_profile(request):
""" view instructor and coordinator profile """