0% found this document useful (0 votes)
30 views3 pages

#24 Add Student (Frontend)

This document outlines the addition of a "Add Student" feature to the frontend of a student management system. It includes modifications to the sidebar navigation, addition of a URL pattern and view function, and creation of an add_student.html template to render a form for collecting student details. The form includes fields for profile photo, names, email, username, password, address, gender, course, and session year.

Uploaded by

Shubham Bhade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views3 pages

#24 Add Student (Frontend)

This document outlines the addition of a "Add Student" feature to the frontend of a student management system. It includes modifications to the sidebar navigation, addition of a URL pattern and view function, and creation of an add_student.html template to render a form for collecting student details. The form includes fields for profile photo, names, email, username, password, address, gender, course, and session year.

Uploaded by

Shubham Bhade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

#24 Add Student (Frontend)

------------------------------------

sidebar.html
----------------
<li class="{% active_link 'hod_home' 'active' %}">
<a href="{% url 'hod_home' %}"><i class="fas fa-holly-
berry"></i> <span>Dashboard</span></a>
</li>
<li class="submenu {% active_link 'add_student' 'active' %} {%
active_link 'view_student' 'active' %}">
<a href="#"><i class="fas fa-user-graduate"></i> <span>
Students</span> <span class="menu-arrow"></span></a>
<ul>

<li><a href="{% url 'add_student' %}">Add


Student</a></li>
<li><a href="{% url 'view_student' %}">View
Student</a></li>
</ul>
</li>

urls.py
----------
path('Hod/Student/Add',Hod_Views.ADD_STUDENT,name='add_student'),

views.py
------------
@login_required(login_url='/')
def ADD_STUDENT(request):
return render(request,'Hod/add_student.html',context)

add_student.html
-------------------
{% extends 'base.html' %}
{% block content %}
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-body">
<form method="post" action="#" enctype="multipart/form-data">
{% csrf_token %}
<div class="col-12">
<h5 class="form-title"><span>Add Student</span></h5>
</div>
{% if messages %}
{% for message in messages %}
{% if message.tags == 'error' %}
<div class="alert alert-warning alert-dismissible fade show"
role="alert">
{{message}}
<button type="button" class="close" data-dismiss="alert" aria-
label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
{% endif %}
{% endfor %}
{% endif %}
{% if messages %}
{% for message in messages %}
{% if message.tags == 'success' %}
<div class="alert alert-warning alert-dismissible fade show"
role="alert">
{{message}}
<button type="button" class="close" data-dismiss="alert" aria-
label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
{% endif %}
{% endfor %}
{% endif %}
<div class="col-sm-11">
<div class="form-group">
<label>Profile Pic</label>
<input type="file" class="form-control" name="profile_pic">
</div>
</div>
<div class="col-sm-11">
<div class="form-group">
<label>First Name</label>
<input type="text" class="form-control" name="first_name" >
</div>
</div>
<div class="col-sm-11">
<div class="form-group">
<label>Last Name</label>
<input type="text" class="form-control" name="last_name" >
</div>
</div>
<div class="col-sm-11">
<div class="form-group">
<label>Email</label>
<input type="text" class="form-control" name="email">
</div>
</div>
<div class="col-sm-11">
<div class="form-group">
<label>Username</label>
<input type="text" class="form-control" name="username>
</div>
</div>
<div class="col-sm-11">
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control" name="password">
</div>
</div>
<div class="col-sm-11">
<div class="form-group">
<label>Address</label>
<textarea class="form-control" name="address"
required></textarea>
</div>
</div>
<br>
<div class="col-sm-11">
<label>Gender</label>
<select class="form-control" name="gender" required>
<option>Select Gender</option>
<option value="Female">Female</option>
<option value="Male">Male</option>
<option value="Others">Others</option>
</select>
</div>
<br>
<div class="col-sm-11">
<label>Course</label>
<select class="form-control" name="course_id" required>
<option>Select Gender</option>
<option value="Female">Female</option>
<option value="Male">Male</option>
<option value="Others">Others</option>
</select>
</div>
<br>
<div class="col-sm-11">
<label>session year</label>
<select class="form-control" name="session_year_id" required>
<option>Select Gender</option>
<option value="Female">Female</option>
<option value="Male">Male</option>
<option value="Others">Others</option>
</select>
</div>
<div class="col-12">
<button type="submit" class="btn btn-primary">Add
Student</button>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}

You might also like