mirror of
https://github.com/torproject/support.git
synced 2025-02-12 12:40:21 +00:00
Fix accordion behavior with question redirects
This commit is contained in:
parent
29472b8250
commit
7d2ee16b7a
@ -1,14 +1,14 @@
|
||||
{% 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 %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user