From 52abccc4ca76c6f95bf41a7d1fc0b5ae258f5328 Mon Sep 17 00:00:00 2001
From: ankitjavalkar
Date: Mon, 19 Aug 2019 12:51:39 +0530
Subject: Move all download related templates to a new subfolder and add
homepage link to navbar logo
---
yaksh/models.py | 13 +-
.../yaksh/download_course_templates/index.html | 71 +++++++++++
.../yaksh/download_course_templates/module.html | 67 +++++++++++
.../yaksh/download_course_templates/quiz.html | 114 ++++++++++++++++++
.../yaksh/download_course_templates/unit.html | 133 +++++++++++++++++++++
yaksh/templates/yaksh/index.html | 71 -----------
yaksh/templates/yaksh/module.html | 67 -----------
yaksh/templates/yaksh/quiz.html | 114 ------------------
yaksh/templates/yaksh/unit.html | 133 ---------------------
9 files changed, 394 insertions(+), 389 deletions(-)
create mode 100644 yaksh/templates/yaksh/download_course_templates/index.html
create mode 100644 yaksh/templates/yaksh/download_course_templates/module.html
create mode 100644 yaksh/templates/yaksh/download_course_templates/quiz.html
create mode 100644 yaksh/templates/yaksh/download_course_templates/unit.html
delete mode 100644 yaksh/templates/yaksh/index.html
delete mode 100644 yaksh/templates/yaksh/module.html
delete mode 100644 yaksh/templates/yaksh/quiz.html
delete mode 100644 yaksh/templates/yaksh/unit.html
diff --git a/yaksh/models.py b/yaksh/models.py
index c97a616..6881b4f 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -316,7 +316,7 @@ class Lesson(models.Model):
lesson_file.file.name)))
zip_file.writestr(filename, lesson_file.file.read())
unit_file_path = os.sep.join((
- path, "templates", "yaksh", "unit.html"
+ path, "templates", "yaksh", "download_course_templates", "unit.html"
))
lesson_data = {"course": course, "module": module,
"lesson": self, "next_unit": next_unit,
@@ -576,7 +576,7 @@ class Quiz(models.Model):
course_name, module_name, quiz_name
))
unit_file_path = os.sep.join((
- path, "templates", "yaksh", "quiz.html"
+ path, "templates", "yaksh", "download_course_templates", "quiz.html"
))
quiz_data = {"course": course, "module": module,
"quiz": self, "next_unit": next_unit}
@@ -812,7 +812,7 @@ class LearningModule(models.Model):
path)
module_file_path = os.sep.join((
- path, "templates", "yaksh", "module.html"
+ path, "templates", "yaksh", "download_course_templates", "module.html"
))
module_data = {"course": course, "module": self, "units": units}
write_templates_to_zip(zip_file, module_file_path, module_data,
@@ -1079,7 +1079,12 @@ class Course(models.Model):
with zipfile.ZipFile(zip_file_name, "a") as zip_file:
course_name = self.name.replace(" ", "_")
modules = self.get_learning_modules()
- file_path = os.sep.join((path, "templates", "yaksh", "index.html"))
+ file_path = os.sep.join(
+ (
+ path, "templates", "yaksh",
+ "download_course_templates", "index.html"
+ )
+ )
write_static_files_to_zip(zip_file, course_name, path,
static_files)
course_data = {"course": self, "modules": modules}
diff --git a/yaksh/templates/yaksh/download_course_templates/index.html b/yaksh/templates/yaksh/download_course_templates/index.html
new file mode 100644
index 0000000..4b76e85
--- /dev/null
+++ b/yaksh/templates/yaksh/download_course_templates/index.html
@@ -0,0 +1,71 @@
+{% load custom_filters %}
+
+
+
+
+
+
+ {% block pagetitle %} {{course.name}} {% endblock %}
+
+
+
+
+
+
+
+ {% block subtitle %}
+ {{course.name}}
+ {% endblock %}
+
+
+
+
+ {% block content %}
+ {% for module in modules %}
+
+
+
+ {{module.name}}
+
+
+
+
+
+
+
+
+
+
+ {% for lesson in module.get_lesson_units %}
+ - {{lesson.name}}
+ {% endfor %}
+
+
+
+ {% endfor %}
+ {% endblock %}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yaksh/templates/yaksh/download_course_templates/module.html b/yaksh/templates/yaksh/download_course_templates/module.html
new file mode 100644
index 0000000..039eac2
--- /dev/null
+++ b/yaksh/templates/yaksh/download_course_templates/module.html
@@ -0,0 +1,67 @@
+{% load custom_filters %}
+
+
+
+
+
+ {% block pagetitle %} {{module.name}} {% endblock %}
+
+
+
+
+
+
+
+ {% block subtitle %}
+ {{course.name}}
+ {% endblock %}
+
+
+
+{% block content %}
+
{{module.name}}
+
+
+
+ Lessons (Click on lesson name to open lesson)
+
+
+ |
+
+ {{module.html_data|safe}}
+ |
+
+
+{% endblock %}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yaksh/templates/yaksh/download_course_templates/quiz.html b/yaksh/templates/yaksh/download_course_templates/quiz.html
new file mode 100644
index 0000000..48bc12e
--- /dev/null
+++ b/yaksh/templates/yaksh/download_course_templates/quiz.html
@@ -0,0 +1,114 @@
+{% load custom_filters %}
+
+
+
+
+
+
+
+
+ {% block pagetitle %} {{course.name}} {% endblock %}
+
+
+
+
+
+
+
+
+
+
+
+
+ {% block subtitle %}
+ {{course.name}}
+ {% endblock %}
+
+
+
+ {% block content %}
+
{{module.name}}
+
+
+
+
+
+
+
{{quiz.description}}
+ {% if next_unit.type == 'lesson' %}
+
+ Next
+
+ {% else %}
+
+ Next
+
+ {% endif %}
+
+
+ {% endblock %}
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yaksh/templates/yaksh/download_course_templates/unit.html b/yaksh/templates/yaksh/download_course_templates/unit.html
new file mode 100644
index 0000000..7e618c7
--- /dev/null
+++ b/yaksh/templates/yaksh/download_course_templates/unit.html
@@ -0,0 +1,133 @@
+{% load custom_filters %}
+
+
+
+
+
+
+
+
+ {% block pagetitle %} {{module.name}} {% endblock %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {% block subtitle %}
+ {{course.name}}
+ {% endblock %}
+
+
+
+ {% block content %}
+
{{module.name}}
+
+
{{lesson.name}}
+ {% if lesson.video_file %}
+
+ {% endif %}
+
+
+
+
+ {{lesson.html_data|safe}}
+ |
+
+
+
+ {% if lesson_files %}
+ Lesson Files (Click on lesson file to download)
+
+
+ {% else %}
+
+ -
+
No files for {{lesson.name}}
+
+
+ {% endif %}
+ |
+
+
+
+
+ {% if next_unit.type == 'lesson' %}
+
+ Next
+
+ {% else %}
+
+ Next
+
+ {% endif %}
+
+ {% endblock %}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yaksh/templates/yaksh/index.html b/yaksh/templates/yaksh/index.html
deleted file mode 100644
index 90a05fe..0000000
--- a/yaksh/templates/yaksh/index.html
+++ /dev/null
@@ -1,71 +0,0 @@
-{% load custom_filters %}
-
-
-
-
-
-
- {% block pagetitle %} {{course.name}} {% endblock %}
-
-
-
-
-
-
-
- {% block subtitle %}
- {{course.name}}
- {% endblock %}
-
-
-
-
- {% block content %}
- {% for module in modules %}
-
-
-
- {{module.name}}
-
-
-
-
-
-
-
-
-
-
- {% for lesson in module.get_lesson_units %}
- - {{lesson.name}}
- {% endfor %}
-
-
-
- {% endfor %}
- {% endblock %}
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/yaksh/templates/yaksh/module.html b/yaksh/templates/yaksh/module.html
deleted file mode 100644
index b062159..0000000
--- a/yaksh/templates/yaksh/module.html
+++ /dev/null
@@ -1,67 +0,0 @@
-{% load custom_filters %}
-
-
-
-
-
- {% block pagetitle %} {{module.name}} {% endblock %}
-
-
-
-
-
-
-
- {% block subtitle %}
- {{course.name}}
- {% endblock %}
-
-
-
-{% block content %}
-
{{module.name}}
-
-
-
- Lessons (Click on lesson name to open lesson)
-
-
- |
-
- {{module.html_data|safe}}
- |
-
-
-{% endblock %}
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/yaksh/templates/yaksh/quiz.html b/yaksh/templates/yaksh/quiz.html
deleted file mode 100644
index 156a2b1..0000000
--- a/yaksh/templates/yaksh/quiz.html
+++ /dev/null
@@ -1,114 +0,0 @@
-{% load custom_filters %}
-
-
-
-
-
-
-
-
- {% block pagetitle %} {{course.name}} {% endblock %}
-
-
-
-
-
-
-
-
-
-
-
-
- {% block subtitle %}
- {{course.name}}
- {% endblock %}
-
-
-
- {% block content %}
-
{{module.name}}
-
-
-
-
-
-
-
{{quiz.description}}
- {% if next_unit.type == 'lesson' %}
-
- Next
-
- {% else %}
-
- Next
-
- {% endif %}
-
-
- {% endblock %}
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/yaksh/templates/yaksh/unit.html b/yaksh/templates/yaksh/unit.html
deleted file mode 100644
index 45092a6..0000000
--- a/yaksh/templates/yaksh/unit.html
+++ /dev/null
@@ -1,133 +0,0 @@
-{% load custom_filters %}
-
-
-
-
-
-
-
-
- {% block pagetitle %} {{module.name}} {% endblock %}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {% block subtitle %}
- {{course.name}}
- {% endblock %}
-
-
-
- {% block content %}
-
{{module.name}}
-
-
{{lesson.name}}
- {% if lesson.video_file %}
-
- {% endif %}
-
-
-
-
- {{lesson.html_data|safe}}
- |
-
-
-
- {% if lesson_files %}
- Lesson Files (Click on lesson file to download)
-
-
- {% else %}
-
- -
-
No files for {{lesson.name}}
-
-
- {% endif %}
- |
-
-
-
-
- {% if next_unit.type == 'lesson' %}
-
- Next
-
- {% else %}
-
- Next
-
- {% endif %}
-
- {% endblock %}
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
--
cgit