49 lines
2.7 KiB
HTML
49 lines
2.7 KiB
HTML
<!-- Upload File Modal -->
|
|
<div id="uploadFileModal" style="display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.5); z-index: 10000;" onclick="if(event.target === this) closeUploadModal();">
|
|
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 600px; background-color: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.2);">
|
|
<div style="background-color: #3F51B5; color: white; padding: 15px; border-top-left-radius: 8px; border-top-right-radius: 8px; display: flex; justify-content: space-between; align-items: center;">
|
|
<h5 style="margin: 0; font-size: 18px;">Upload Study Material</h5>
|
|
<button style="background: none; border: none; color: white; font-size: 24px; cursor: pointer; line-height: 24px;" onclick="closeUploadModal()">×</button>
|
|
</div>
|
|
<div style="padding: 20px;">
|
|
<form id="uploadFileForm" method="post" action="/app/manage-subject-files/" enctype="multipart/form-data">
|
|
{% csrf_token %}
|
|
|
|
<div class="mb-3">
|
|
<label for="subject_id" class="form-label">Subject</label>
|
|
<select class="form-select" id="subject_id" name="subject_id" required>
|
|
<option value="">Select a subject</option>
|
|
{% for subject in teacher_subjects %}
|
|
<option value="{{ subject.subject.id }}">{{ subject.subject.name }} ({{ subject.course.name }})</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="title" class="form-label">Title</label>
|
|
<input type="text" class="form-control" id="title" name="title" required placeholder="e.g. Chapter 1 Notes">
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="description" class="form-label">Description (Optional)</label>
|
|
<textarea class="form-control" id="description" name="description" rows="2" placeholder="Brief description of the material"></textarea>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="file" class="form-label">File</label>
|
|
<input type="file" class="form-control" id="file" name="file" required>
|
|
<div class="form-text">Upload PDF, DOCX, PPT or other study materials. Max file size: 10MB</div>
|
|
</div>
|
|
|
|
<div id="uploadResponse" style="display: none;" class="alert mb-3"></div>
|
|
|
|
<div class="d-flex justify-content-end">
|
|
<button type="button" class="btn btn-secondary me-2" onclick="closeUploadModal()">Cancel</button>
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="fas fa-upload me-1"></i> Upload
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div> |