shcool / templates /grades /form.html
CORVO-AI's picture
Upload 111 files
b7f55e1 verified
Raw
History Blame Contribute Delete
3.3 kB
{% extends 'base.html' %}
{% block title %}{{ title }}{% endblock %}
{% block page_title %}{{ title }}{% endblock %}
{% block content %}
<div class="page-header">
<div class="page-header-left"><h1 class="page-title">{{ title }}</h1></div>
<a href="{% url 'grade_list' %}" class="btn btn-secondary"><i data-lucide="arrow-left" style="width:15px;height:15px;"></i> Back</a>
</div>
<div class="card" style="max-width:560px;">
<div class="card-body">
<form method="post">
{% csrf_token %}
<div class="form-group">
<label class="form-label">Student *</label>
<select name="student" class="form-control" required>
<option value="">— Select student —</option>
{% for student in form.student.field.queryset %}
<option value="{{ student.pk }}" {% if form.student.value|stringformat:"s" == student.pk|stringformat:"s" %}selected{% endif %}>{{ student.full_name }} ({{ student.student_id }})</option>
{% endfor %}
</select>
</div>
<div class="form-grid">
<div class="form-group">
<label class="form-label">Subject *</label>
<select name="subject" class="form-control" required>
<option value="">— Select subject —</option>
{% for subject in form.subject.field.queryset %}
<option value="{{ subject.pk }}" {% if form.subject.value|stringformat:"s" == subject.pk|stringformat:"s" %}selected{% endif %}>{{ subject.name }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label class="form-label">Term *</label>
<select name="term" class="form-control" required>
<option value="1" {% if form.term.value == '1' %}selected{% endif %}>Term 1</option>
<option value="2" {% if form.term.value == '2' %}selected{% endif %}>Term 2</option>
<option value="3" {% if form.term.value == '3' %}selected{% endif %}>Term 3</option>
<option value="final" {% if form.term.value == 'final' %}selected{% endif %}>Final</option>
</select>
</div>
</div>
<div class="form-grid">
<div class="form-group">
<label class="form-label">Score *</label>
<input type="number" name="score" value="{{ form.score.value|default:'' }}" class="form-control" step="0.01" min="0" required />
</div>
<div class="form-group">
<label class="form-label">Max Score</label>
<input type="number" name="max_score" value="{{ form.max_score.value|default:'100' }}" class="form-control" step="0.01" min="1" />
</div>
</div>
<div class="form-group">
<label class="form-label">Academic Year</label>
<input type="text" name="academic_year" value="{{ form.academic_year.value|default:'2024-2025' }}" class="form-control" />
</div>
<div class="form-group">
<label class="form-label">Remarks</label>
<textarea name="remarks" class="form-control" rows="2" placeholder="Optional remarks…">{{ form.remarks.value|default:'' }}</textarea>
</div>
<div style="display:flex;gap:10px;margin-top:8px;">
<button type="submit" class="btn btn-primary"><i data-lucide="save" style="width:15px;height:15px;"></i> Save Grade</button>
<a href="{% url 'grade_list' %}" class="btn btn-secondary">Cancel</a>
</div>
</form>
</div>
</div>
{% endblock %}