From 28ab123154450156642f1a680a7ccfb1d2af6669 Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Tue, 30 Jan 2018 08:04:49 +0300 Subject: [PATCH] Move commets block to separate file --- .../templates/course/blocks/comments.html | 30 ++++++++++++++++ apps/course/templates/course/course.html | 34 +------------------ 2 files changed, 31 insertions(+), 33 deletions(-) create mode 100644 apps/course/templates/course/blocks/comments.html diff --git a/apps/course/templates/course/blocks/comments.html b/apps/course/templates/course/blocks/comments.html new file mode 100644 index 00000000..253c501b --- /dev/null +++ b/apps/course/templates/course/blocks/comments.html @@ -0,0 +1,30 @@ +{% load static %} +{% load mptt_tags %} + +{% recursetree course.comments.all %} + +
+ {% if node.author.photo %} +
+ +
+ {% else %} +
+ +
+ {% endif %} +
+
+
+ {{ node.author.get_full_name }} + {{ node.created_at_humanize }} +
+
{{ node.content }}
+
+
+ +
+
+
+ +{{ children }} {% endrecursetree %} \ No newline at end of file diff --git a/apps/course/templates/course/course.html b/apps/course/templates/course/course.html index fc847874..bea78606 100644 --- a/apps/course/templates/course/course.html +++ b/apps/course/templates/course/course.html @@ -1,6 +1,5 @@ {% extends "templates/lilcity/index.html" %} {% load static %} -{% load mptt_tags %} {% block content %}
@@ -201,38 +200,7 @@
- {% recursetree course.comments.all %} - -
- {% if node.author.photo %} -
- {% else %} -
- {% endif %} -
-
-
{{ node.author.get_full_name }}{{ node.created_at_humanize }}
-
{{ node.content }}
-
-
-
-
- - {% if not node.is_leaf_node %} - {{ children }} - {% endif %} - {% endrecursetree %} - - + {% include "./blocks/comments.html" with course=course %}