Skip to content

Commit

Permalink
Merge pull request #6171 from escattone/fix-1937
Browse files Browse the repository at this point in the history
fix relevant topics widget for docs
  • Loading branch information
akatsoulas authored Aug 7, 2024
2 parents 290f377 + 7bbd4b3 commit 09294c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions kitsune/wiki/jinja2/wiki/includes/product_topics_widget.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<section id="accordion" class="mzp-c-details products">
{% for product_title, topics in topics_by_product.items() %}
<h3 class="sumo-card-heading">{{ product_title }}</h3>
{% for product, topics in topics_by_product.items() %}
<h3 class="sumo-card-heading">{{ product.title }}</h3>
<ul class="checkbox-list">
{% for topic in topics %}
<li>
<div class="field checkbox is-condensed">
<input type="checkbox" name="{{ name }}" id="id_{{ topic.id }}" value="{{ topic.id }}"{% if topic.checked %} checked{% endif %}/>
<label for="id_{{ topic.id }}">{{ topic.title }}</label>
<input type="checkbox" name="{{ name }}" id="id_{{ product.id }}_{{ topic.id }}" value="{{ topic.id }}"{% if topic.checked %} checked{% endif %}/>
<label for="id_{{ product.id }}_{{ topic.id }}">{{ topic.title }}</label>
</div>
{% if topic.my_subtopics %}
<ul class="checkbox-list--sublist">
{% for subtopic in topic.my_subtopics %}
<li>
<div class="field checkbox is-condensed">
<input type="checkbox" name="{{ name }}" id="id_sub_{{ subtopic.id }}" value="{{ subtopic.id }}"{% if subtopic.checked %} checked{% endif %}/>
<label for="id_sub_{{ subtopic.id }}">{{ subtopic.title }}</label>
<input type="checkbox" name="{{ name }}" id="id_sub_{{ product.id }}_{{ subtopic.id }}" value="{{ subtopic.id }}"{% if subtopic.checked %} checked{% endif %}/>
<label for="id_sub_{{ product.id }}_{{ subtopic.id }}">{{ subtopic.title }}</label>
</div>
</li>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion kitsune/wiki/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def render(self, name, value, attrs=None, renderer=None):
for subtopic in topic.my_subtopics:
self.process_topic(value, subtopic)

topics_by_product[product.title] = topics
topics_by_product[product] = topics

return render_to_string(
"wiki/includes/product_topics_widget.html",
Expand Down

0 comments on commit 09294c4

Please sign in to comment.