-
Notifications
You must be signed in to change notification settings - Fork 982
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: basic frontend of Examination module
* implemented authentication and sidenavbar * added announcement section
- Loading branch information
1 parent
195e713
commit d7235c6
Showing
21 changed files
with
912 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class ExaminationConfig(AppConfig): | ||
name = 'examination' |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.db import models | ||
|
||
# Create your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
from django.conf.urls import url | ||
from django.urls import path, include | ||
from . import views | ||
from django.contrib import admin | ||
|
||
app_name = 'examination' | ||
|
||
urlpatterns = [ | ||
path('',views.exam,name='exam'), | ||
path('submit/',views.submit,name='submit'), | ||
path('verify/',views.verify,name='verify'), | ||
path('publish/',views.publish,name='publish'), | ||
path('notReady_publish/',views.notReady_publish,name='notReady_publish'), | ||
|
||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from django.db.models.query_utils import Q | ||
from django.http import request,HttpResponse | ||
from django.shortcuts import get_object_or_404, render, HttpResponse,redirect | ||
from django.http import HttpResponse, HttpResponseRedirect | ||
import itertools | ||
from django.contrib import messages | ||
from django.contrib.auth.decorators import login_required | ||
from django.contrib.auth.models import User | ||
|
||
# from applications.academic_information.models import Student | ||
from applications.globals.models import (DepartmentInfo, Designation, | ||
ExtraInfo, Faculty, HoldsDesignation) | ||
|
||
|
||
@login_required(login_url='/accounts/login') | ||
def exam(request): | ||
""" | ||
This function is used to Differenciate acadadmin and all other user. | ||
@param: | ||
request - contains metadata about the requested page | ||
@variables: | ||
user_details - Gets the information about the logged in user. | ||
des - Gets the designation about the looged in user. | ||
""" | ||
user_details = ExtraInfo.objects.get(user = request.user) | ||
des = HoldsDesignation.objects.all().filter(user = request.user).first() | ||
if str(des.designation) == "Associate Professor" or str(des.designation) == "Professor" or str(des.designation) == "Assistant Professor" : | ||
return HttpResponseRedirect('/examination/submit/') | ||
elif str(request.user) == "acadadmin" : | ||
return HttpResponseRedirect('/examination/submit/') | ||
|
||
return HttpResponseRedirect('/dashboard/') | ||
|
||
@login_required(login_url='/accounts/login') | ||
def submit(request): | ||
return render(request,'../templates/examination/submit.html' , {}) | ||
|
||
@login_required(login_url='/accounts/login') | ||
def verify(request): | ||
return render(request,'../templates/examination/verify.html' , {}) | ||
|
||
@login_required(login_url='/accounts/login') | ||
def publish(request): | ||
return render(request,'../templates/examination/publish.html' ,{}) | ||
|
||
|
||
@login_required(login_url='/accounts/login') | ||
def notReady_publish(request): | ||
return render(request,'../templates/examination/notReady_publish.html',{}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
{% extends 'examination/base.html' %} | ||
{% block sidetabmenu %} | ||
<div class="ui medium fluid vertical pointing menu" style="max-width: 320px;"> | ||
|
||
<a class="item" href="{% url 'examination:submit' %}">Submit | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="{% url 'examination:verify' %}">Verify | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="active item" href="{% url 'examination:publish' %}"><B>Publish</B> | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="#">Announcement | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="#">Time Table | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<h1>Announcement</h1> | ||
<br /> | ||
|
||
{% comment %} Combined {% endcomment %} | ||
<div style="display: flex; flex-direction: column; gap: 30px;" > | ||
|
||
{% comment %} First Row {% endcomment %} | ||
<div style="display: flex; flex-direction: row; gap: 50px; " > | ||
|
||
<div style="display: flex; flex-direction: row; gap: 10px; " > | ||
<div style="margin-top: 8px;" > | ||
<label>Curriculum</label> | ||
</div> | ||
<div class="ui selection dropdown"> | ||
<input type="hidden" name="gender"> | ||
<i class="dropdown icon"></i> | ||
<div class="default text">Select Item</div> | ||
<div class="menu"> | ||
<div class="item" data-value="1">B.Tech</div> | ||
<div class="item" data-value="0">M.Tech</div> | ||
<div class="item" data-value="0">B.Des</div> | ||
<div class="item" data-value="0">M.Des</div> | ||
<div class="item" data-value="0">PhD</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div style="display: flex; flex-direction: row; gap: 10px; " > | ||
<div style="margin-top: 8px;" > | ||
<label>Batch</label> | ||
</div> | ||
<div class="ui selection dropdown"> | ||
<input type="hidden" name="gender"> | ||
<i class="dropdown icon"></i> | ||
<div class="default text">Select Item</div> | ||
<div class="menu"> | ||
<div class="item" data-value="1">B.Tech</div> | ||
<div class="item" data-value="0">M.Tech</div> | ||
<div class="item" data-value="0">B.Des</div> | ||
<div class="item" data-value="0">M.Des</div> | ||
<div class="item" data-value="0">PhD</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div style="display: flex; flex-direction: row; gap: 10px; " > | ||
<div style="margin-top: 8px;" > | ||
<label>Branch</label> | ||
</div> | ||
<div class="ui selection dropdown"> | ||
<input type="hidden" name="gender"> | ||
<i class="dropdown icon"></i> | ||
<div class="default text">Select Item</div> | ||
<div class="menu"> | ||
<div class="item" data-value="1">B.Tech</div> | ||
<div class="item" data-value="0">M.Tech</div> | ||
<div class="item" data-value="0">B.Des</div> | ||
<div class="item" data-value="0">M.Des</div> | ||
<div class="item" data-value="0">PhD</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
|
||
{% comment %} Second Row {% endcomment %} | ||
|
||
<div style="display: flex; flex-direction: row; gap: 50px; margin-left: 10px; " > | ||
|
||
<div style="display: flex; flex-direction: row; gap: 10px; " > | ||
<div style="margin-top: 8px;" > | ||
<label>Semester</label> | ||
</div> | ||
<div class="ui selection dropdown"> | ||
<input type="hidden" name="gender"> | ||
<i class="dropdown icon"></i> | ||
<div class="default text">Select Item</div> | ||
<div class="menu"> | ||
<div class="item" data-value="1">B.Tech</div> | ||
<div class="item" data-value="0">M.Tech</div> | ||
<div class="item" data-value="0">B.Des</div> | ||
<div class="item" data-value="0">M.Des</div> | ||
<div class="item" data-value="0">PhD</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
|
||
|
||
<a href="{% url 'examination:notReady_publish' %}"> | ||
<button class="ui primary button"> | ||
|
||
Search | ||
</button> | ||
</a> | ||
|
||
|
||
</div> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{% extends 'globals/base.html' %} | ||
{% load static %} | ||
|
||
{% block title %} | ||
examination | ||
{% endblock %} | ||
|
||
{% block css %} | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/fontawesome.min.css" integrity="sha512-OdEXQYCOldjqUEsuMKsZRj93Ht23QRlhIb8E/X0sbwZhme8eUw6g8q7AdxGJKakcBbv7+/PX0Gc2btf7Ru8cZA==" crossorigin="anonymous" /> | ||
<meta name='viewport' content='width=device-width, initial-scale=1'> | ||
{% endblock %} | ||
|
||
{% block body %} | ||
{% block navBar %} | ||
{% include 'dashboard/navbar.html' %} | ||
{% endblock %} | ||
|
||
<div class="ui stackable doubling grid"> | ||
|
||
{% comment %}The left-margin segment!{% endcomment %} | ||
<div class="column"></div> | ||
|
||
{% comment %}The left-rail segment starts here!{% endcomment %} | ||
<div class="three wide column"> | ||
|
||
{% comment %}The user image card starts here!{% endcomment %} | ||
{% block usercard %} | ||
{% include 'globals/usercard.html' %} | ||
{% endblock %} | ||
{% comment %}The user image card ends here!{% endcomment %} | ||
|
||
<div class="ui divider"></div> | ||
|
||
{% comment %}The Tab-Menu starts here!{% endcomment %} | ||
{% block sidetabmenu %} | ||
{% endblock %} | ||
{% comment %}The Tab-Menu ends here!{% endcomment %} | ||
</div> | ||
|
||
{% comment %} | ||
The left-rail segment ends here! | ||
{% endcomment %} | ||
|
||
{% comment %} | ||
The central-rail segment starts here! | ||
{% endcomment %} | ||
|
||
<div class="eight wide column"> | ||
|
||
{% block content %} | ||
{% endblock %} | ||
|
||
</div> | ||
{% comment %}The central-rail segment ends here!{% endcomment %} | ||
|
||
{% comment %}The right-rail segment starts here!{% endcomment %} | ||
<div class="three wide column"> | ||
<div class="row"> | ||
{% comment %} | ||
TODO: the right rail! | ||
{% endcomment %} | ||
{% block rightcontent %} | ||
{% endblock %} | ||
|
||
</div> | ||
</div> | ||
{% comment %}The right-rail segment ends here!{% endcomment %} | ||
|
||
{% comment %}The right-margin segment!{% endcomment %} | ||
<div class="column"></div> | ||
|
||
</div> | ||
{% comment %}The grid ends here!{% endcomment %} | ||
{% endblock %} | ||
|
||
{% block javascript %} | ||
<script src="https://cdn.rawgit.com/mdehoog/Semantic-UI/6e6d051d47b598ebab05857545f242caf2b4b48c/dist/semantic.min.js"></script> | ||
<script type="text/javascript" src="{% static 'globals/js/datepicker.js' %}"></script> | ||
<script type="text/javascript" src="{% static 'globals/js/tablesort.js' %}"></script> | ||
{% endblock %} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% extends 'examination/base.html' %} | ||
{% block sidetabmenu %} | ||
<div class="ui medium fluid vertical pointing menu" style="max-width: 320px;"> | ||
|
||
<a class="item" href="{% url 'examination:submit' %}">Submit | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="{% url 'examination:verify' %}">Verify | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="{% url 'examination:publish' %}">Publish | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="{% url 'examination:announcement' %}">Announcement | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="#">Time Table | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
</div> | ||
{% endblock %} |
Oops, something went wrong.