options = []
for tag in models.Tag.objects.exclude(category='book').filter(slug=ambiguous_slugs[0]):
options.append({
- 'url_args': '/'.join((beginning, tag.url_chunk, unparsed)).rstrip('/'),
- 'tags': tags + [tag]
+ 'url_args': '/'.join((beginning, tag.url_chunk, unparsed)).strip('/'),
+ 'tags': [tag]
})
return render_to_response('catalogue/differentiate_tags.html',
- {'tags': tags, 'options': options, 'unparsed': unparsed},
+ {'tags': tags, 'options': options, 'unparsed': ambiguous_slugs[1:]},
context_instance=RequestContext(request))
<div id="books-list">
{% for option in options %}
<div class="book-description"
- <p><a href="{% url tagged_object_list option.url_args %}">{% title_from_tags option.tags %}{% if unparsed %}, …{% endif %}</a></p>
+ <p><a href="{% url tagged_object_list option.url_args %}">{% if tags %}{% title_from_tags tags %}, {% endif %}<em>{%title_from_tags option.tags %}</em>{% if unparsed %}, {{unparsed|join:', '}}{% endif %}</a></p>
</div>
{% endfor %}
</div>