summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fossee_manim/templates/fossee_manim/about.html21
-rw-r--r--fossee_manim/templates/fossee_manim/base.html63
-rw-r--r--fossee_manim/templates/fossee_manim/explore.html40
-rw-r--r--fossee_manim/templates/fossee_manim/faqs.html4
-rw-r--r--fossee_manim/templates/fossee_manim/guidelines.html2
-rw-r--r--fossee_manim/templates/fossee_manim/honorarium.html2
-rw-r--r--fossee_manim/templates/fossee_manim/login.html34
-rw-r--r--fossee_manim/templates/fossee_manim/proposal_status.html88
-rw-r--r--fossee_manim/urls.py2
-rw-r--r--fossee_manim/views.py33
10 files changed, 170 insertions, 119 deletions
diff --git a/fossee_manim/templates/fossee_manim/about.html b/fossee_manim/templates/fossee_manim/about.html
new file mode 100644
index 0000000..aaae771
--- /dev/null
+++ b/fossee_manim/templates/fossee_manim/about.html
@@ -0,0 +1,21 @@
+{% extends 'fossee_manim/base.html' %}
+
+ {% block title %}
+ About
+ {% endblock %}
+
+{% block content %}
+ <div class="container-fluid jumbotron" align = "justify" style="margin-top:20px; padding:50px; background-color: transparent;">
+ <!-- style="padding-top:120px"> -->
+ <center>
+ <h1>About FOSSEE Animations</h1>
+ <h4 style= "color: #555555;"><i>What</i> do we do and <i>why</i>?</h4>
+ </center>
+
+ <div class="container" style= "font-family: 'Lato', sans-serif; background-color: #e7edee;">
+
+ <hr>
+
+</div>
+ </div>
+ {% endblock %}
diff --git a/fossee_manim/templates/fossee_manim/base.html b/fossee_manim/templates/fossee_manim/base.html
index f54e373..0c600db 100644
--- a/fossee_manim/templates/fossee_manim/base.html
+++ b/fossee_manim/templates/fossee_manim/base.html
@@ -10,15 +10,15 @@
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
- <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">
+ <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 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> -->
+ <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">
<!-- favicon -->
- <link rel="shortcut icon" href="{{ URL_ROOT }}/static/img/favicon.ico" />
+ <link rel="shortcut icon" href="{{ URL_ROOT }}/static/img/favicon.ico" />
<link href="https://fonts.googleapis.com/css?family=Montserrat|Lato&display=swap" rel="stylesheet">
<link rel="stylesheet" href="{{ URL_ROOT }}/static/css/custom_base.css" type="text/css" />
</head>
@@ -30,15 +30,31 @@
<body>
{% block header %}
- <nav class="navbar navbar-expand-lg navbar-light row fixed-top" style="background-color:#222222; padding-top: 20px; padding-bottom: 20px;">
+ <nav class="navbar navbar-expand-lg row fixed-top" style="background-color:#222222; padding-top: 20px; padding-bottom: 20px;">
<a class="navbar-brand" href="{% url 'index' %}">
<img src="{{ URL_ROOT }}/static/img/logo_main.png" width="150" height="33.75" alt="" style="margin-right: 50px; margin-left: 20px">
</a>
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
- <div class="collapse navbar-collapse" id="navbarSupportedContent">
+ <ul class="navbar-nav">
+ <li class="nav-item dropdown">
+ <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>
+ </li>
+ </ul>
<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">
@@ -65,21 +81,21 @@
<a class="dropdown-item" href="{% url 'logout' %}">Logout</a>
</div>
{% else %}
- <a class="nav-link dropdown-toggle" href="http://example.com" id="navbarDropdownMenuLink" data-toggle="dropdown" style="color:white">Login / Register</a>
- <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
- <a class="dropdown-item" href="{% url 'login' %}">Login</a>
- <div class="dropdown-divider">
+ <a class="nav-link dropdown-toggle" href="http://example.com" id="navbarDropdownMenuLink" data-toggle="dropdown" style="color:white">Login / Register</a>
+ <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
+ <a class="dropdown-item" href="{% url 'login' %}">Login</a>
+ <div class="dropdown-divider">
+ </div>
+ <a class="dropdown-item" href="{% url 'register' %}">Register</a>
</div>
- <a class="dropdown-item" href="{% url 'register' %}">Register</a>
- </div>
{% endif %}
</li>
- </ul>
- </div>
- </nav>
+ </ul>
+ </div>
+ </nav>
<div class="jumbotron sticky-top" style="padding-top: 90px; padding-bottom: 0.2%; margin-bottom: 0px; background-color: #dddddd">
<div class="btn-group btn-group-lg" role="group">
- <button class="btn btn-link perma_link" type="button"><a href="#" style="color:#157b80">About</a></button>
+ <button class="btn btn-link perma_link" type="button"><a href="{% url 'about' %}" style="color:#157b80">Why FOSSEE Animations?</a></button>
<button class="btn btn-link perma_link" type="button"><a href="{% url 'guidelines' %}" style="color:#222222">Guidelines</a></button>
<button class="btn btn-link perma_link" type="button"><a href="{% url 'faqs' %}" style="color:#222222">FAQ</a></button>
<button class="btn btn-link perma_link" type="button"><a href="{% url 'honorarium' %}" style="color:#222222">Honorarium</a></button>
@@ -91,6 +107,7 @@
{% block content %}
<br><br>
<h1>Base Template Content. Please override me</h1>
+
{% endblock %}
<!-- </main> -->
@@ -127,6 +144,16 @@
</div>
</div>
{% endblock footer%}
+<!-- START Bootstrap-Alert -->
+ <div class="alert text-center cookiealert" role="alert" style="background: #d1ff3c; color: black;">
+ The website is currently undergoing some developmental changes. If you encounter any glitches / malfunctioning, write to us at animations@fossee.in ; we value your feedback and suggestions !
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close" >
+ <span aria-hidden="true">&times;</span>
+ </button>
+ </div>
+ <!-- END Bootstrap-Alert -->
+<!-- JS for alert -->
+<script src="https://cdn.jsdelivr.net/gh/Wruczek/Bootstrap-Cookie-Alert@gh-pages/cookiealert.js"></script>
</body>
diff --git a/fossee_manim/templates/fossee_manim/explore.html b/fossee_manim/templates/fossee_manim/explore.html
new file mode 100644
index 0000000..5cae180
--- /dev/null
+++ b/fossee_manim/templates/fossee_manim/explore.html
@@ -0,0 +1,40 @@
+{% 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|truncatechars:200}}</p>
+
+ <p class="card-text" style="color: #666666"> Contributor: {{video.animation.contributor}}</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/templates/fossee_manim/faqs.html b/fossee_manim/templates/fossee_manim/faqs.html
index 09900c2..c7b6be5 100644
--- a/fossee_manim/templates/fossee_manim/faqs.html
+++ b/fossee_manim/templates/fossee_manim/faqs.html
@@ -10,12 +10,12 @@
background-color: #f2e680;
}
</style>
-<div class="container-fluid jumbotron" align = "justify" style="margin-top:20px">
+<div class="container-fluid jumbotron" align = "justify" style="margin-top:20px; background-color: transparent">
<!-- style="padding-top:120px"> -->
<h1><center>Frequently Asked Questions</center></h1>
<div class="container" style= "font-family: 'Lato', sans-serif;">
- <hr/>
+ <hr>
<ul>
<li><h5>Who can submit proposals?</h5></li>
Anyone can submit proposals.
diff --git a/fossee_manim/templates/fossee_manim/guidelines.html b/fossee_manim/templates/fossee_manim/guidelines.html
index a6256c5..93c9dba 100644
--- a/fossee_manim/templates/fossee_manim/guidelines.html
+++ b/fossee_manim/templates/fossee_manim/guidelines.html
@@ -10,7 +10,7 @@
background-color: #c2d2df;
}
</style>
- <div class="container-fluid jumbotron" align = "justify" style="margin-top:20px;">
+ <div class="container-fluid jumbotron" align = "justify" style="margin-top:20px; background-color: #e7edee;">
<h1><center>Guidelines for Submitting Proposals</center></h1>
<div class="container">
<hr>
diff --git a/fossee_manim/templates/fossee_manim/honorarium.html b/fossee_manim/templates/fossee_manim/honorarium.html
index e281cf2..3896717 100644
--- a/fossee_manim/templates/fossee_manim/honorarium.html
+++ b/fossee_manim/templates/fossee_manim/honorarium.html
@@ -16,7 +16,7 @@
}
</style>
- <div class="container-fluid jumbotron" align = "justify" style="margin-top:20px;">
+ <div class="container-fluid jumbotron" align = "justify" style="margin-top:20px; background-color: #e7edee;">
<h1><center>Honorarium</center></h1>
<div class="container" style= "font-family: 'Lato', sans-serif;">
<hr>
diff --git a/fossee_manim/templates/fossee_manim/login.html b/fossee_manim/templates/fossee_manim/login.html
index fc5d4bc..fd8580d 100644
--- a/fossee_manim/templates/fossee_manim/login.html
+++ b/fossee_manim/templates/fossee_manim/login.html
@@ -5,21 +5,25 @@
{% endblock %}
{% block content %}
- <div class="container" align="center">
- <br>
+ <div class="container-fluid jumbotron" align="justify" style="margin-top:20px; background-color: #e7edee;">
+ <center>
<h1>Login</h1>
- <form method="post">
- {% csrf_token %}
- <table class="table table-bordered">
- {{ form.as_table }}
- <br>
- <br>
- </table>
- <button class="btn btn-success btn-sm" type="submit" style="background-color:#e45700;color:white; border:0px">Login</button>
- <a href="{{URL_ROOT}}/forgotpassword/" class="btn btn-default btn-sm" style="color:#157b80; ">Forgot Password?</a>
- </form>
- <br>
- <p>Don't have an account yet? <a href="{{URL_ROOT}}/register/" style="background-color:#157b80; color:white;">Register here!</a></p>
- <br>
+ <hr>
+ <div class="container" style= "font-family: 'Lato', sans-serif;">
+ <form method="post">
+ {% csrf_token %}
+ <table class="table table-bordered">
+ {{ form.as_table }}
+ <br>
+ <br>
+ </table>
+ <button class="btn btn-success btn-sm" type="submit" style="background-color:#e45700;color:white; border:0px">Login</button>
+ <a href="{{URL_ROOT}}/forgotpassword/" class="btn btn-default btn-sm" style="color:#157b80; ">Forgot Password?</a>
+ </form>
+ <br>
+ <p>Don't have an account yet? <a href="{{URL_ROOT}}/register/" style="background-color:#157b80; color:white;">Register here!</a></p>
+ </center>
+ <br>
+ </div>
</div>
{% endblock %}
diff --git a/fossee_manim/templates/fossee_manim/proposal_status.html b/fossee_manim/templates/fossee_manim/proposal_status.html
index a5cf74e..7294d3a 100644
--- a/fossee_manim/templates/fossee_manim/proposal_status.html
+++ b/fossee_manim/templates/fossee_manim/proposal_status.html
@@ -8,7 +8,6 @@
<div class = "jumbotron" style = "background-color: white; margin-top: 0px;">
<div class="container" align="center">
- {% if request.user.profile.position == 'contributor' %}
<h2> Proposal Status </h2>
<hr>
<table class="table table-hover" style= "font-family: 'Lato', sans-serif;">
@@ -17,6 +16,9 @@
<th>Title</th>
<th>Status</th>
<th>Created Date</th>
+ {% if request.user.profile.position == 'reviewer' %}
+ <th>Contributor Name</th>
+ {% endif %}
</tr>
</thead>
{% for an in anime %}
@@ -31,41 +33,13 @@
<td><span class="text-info">{{ an.status }}</span></td>
{% endif %}
<td><span class="badge">{{ an.created }}</span></td>
- <td><a href="{% url 'edit_proposal' an.id %}"><button type="button" class="btn btn-info" id= "btnblue">Edit</button></a></td>
- </tr>
- </tbody>
- {% endfor %}
- </table>
- {% else %}
-
- <table class="table table-hover">
- <thead>
- <tr>
- <th>Title</th>
- <th>Contributor Name</th>
- <th>Status</th>
- <th>Created Date</th>
- </tr>
- </thead>
- {% for an in anime_list %}
- <tbody>
- <tr>
- <td>{{ an.title }}</td>
- <td>{{ an.contributor.get_full_name }}</td>
- {% if an.status == 'rejected' %}
- <td><span class="text-danger">{{ an.status }}</span></td>
- {% elif an.status == 'released' %}
- <td><span class="text-success">{{ an.status }}</span></td>
- {% else %}
- <td><span class="text-info">{{ an.status }}</span></td>
+ {% if request.user.profile.position == 'reviewer' %}
+ <td>{{ an.contributor.get_full_name }}</td>
{% endif %}
- <td><span class="badge">{{ an.created }}</span></td>
- <td><a href="{% url 'edit_proposal' an.id %}"><button type="button" class="btn btn-info">View</button></a></td>
+ <td><a href="{% url 'edit_proposal' an.id %}"><button type="button" class="btn btn-info" id= "btnblue">Edit</button></a></td>
</tr>
</tbody>
{% endfor %}
- {% endif %}
-
</table>
</div>
@@ -76,41 +50,21 @@
<nav aria-label="Page navigation">
<ul class="pagination pagination-sm">
<li class="page-item">
- {% if request.user.profile.position == 'contributor' %}
- {% if anime.has_previous %}
- <a class="page-link" tabindex="-1"
- href="?page={{ anime.previous_page_number }}">Prev</a>
- {% endif %}
- </li>
- <li class="page-item">
- <span class="current" >
- Page {{ anime.number }} of {{ anime.paginator.num_pages }}
- </span>
- </li>
- <li class="page-item">
- {% if anime.has_next %}
- <a class="page-link" href="?page={{ anime.next_page_number }}"> Next
- </a>
- {% endif %}
-
- {% else %}
- {% if anime_list.has_previous %}
- <a class="page-link" tabindex="-1"
- href="?page={{ anime_list.previous_page_number }}"> Prev </a>
- {% endif %}
- </li>
- <li class="page-item">
- <span class="current">
- Page {{ anime_list.number }} of {{ anime_list.paginator.num_pages }}
- </span>
- </li>
- <li class="page-item">
- {% if anime_list.has_next %}
- <a class="page-link" href="?page={{ anime_list.next_page_number }}"> Next
- </a>
- {% endif %}
-
- {% endif %}
+ {% if anime.has_previous %}
+ <a class="page-link" tabindex="-1"
+ href="?page={{ anime.previous_page_number }}">Prev</a>
+ {% endif %}
+ </li>
+ <li class="page-item">
+ <span class="current" >
+ Page {{ anime.number }} of {{ anime.paginator.num_pages }}
+ </span>
+ </li>
+ <li class="page-item">
+ {% if anime.has_next %}
+ <a class="page-link" href="?page={{ anime.next_page_number }}"> Next
+ </a>
+ {% endif %}
</li>
</ul>
</nav>
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 06c7b3b..3ba5e91 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,12 @@ def user_register(request):
return render(request, "fossee_manim/register.html", {'form': form, 'categories': categories})
+def explore(request, category):
+ categories = Category.objects.all() #not related to category below
+ videos = AnimationStats.objects.filter(animation__category__name= category , animation__status="released")
+
+ return render(request, "fossee_manim/explore.html", {"videos": videos, "categories": categories})
+
@login_required
def view_profile(request):
""" view instructor and coordinator profile """
@@ -297,32 +304,28 @@ def proposal_status(request):
user = request.user
if is_email_checked(user) and user.is_authenticated():
profile = Profile.objects.get(user_id=user)
- anime = {}
- anime_list = {}
categories = Category.objects.all()
if profile.position == 'contributor':
- anime = Animation.objects.filter(contributor_id=user).order_by('-created')
+ animations = Animation.objects.filter(contributor_id=user).order_by('-created')
else:
- anime_list = Animation.objects.order_by('-created')
+ animations = Animation.objects.order_by('-created')
+ # print(animations)
# Show upto 9 proposals per page
- paginator_c = Paginator(list(anime), 9)
- paginator_r = Paginator(list(anime_list), 9)
+ paginator = Paginator(list(animations), 9)
page = request.GET.get('page')
try:
- anime = paginator_c.page(page)
- anime_list = paginator_r.page(page)
+ anime = paginator.page(page)
+ print(animations.count(), anime)
except PageNotAnInteger:
- # If page is not an integer, deliver first page.
- anime = paginator_c.page(1)
- anime_list = paginator_r.page(1)
+ # If page is not an integer, deliver first page.
+ anime = paginator.page(1)
except EmptyPage:
# If page is out of range(e.g 999999), deliver last page.
- anime = paginator_c.page(paginator_c.num_pages)
- anime_list = paginator_r.page(paginator_r.num_pages)
+ anime = paginator.page(paginator.num_pages)
return render(request, 'fossee_manim/proposal_status.html',
- {'anime': anime, 'anime_list': anime_list,
+ {'anime': anime,
'categories': categories})
else:
return redirect('/login/')