split note_list_entry out of course_detail into a new template file, fixes #6
authorSeth Woodworth <seth@sethish.com>
Thu, 18 Apr 2013 16:51:34 +0000 (12:51 -0400)
committerSeth Woodworth <seth@sethish.com>
Thu, 18 Apr 2013 16:51:34 +0000 (12:51 -0400)
karmaworld/templates/courses/course_detail.html
karmaworld/templates/notes/note_list_entry.html [new file with mode: 0644]

index 8ef92b3ef1a49f93602c3c2828859304acd93e63..cc922366eddc2b71581d0890ff79be4a98b494b3 100644 (file)
         <div class="ten columns offset-by-one">
 
           {% for note in course.note_set.all %}
-
-          <div class="row notes_result_container wide">
-            <div class="twelve columns notes_result">
-
-              <div class="note_name">
-                <a href="{{ note.get_absolute_url }}" class="activity_target">{{ note.name }}</a>
-              </div>
-
-              <time datetime="{{ note.uploaded_at }}">
-                {{ note.uploaded_at|date:"l M d o" }}
-              </time>
-
-              {% if note.tags.count > 0 %}
-              <div class="activity_details_context">
-                Tags:
-                  {% for tag in note.tags.all %}
-                    {{ tag.name }}
-                    {% if not forloop.last %}, {% endif %}
-                  {% endfor %}
-              </div>
-              {% endif %}
-
-
-              <div class="note_preview">
-                {{ note.text|slice:":500" }} &hellip;
-              </div>
-
-
-            </div><!-- /notes_result -->
-          </div><!-- /notes_result_container -->
-
-          <hr class=midrule>
-
+            {% include 'notes/note_list_entry.html' with note=note %}
           {% endfor %}
         </div>
       </div>
diff --git a/karmaworld/templates/notes/note_list_entry.html b/karmaworld/templates/notes/note_list_entry.html
new file mode 100644 (file)
index 0000000..1b9702e
--- /dev/null
@@ -0,0 +1,31 @@
+<div class="row notes_result_container wide">
+  <div class="twelve columns notes_result">
+
+    <div class="note_name">
+      <a href="{{ note.get_absolute_url }}" class="activity_target">{{ note.name }}</a>
+    </div>
+
+    <time datetime="{{ note.uploaded_at }}">
+      {{ note.uploaded_at|date:"l M d o" }}
+    </time>
+
+    {% if note.tags.count > 0 %}
+    <div class="activity_details_context">
+      Tags:
+        {% for tag in note.tags.all %}
+          {{ tag.name }}
+          {% if not forloop.last %}, {% endif %}
+        {% endfor %}
+    </div>
+    {% endif %}
+
+
+    <div class="note_preview">
+      {{ note.text|slice:":500" }} &hellip;
+    </div>
+
+
+  </div><!-- /notes_result -->
+</div><!-- /notes_result_container -->
+
+<hr class=midrule>