Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #110 from ryanpitts/development

collapse code_list by tag into single block
  • Loading branch information...
commit b031f5a2f8be012acd3f0acb83c297d81990164b 2 parents 3877b2c + 34a7d57
@rossbruniges rossbruniges authored
Showing with 19 additions and 2 deletions.
  1. +19 −2 source/code/templates/code/code_list.html
View
21 source/code/templates/code/code_list.html
@@ -4,7 +4,22 @@
<h1 class="maintopic"><a href="{{ url('code_list') }}">Code</a>{% if tag %} / <span class="category">{{ tag.name }}</span>{% endif %}</h1>
<div id="filterable-list">
-{% for alpha in object_list|groupby('sort_letter') %}
+{% if tag %}
+ <div class="grouper-block filter-block">
+ <h2 class="grouper-header"><span class="category">Code index entries tagged: {{ tag.name }}</span></h2>
+ {% for code in object_list %}
+ <div class="grid-box">
+ <h3><a href="{{ code.get_absolute_url() }}">{{ code.name }}</a></h3>
+ {% if code.summary_or_description %}<p>{{ code.summary_or_description|safe }}</p>{% endif %}
+ <ul class="link-list">
+ {% if code.get_live_organization_set().exists() %}<li><i class="icon-cogs small"></i>{% for organization in code.get_live_organization_set() %}<a class="small" href="{{ organization.get_absolute_url() }}">{{ organization.name }}</a>{% if not loop.last %}, {% endif %}{% endfor %}</li>{% endif %}
+ {% if code.tags.all().exists() %}<li><i class="icon-tags small"></i>{% for tag in code.tags.all() %}<a class="small" href="{{ url('code_list_by_tag', tag.slug) }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}{% endfor %}</li>{% endif %}
+ </ul>
+ </div>
+ {% endfor %}
+ </div>
+{% else %}
+ {% for alpha in object_list|groupby('sort_letter') %}
<div class="grouper-block filter-block">
<h2 class="grouper-header"><span class="category">{{ alpha.grouper }}</span></h2>
{% for code in alpha.list %}
@@ -18,7 +33,9 @@ <h2 class="grouper-header"><span class="category">{{ alpha.grouper }}</span></h2
</div>
{% endfor %}
</div>
-{% endfor %}
+ {% endfor %}
+
+{% endif %}
</div>
{% endblock content %}
Please sign in to comment.
Something went wrong with that request. Please try again.