Skip to content

Commit

Permalink
Moved module list item template code out into included template
Browse files Browse the repository at this point in the history
  • Loading branch information
robgolding committed May 11, 2010
1 parent 1d678b2 commit dc4a982
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 5 additions & 3 deletions myuni/templates/course/modules/module_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
{% block header-block %}{% endblock header-block %}

{% block content-block %}
{% for module in object_list %}
<div class="block">
<h3><a href="{{ module.get_absolute_url }}">{{ module.code }}: {{ module.name }}, {{ module.get_semester_display }} {{ module.get_year_display }}</a></h3>
<ul>
{% for module in object_list %}
{% include 'course/modules/module_list_item.html' %}
{% endfor %}
</ul>
</div>
{% endfor %}
{% endblock content-block %}
8 changes: 5 additions & 3 deletions myuni/templates/course/modules/module_list_all.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
{% block header-block %}{% endblock header-block %}

{% block content-block %}
{% for module in object_list %}
<div class="block">
<h3><a href="{{ module.get_absolute_url }}">{{ module.code }}: {{ module.name }}, {{ module.get_semester_display }} {{ module.get_year_display }}</a></h3>
<ul>
{% for module in object_list %}
{% include 'course/modules/module_list_item.html' %}
{% endfor %}
</ul>
</div>
{% endfor %}
{% endblock content-block %}
4 changes: 4 additions & 0 deletions myuni/templates/course/modules/module_list_item.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% ifchanged module.year %}
<h3>{{ module.get_year_display }}</h3>
{% endifchanged %}
<li><a href="{{ module.get_absolute_url }}">{{ module.code }}: {{ module.name }}</a></li>

0 comments on commit dc4a982

Please sign in to comment.