{% block title %}Educa{% endblock %}


Download 1.34 Mb.
bet2/2
Sana08.04.2023
Hajmi1.34 Mb.
#1341477
1   2
Bog'liq
Doniyor

Overview

{{ subject.title }}


{{ object.modules.count }} modules.
Instructor: {{ object.owner.get_full_name }}

{{ object.overview|linebreaks }}


{% if request.user.is_authenticated %}

{{ enroll_form }}
{% csrf_token %}


{% 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



{{ form.as_p }}
{% csrf_token %}



{% endblock %}

{% extends 'base.html' %}

{% block title %}Delete course {% endblock %}

{% block content %}


Delete course "{{ object }}"




{% csrf_token %}

Are you sure you want to delete "{{ 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



{{ form.as_p }}
{% csrf_token %}





{% 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:



  • Text



  • Image



  • Video



  • File





{% 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



{{ formset }}
{{ formset.management_form }}
{% csrf_token %}



{% endblock %}

{% load static %}


html>



{% block title %}Educa{% endblock %}





{% block content %}

{% endblock %}



{% block include_js %}

{% endblock %}



Download 1.34 Mb.

Do'stlaringiz bilan baham:
1   2




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling