GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Fix accordion behavior with question redirects

parent 29472b82
{% macro render_question(item, t_id, alternative) %}
{% macro render_question(item, q_id, t_id, alternative) %}
<div class="question {{ bag('alternatives', alternative, 'direction') }}">
<h4 class="text-primary">
<a data-toggle="collapse" href="#{{ item._id }}" data-target="#{{ item._id }}" role="button" aria-expanded="false" aria-controls="{{ item._id }}">
<a data-toggle="collapse" href="#{{ q_id }}" data-target="#{{ q_id }}" role="button" aria-expanded="false" aria-controls="{{ q_id }}">
{{ item.title }}
</a>
</h4>
<div id="{{ item._id }}" class="collapse show anchor-spacer" role="tabpanel" data-parent="#{{ t_id }}Accordion">
<div id="{{ q_id }}" class="collapse show anchor-spacer" role="tabpanel" data-parent="#{{ t_id }}Accordion">
{{ item.description|safe }}
{% if item._id == "https-1" %}
{% if q_id == "https-1" %}
{% include 'secure-connections.html' %}
{% endif %}
<div class="card mt-5">
......
......@@ -12,9 +12,9 @@
{% for q in item.children.include_undiscoverable(true).order_by('key') %}
{% if q._model == 'redirect' %}
{% set r = site.get(q.target, alt=alternative) %}
{{ render_question(r, item._id, alternative) }}
{{ render_question(r, q._id, item._id, alternative) }}
{% else %}
{{ render_question(q, item._id, alternative) }}
{{ render_question(q, q._id, item._id, alternative) }}
{% endif %}
{% endfor %}
</div>
......
......@@ -2,5 +2,5 @@
{% extends "layout.html" %}
{% block title %}{{ this.title }}{% endblock %}
{% block body %}
{{ render_question(this, "topic", this.alt) }}
{{ render_question(this, this._id, "topic", this.alt) }}
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment