Overview
{{ subject.title }}
{{ object.modules.count }} modules.
Instructor: {{ object.owner.get_full_name }}
{{ object.overview|linebreaks }}
{% if request.user.is_authenticated %}
{% else %}
Register to enroll
{% endif %}
{% endwith %}
{% endblock %}
{% extends 'base.html' %}
{% block title %}
{% if subject %}
{{ subject.title }} courses
{% else %}
All courses
{% endif %}
{% endblock %}
{% block content %}
{% if subject %}
{{ subject.title }} courses
{% else %}
All courses
{% endif %}
Subjects
All
{% for s in subjects %}
{{ s.title }}
{{ s.total_courses }} course{{ s.total_courses|pluralize }}
{% endfor %}
{% for course in courses %}
{% with subject=course.subject %}
{{ course.title }}
{{ subject }}
.
{{ course.total_modules }} modules.
Instructor: {{ course.owner.get_full_name }}
{% endwith %}
{% endfor %}
{% endblock %}
17. RGB, CMY, CMYK rang modellari
{% extends 'base.html' %}
{% block title %}
{% if object %}
Edit content "{{ object.title }}"
{% endif %}
{% endblock %}
{% block content %}
{% if object %}
Edit content "{{ object.title }}"
{% else %}
Add new content
{% endif %}
Course info
{% endblock %}
{% extends 'base.html' %}
{% block title %}Delete course {% endblock %}
{% block content %}
Delete course "{{ object }}"
{% endblock %}
{% extends 'base.html' %}
{% block title %}
{% if object %}
Edit course "{{ object.title }}"
{% else %}
Create a new course
{% endif %}
{% endblock %}
{% block content %}
{% if object %}
Edit course "{{ object.title }}"
{% else %}
Create a new course
{% endif %}
Course info
{% endblock %}
{% extends 'base.html' %}
{% block title %}My courses{% endblock %}
{% block content %}
My courses
{% for course in object_list %}
{{ course.title }}
Edit
Delete
Edit
modules
{% if course.modules.count > 0 %}
Manage contents
{% endif %}
{% empty %}
You haven't created any courses yet.
{% endfor %}
Create new course
{% endblock %}
18. HIS rang modeli
{% extends 'base.html' %}
{% load course %}
{% block title %}
Module {{ module.order|add:1 }}: {{ module.title }}
{% endblock %}
{% block content %}
{% with course=module.course %}
Course "{{ course.title }}"
Modules
{% for m in course.modules.all %}
class="selected"{% endif %}>
Module {{ m.order|add:1 }}
{{ m.title }}
{% empty %}
No modules yet.
{% endfor %}
Edit modules
Module {{ module.order|add:1 }}: {{ module.title }}
Module contents:
{% for content in module.contents.all %}
{% with item=content.item %}
{{ item }} {{ item|model_name }}
Edit
method="post">
{% csrf_token %}
{% endwith %}
{% empty %}
This module has no contents yet.
{% endfor %}
Add new content:
{% endwith %}
{% endblock %}
{% block include_js %}
{% endblock %}
{% block domready %}
var options = {
method: 'POST',
mode: 'same-origin'
}
const moduleOrderUrl = '{% url "module_order" %}';
sortable('#modules', {
forcePlaceholderSize: true,
placeholderClass: 'placeholder'
})[0].addEventListener('sortupdate', function(e) {
modulesOrder = {};
var modules = document.querySelectorAll('#modules li');
modules.forEach(function (module, index) {
// update module index
modulesOrder[module.dataset.id] = index;
// update index in HTML element
module.querySelector('.order').innerHTML = index + 1;
// add new order to the HTTP request options
options['body'] = JSON.stringify(modulesOrder);
// send HTTP request
fetch(moduleOrderUrl, options)
});
});
const contentOrderUrl = '{% url "content_order" %}';
sortable('#module-contents', {
forcePlaceholderSize: true,
placeholderClass: 'placeholder'
})[0].addEventListener('sortupdate', function (e) {
contentOrder = {};
var contents = document.querySelectorAll('#module-contents div');
contents.forEach(function (context, index) {
// update content index
contentOrder[content.dataset.id] = index;
// add new order to the HTTP request options
options['body'] = JSON.stringify(contentOrder)
// send HTTP request
fetch(contentOrderUrl, options)
});
});
{% endblock %}
19. Yorqinlik kvantlash.
{% extends "base.html" %}
{% block title %}
Edit "{{ course.title }}"
{% endblock %}
{% block content %}
Edit "{{ course.title }}"
Course modules
{% endblock %}
{% load static %}
html>
{% block title %}Educa{% endblock %}
{% block content %}
{% endblock %}
{% block include_js %}
{% endblock %}
Do'stlaringiz bilan baham: