Possibly the final commit

This commit is contained in:
Praneeth Bhandaru 2020-12-13 14:18:32 -05:00
parent d8d1474e09
commit 43b0a67d15
5 changed files with 18 additions and 12 deletions

View File

@ -9,6 +9,8 @@ from .forms import *
# Create your views here. # Create your views here.
def register_view(request): def register_view(request):
if request.user or request.user.is_authenticated:
return redirect('home')
if request.method == "POST": if request.method == "POST":
form = UserRegisterForm(request.POST) form = UserRegisterForm(request.POST)
if form.is_valid(): if form.is_valid():
@ -67,7 +69,7 @@ def classroom_view(request, id):
return HttpResponseForbidden('You do not have access to this class') return HttpResponseForbidden('You do not have access to this class')
return render(request, "frontend/class.html", {'class': classroom}) return render(request, "frontend/class.html", {'class': classroom})
@login_required
def classroom_edit_view(request, id): def classroom_edit_view(request, id):
classroom = Classroom.objects.get(id=id) classroom = Classroom.objects.get(id=id)
if classroom.student.user.pk != request.user.pk: if classroom.student.user.pk != request.user.pk:
@ -86,7 +88,8 @@ def classroom_edit_view(request, id):
return render(request, 'frontend/editClassroom.html', {'form': form}) return render(request, 'frontend/editClassroom.html', {'form': form})
def landing_page(request): def landing_page(request):
if request.user or request.user.is_authenticated: if request.user.is_authenticated:
return redirect('home') return redirect('home')
return render(request, 'frontend/landing.html') return render(request, 'frontend/landing.html')

View File

@ -43,19 +43,19 @@
<div class="navbar-brand"> <div class="navbar-brand">
<span class="navbar-caption-wrap"><a class="navbar-caption text-white display-4" <span class="navbar-caption-wrap"><a class="navbar-caption text-white display-4"
href="{% url 'home' %}" style="font-size: 25px !important;"> href="{% url 'landing_page' %}" style="font-size: 25px !important;">
DO NOT SPACE OUT</a></span> DO NOT SPACE OUT</a></span>
</div> </div>
</div> </div>
<div class="collapse navbar-collapse" id="navbarSupportedContent"> <div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav nav-dropdown " data-app-modern-menu="true"> <ul class="navbar-nav nav-dropdown " data-app-modern-menu="true">
{% if user.is_authenticated %}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link link text-white display-4" style="font-size: 20px !important;" href="{% url 'classroom_form' %}" aria-expanded="false"> <a class="nav-link link text-white display-4" style="font-size: 20px !important;" href="{% url 'classroom_form' %}" aria-expanded="false">
Classroom Classroom
</a> </a>
</li> </li>
{% if user.is_authenticated %}
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link link text-white dropdown-toggle display-4" style="font-size: 20px !important;" href="blog.html" data-toggle="dropdown-submenu" aria-expanded="false"> <a class="nav-link link text-white dropdown-toggle display-4" style="font-size: 20px !important;" href="blog.html" data-toggle="dropdown-submenu" aria-expanded="false">
Profile Profile

View File

@ -57,7 +57,7 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<section class="showcase"> <section class="showcase">
<div class="video-container"> <div class="video-container">
<video src="http://video2.ignitemotion.com/files/mp4/earthAnimation02.mp4" autoplay muted loop></video> <video src="http://video2.ignitemotion.com/files/mp4/earthAnimation02.mp4" autoplay muted loop></video>
</div> </div>
@ -73,9 +73,7 @@
<section id="about"> <section id="about">
<h1>About</h1> <h1>About</h1>
<p> <p>
This is a landing page with a full screen video background. Feel free to Just imagine, your in a boring class, and start to doze off during a long lecture. You start day dreaming about getting back to school, when suddenly the teacher calls on you. You wouldn't want to embarrass yourself by saying you weren't listening, so instead you should take precautions. That's why we are here to help you!
use this landing page in your projects. keep adding sections, change the
video, content , etc
</p> </p>
</section> </section>
{% endblock %} {% endblock %}

View File

@ -6,8 +6,7 @@
{% block head %} {% block head %}
<link rel="stylesheet" type="text/css" href="{% static "login/css/index.css" %}" <link rel="stylesheet" type="text/css" href="{% static "login/css/index.css" %}"/><!--===============================================================================================-->
/><!--===============================================================================================-->
<link rel="icon" type="image/png" href="{% static "login/images/icons/favicon.ico" %}"/> <link rel="icon" type="image/png" href="{% static "login/images/icons/favicon.ico" %}"/>
<!--===============================================================================================--> <!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="{% static "login/vendor/bootstrap/css/bootstrap.min.css" %}"> <link rel="stylesheet" type="text/css" href="{% static "login/vendor/bootstrap/css/bootstrap.min.css" %}">
@ -33,7 +32,8 @@
{% block content %} {% block content %}
<div class="login_container"> <div class="login_container">
<div class="container-login100" style="background-image: url("{% static 'login/images/bg-01.jpg' %}");"> <div class="container-login100">
<br><br><br><br>
<div class="wrap-login100 p-l-55 p-r-55 p-t-80 p-b-30"> <div class="wrap-login100 p-l-55 p-r-55 p-t-80 p-b-30">
<form class="login100-form validate-form" method="POST"> <form class="login100-form validate-form" method="POST">
{% csrf_token %} {% csrf_token %}
@ -62,6 +62,7 @@
</div> </div>
</div> </div>
<div id="dropDownSelect1"></div> <div id="dropDownSelect1"></div>
</div>
{% endblock content %} {% endblock content %}
{% block js %} {% block js %}

View File

@ -19,7 +19,7 @@
A speech to text program to help transcribe your online meetings!</p> A speech to text program to help transcribe your online meetings!</p>
<div class="mbr-section-btn py-4"> <div class="mbr-section-btn py-4">
<a class="btn btn-md btn-white-outline display-4" <a class="btn btn-md btn-white-outline display-4"
href="#">LEARN MORE</a> href="#">DOWNLOAD DESKTOP PROGRAM</a>
</div> </div>
<br> <br>
</div> </div>
@ -43,6 +43,7 @@
<div class="container classes center centered m-10"> <div class="container classes center centered m-10">
<hr> <hr>
<div class="m-b-10"></div> <div class="m-b-10"></div>
{% if classes %}
{% for user_class in classes %} {% for user_class in classes %}
<br> <br>
<br> <br>
@ -53,6 +54,9 @@
<h3>Period: {{ user_class.period }}</h3> <h3>Period: {{ user_class.period }}</h3>
</div> </div>
{% endfor %} {% endfor %}
{% else %}
Create a new class by pressing Classroom in the navbar!
{% endif %}
</div> </div>
<br> <br>