huh new thing
This commit is contained in:
125 files changed
+2195
-21409
No files matched your search
@@ -0,0 +1,135 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}{{ title }}{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
font-size: 1rem;
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
|
||||
.btn-back {
|
||||
background-color: #6c757d;
|
||||
border-color: #6c757d;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-back:hover {
|
||||
background-color: #5a6268;
|
||||
border-color: #545b62;
|
||||
}
|
||||
|
||||
.btn-submit {
|
||||
background-color: #007bff;
|
||||
border-color: #007bff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-submit:hover {
|
||||
background-color: #0056b3;
|
||||
border-color: #004085;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Add Academic Year</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a href="{% url 'manage_academicyear' %}" class="btn btn-back">
|
||||
<i class="fas fa-arrow-left me-1"></i> Back to Academic Years
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post" class="needs-validation" novalidate>
|
||||
{% csrf_token %}
|
||||
<!-- Start Date -->
|
||||
<div class="form-group">
|
||||
<label for="start_date" class="required-field">Start Date</label>
|
||||
<input type="date"
|
||||
class="form-control"
|
||||
id="start_date"
|
||||
name="start_date"
|
||||
required />
|
||||
<div class="invalid-feedback">Please provide a valid start date</div>
|
||||
</div>
|
||||
{% if messages %}
|
||||
<div class="mb-4">
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{{ message.tags }} alert-dismissible fade show">
|
||||
{{ message }}
|
||||
<button type="button"
|
||||
class="btn-close"
|
||||
data-bs-dismiss="alert"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<a href="{% url 'manage_academicyear' %}" class="btn btn-back">
|
||||
<i class="fas fa-times"></i> Cancel
|
||||
</a>
|
||||
<button type="submit" class="btn btn-submit">
|
||||
<i class="fas fa-save"></i> Save Academic Year
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block extrajs %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
// Form validation
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
const forms = document.querySelectorAll(".needs-validation");
|
||||
|
||||
Array.from(forms).forEach((form) => {
|
||||
form.addEventListener(
|
||||
"submit",
|
||||
(event) => {
|
||||
if (!form.checkValidity()) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
form.classList.add("was-validated");
|
||||
},
|
||||
false,
|
||||
);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,138 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}Add Course{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet">
|
||||
<style>
|
||||
.required-field::after {
|
||||
content: "*";
|
||||
color: red;
|
||||
margin-left: 4px;
|
||||
}
|
||||
.help-text {
|
||||
font-size: 0.875rem;
|
||||
color: #6c757d;
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
.page-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 1rem;
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
.page-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin: 0;
|
||||
}
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">
|
||||
<i class="nav-icon fas fa-book"></i>
|
||||
Add Course
|
||||
</h1>
|
||||
<a href="/manage_course" class="btn btn-primary">
|
||||
<i class="fas fa-list"></i> Manage Course
|
||||
</a>
|
||||
</div>
|
||||
<div class="container py-4">
|
||||
<div class="card">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h2 class="h4 mb-0">{{ title|default:"Add New Course" }}</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" class="needs-validation" novalidate>
|
||||
{% csrf_token %}
|
||||
<!-- Course Name -->
|
||||
<div class="form-group mb-4">
|
||||
<label for="name" class="required-field">Course Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="name"
|
||||
name="name"
|
||||
placeholder="Enter course name"
|
||||
required>
|
||||
<div class="help-text">Course name must be unique</div>
|
||||
<div class="invalid-feedback">Please enter a course name</div>
|
||||
</div>
|
||||
<!-- Course Type -->
|
||||
<div class="form-group mb-4">
|
||||
<label for="course_type" class="required-field">Course Type</label>
|
||||
<select class="form-control" id="course_type" name="course_type" required>
|
||||
<option value="">Select Course Type</option>
|
||||
<option value="semester">Semester-based</option>
|
||||
<option value="year">Year-based</option>
|
||||
</select>
|
||||
<div class="invalid-feedback">Please select a course type</div>
|
||||
</div>
|
||||
<!-- Duration -->
|
||||
<div class="form-group mb-4">
|
||||
<label for="duration" class="required-field">Duration</label>
|
||||
<input type="number"
|
||||
class="form-control"
|
||||
id="duration"
|
||||
name="duration"
|
||||
placeholder="Enter duration"
|
||||
min="1"
|
||||
required>
|
||||
<div class="help-text">Specify the duration</div>
|
||||
<div class="invalid-feedback">Please enter a valid duration (minimum 1 month)</div>
|
||||
</div>
|
||||
{% if messages %}
|
||||
<div class="mb-4">
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{{ message.tags }} alert-dismissible fade show">
|
||||
{{ message }}
|
||||
<button type="button"
|
||||
class="btn-close"
|
||||
data-bs-dismiss="alert"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<a href="/manage_course" class="btn btn-secondary">
|
||||
<i class="fas fa-times"></i> Cancel
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-save"></i> Save Course
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block extrajs %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
// Form validation
|
||||
(function () {
|
||||
'use strict'
|
||||
|
||||
const forms = document.querySelectorAll('.needs-validation')
|
||||
|
||||
Array.from(forms).forEach(form => {
|
||||
form.addEventListener('submit', event => {
|
||||
if (!form.checkValidity()) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
form.classList.add('was-validated')
|
||||
}, false)
|
||||
})
|
||||
})()
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,54 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}Add Subject{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Add Subject</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a href="{% url 'manage_subject' %}" class="btn btn-secondary">
|
||||
<i class="fas fa-arrow-left me-1"></i> Back to Subjects
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post" class="needs-validation" novalidate>
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,55 @@
|
||||
{% extends 'admin/base_site.html' %}
|
||||
{% block content %}
|
||||
<div class="container-fluid mt-3">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="card card-info text-center">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-user-graduate fa-3x"></i>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Total Students</h5>
|
||||
<p class="card-text display-4">{{ student_count }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="card card-success text-center">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-chalkboard-teacher fa-3x"></i>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Total Teachers</h5>
|
||||
<p class="card-text display-4">{{ teacher_count }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="card card-warning text-center">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-book-open fa-3x"></i>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Total Courses</h5>
|
||||
<p class="card-text display-4">{{ course_count }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="card card-danger text-center">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-book fa-3x"></i>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Total Subjects</h5>
|
||||
<p class="card-text display-4">{{ subject_count }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,94 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}{{ title }}{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
font-size: 1rem;
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
|
||||
.btn-back {
|
||||
background-color: #6c757d;
|
||||
border-color: #6c757d;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-back:hover {
|
||||
background-color: #5a6268;
|
||||
border-color: #545b62;
|
||||
}
|
||||
|
||||
.btn-submit {
|
||||
background-color: #007bff;
|
||||
border-color: #007bff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-submit:hover {
|
||||
background-color: #0056b3;
|
||||
border-color: #004085;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Edit Academic Year</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a href="{% url 'manage_academicyear' %}" class="btn btn-back">
|
||||
<i class="fas fa-arrow-left me-1"></i> Back to Academic Years
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label for="start_date">Start Date</label>
|
||||
<!-- Display the previous date value here -->
|
||||
<input type="date"
|
||||
class="form-control"
|
||||
id="start_date"
|
||||
name="start_date"
|
||||
value="{{ academic_year.start_date|date:'Y-m-d' }}"
|
||||
required />
|
||||
</div>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
<button type="submit" class="btn btn-submit">
|
||||
<i class="fas fa-save me-1"></i> Save Changes
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,152 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}{{ title }}{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.required-field::after {
|
||||
content: "*";
|
||||
color: red;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.help-text {
|
||||
font-size: 0.875rem;
|
||||
color: #6c757d;
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 1rem;
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">
|
||||
<i class="nav-icon fas fa-edit"></i>
|
||||
Edit Course
|
||||
</h1>
|
||||
<a href="{% url 'manage_course' %}" class="btn btn-primary">
|
||||
<i class="fas fa-list"></i> Back to Courses
|
||||
</a>
|
||||
</div>
|
||||
<div class="container py-4">
|
||||
<div class="card">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h2 class="h4 mb-0">Edit Course: {{ course.name }}</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" class="needs-validation" novalidate>
|
||||
{% csrf_token %}
|
||||
<!-- Course Name -->
|
||||
<div class="form-group mb-4">
|
||||
<label for="name" class="required-field">Course Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="name"
|
||||
name="name"
|
||||
value="{{ course.name }}"
|
||||
placeholder="Enter course name"
|
||||
required />
|
||||
<div class="help-text">Course name must be unique</div>
|
||||
<div class="invalid-feedback">Please enter a course name</div>
|
||||
</div>
|
||||
<!-- Course Type -->
|
||||
<div class="form-group mb-4">
|
||||
<label for="course_type" class="required-field">Course Type</label>
|
||||
<select class="form-control" id="course_type" name="course_type" required>
|
||||
<option value="">Select Course Type</option>
|
||||
<option value="semester"
|
||||
{% if course.course_type == "semester" %}selected{% endif %}>
|
||||
Semester-based
|
||||
</option>
|
||||
<option value="year" {% if course.course_type == "year" %}selected{% endif %}>Year-based</option>
|
||||
</select>
|
||||
<div class="invalid-feedback">Please select a course type</div>
|
||||
</div>
|
||||
<!-- Duration -->
|
||||
<div class="form-group mb-4">
|
||||
<label for="duration" class="required-field">Duration</label>
|
||||
<input type="number"
|
||||
class="form-control"
|
||||
id="duration"
|
||||
name="duration"
|
||||
value="{{ course.duration }}"
|
||||
placeholder="Enter duration in months"
|
||||
min="1"
|
||||
required />
|
||||
<div class="help-text">Specify the duration in months</div>
|
||||
<div class="invalid-feedback">Please enter a valid duration (minimum 1 month)</div>
|
||||
</div>
|
||||
{% if messages %}
|
||||
<div class="mb-4">
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{{ message.tags }} alert-dismissible fade show">
|
||||
{{ message }}
|
||||
<button type="button"
|
||||
class="btn-close"
|
||||
data-bs-dismiss="alert"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<a href="{% url 'manage_course' %}" class="btn btn-secondary">
|
||||
<i class="fas fa-times"></i> Cancel
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-save"></i> Update Course
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block extrajs %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
// Form validation
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
const forms = document.querySelectorAll(".needs-validation");
|
||||
|
||||
Array.from(forms).forEach((form) => {
|
||||
form.addEventListener(
|
||||
"submit",
|
||||
(event) => {
|
||||
if (!form.checkValidity()) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
form.classList.add("was-validated");
|
||||
},
|
||||
false,
|
||||
);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,54 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}Edit Subject{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Edit Subject</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a href="{% url 'manage_subject' %}" class="btn btn-secondary">
|
||||
<i class="fas fa-arrow-left me-1"></i> Back to Subjects
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post" class="needs-validation" novalidate>
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,181 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}{{ title }}{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.table {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.table thead th {
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 2px solid #dee2e6;
|
||||
color: #495057;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.table td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
border-radius: 0.25rem;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.btn-edit {
|
||||
background-color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-edit:hover {
|
||||
background-color: #e0a800;
|
||||
border-color: #d39e00;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-delete {
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-delete:hover {
|
||||
background-color: #c82333;
|
||||
border-color: #bd2130;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding: 3rem;
|
||||
text-align: center;
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.empty-state-icon {
|
||||
font-size: 3rem;
|
||||
color: #6c757d;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
max-width: 300px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Academic Year Management</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span class="course-count me-3">Total Academic Years: {{ academic_years|length }}</span>
|
||||
<a href="{% url 'add_academicyear' %}" class="btn btn-primary">
|
||||
<i class="fas fa-plus me-1"></i>Add New Academic Year
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<!-- Search and Filter -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="search-box">
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="academicyearSearch"
|
||||
placeholder="Search academic years..." />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if academic_years %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">S.N</th>
|
||||
<th width="40%">Start Date</th>
|
||||
<th width="30%">Created At</th>
|
||||
<th width="20%">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for academic_year in academic_years %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ academic_year.start_date }}</td>
|
||||
<td>{{ academic_year.created_at }}</td>
|
||||
<td>
|
||||
<a href="{% url 'edit_academicyear' academic_year.id %}"
|
||||
class="btn btn-action btn-edit me-2">
|
||||
<i class="fas fa-edit me-1"></i>Edit
|
||||
</a>
|
||||
<a href="{% url 'delete_academicyear' academic_year.id %}"
|
||||
class="btn btn-action btn-delete">
|
||||
<i class="fas fa-trash-alt me-1"></i>Delete
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<i class="fas fa-calendar-alt empty-state-icon"></i>
|
||||
<h3>No Academic Years Found</h3>
|
||||
<p class="text-muted">Start by adding your first academic year using the button above.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block extrajs %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
document
|
||||
.getElementById("academicyearSearch")
|
||||
.addEventListener("keyup", function () {
|
||||
const searchText = this.value.toLowerCase();
|
||||
const tableRows = document.querySelectorAll("tbody tr");
|
||||
|
||||
tableRows.forEach((row) => {
|
||||
const startDate = row.cells[1].textContent.toLowerCase();
|
||||
|
||||
if (startDate.includes(searchText)) {
|
||||
row.style.display = "";
|
||||
} else {
|
||||
row.style.display = "none";
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,194 @@
|
||||
{% extends "admin/base_site.html" %} {% block page_title %}{{ title }}
|
||||
{%endblock %} {% load static %} {% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.table {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.table thead th {
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 2px solid #dee2e6;
|
||||
color: #495057;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.table td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
border-radius: 0.25rem;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.btn-edit {
|
||||
background-color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-edit:hover {
|
||||
background-color: #e0a800;
|
||||
border-color: #d39e00;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-delete {
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-delete:hover {
|
||||
background-color: #c82333;
|
||||
border-color: #bd2130;
|
||||
}
|
||||
|
||||
.course-count {
|
||||
background-color: #e9ecef;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 0.25rem;
|
||||
font-size: 0.875rem;
|
||||
color: #495057;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding: 3rem;
|
||||
text-align: center;
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.empty-state-icon {
|
||||
font-size: 3rem;
|
||||
color: #6c757d;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
max-width: 300px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %} {% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Course Management</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span class="course-count me-3">
|
||||
Total Courses: {{ courses|length }}
|
||||
</span>
|
||||
<a href="{% url 'add_course' %}" class="btn btn-primary">
|
||||
<i class="fas fa-plus me-1"></i>Add New Course
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<!-- Search and Filter -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="search-box">
|
||||
<input type="text" class="form-control" id="courseSearch" placeholder="Search courses..." />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if courses %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">S.N</th>
|
||||
<th width="30%">Course Name</th>
|
||||
<th width="20%">Course Type</th>
|
||||
<th width="25%">Duration</th>
|
||||
<th width="20%">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for course in courses %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ course.name }}</td>
|
||||
<td>{{ course.get_course_type_display }}</td>
|
||||
<td>
|
||||
{{ course.duration }} {% if course.course_type == 'semester' %}
|
||||
Semesters {% else %} Years {% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url 'edit_course' course.id %}" class="btn btn-action btn-edit me-2">
|
||||
<i class="fas fa-edit me-1"></i>Edit
|
||||
</a>
|
||||
<a href="{% url 'delete_course' course.id %}" class="btn btn-action btn-delete">
|
||||
<i class="fas fa-trash-alt me-1"></i>Delete
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<i class="fas fa-book empty-state-icon"></i>
|
||||
<h3>No Courses Found</h3>
|
||||
<p class="text-muted">
|
||||
Start by adding your first course using the button above.
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% block extrajs %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
document
|
||||
.getElementById("courseSearch")
|
||||
.addEventListener("keyup", function () {
|
||||
const searchText = this.value.toLowerCase();
|
||||
const tableRows = document.querySelectorAll("tbody tr");
|
||||
|
||||
tableRows.forEach((row) => {
|
||||
const courseName = row.cells[1].textContent.toLowerCase();
|
||||
const courseType = row.cells[2].textContent.toLowerCase();
|
||||
|
||||
if (
|
||||
courseName.includes(searchText) ||
|
||||
courseType.includes(searchText)
|
||||
) {
|
||||
row.style.display = "";
|
||||
} else {
|
||||
row.style.display = "none";
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %} {% endblock %}
|
||||
@@ -0,0 +1,97 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}Manage Subjects{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.course-filter, .duration-filter {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="container py-4">
|
||||
<h1 class="h3 mb-4">Manage Subjects</h1>
|
||||
<!-- Course Filter -->
|
||||
<div class="course-filter">
|
||||
<form method="get" class="form-inline">
|
||||
<div class="form-group mb-3">
|
||||
<label for="course" class="form-label">Select Course</label>
|
||||
<select class="form-control" id="course" name="course">
|
||||
<option value="">All Courses</option>
|
||||
{% for course in courses %}
|
||||
<option value="{{ course.id }}"
|
||||
{% if course.id == selected_course_id %}selected{% endif %}>
|
||||
{{ course.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<!-- Duration Filter -->
|
||||
<div class="form-group mb-3">
|
||||
<label for="duration" class="form-label">Select Duration</label>
|
||||
<select class="form-control" id="duration" name="duration">
|
||||
<option value="">All Durations</option>
|
||||
<option value="1" {% if selected_duration == "1" %}selected{% endif %}>1</option>
|
||||
<option value="2" {% if selected_duration == "2" %}selected{% endif %}>2</option>
|
||||
<option value="3" {% if selected_duration == "3" %}selected{% endif %}>3</option>
|
||||
<option value="4" {% if selected_duration == "4" %}selected{% endif %}>4</option>
|
||||
<option value="5" {% if selected_duration == "5" %}selected{% endif %}>5</option>
|
||||
<option value="6" {% if selected_duration == "6" %}selected{% endif %}>6</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-search"></i> Filter
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<!-- Subjects Table -->
|
||||
{% if subjects %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">S.N</th>
|
||||
<th width="30%">Subject Name</th>
|
||||
<th width="20%">Course Name</th>
|
||||
<th width="25%">Duration</th>
|
||||
<th width="20%">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for subject in subjects %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ subject.name }}</td>
|
||||
<td>{{ subject.course.name }}</td>
|
||||
<td>
|
||||
{{ subject.duration }}
|
||||
{% if subject.course.course_type == 'semester' %}
|
||||
Semesters
|
||||
{% else %}
|
||||
Years
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url 'edit_subject' subject.id %}"
|
||||
class="btn btn-action btn-edit me-2">
|
||||
<i class="fas fa-edit me-1"></i>Edit
|
||||
</a>
|
||||
<a href="{% url 'delete_subject' subject.id %}"
|
||||
class="btn btn-action btn-delete">
|
||||
<i class="fas fa-trash-alt me-1"></i>Delete
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-info">No subjects found for the selected filters.</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user