Skip to content

Commit

Permalink
Exclude AAQ macro on the get-community-support page (#6481)
Browse files Browse the repository at this point in the history
* Exclude AAQ macro on the get-community-support page
* Add visibility check to view
* Ensure parent check to handle translations
  • Loading branch information
smithellis authored Feb 13, 2025
1 parent 0860f24 commit 1cd35a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kitsune/wiki/jinja2/wiki/document.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
{{ search_box(settings, id='support-search-sidebar', params=search_params) }}
</div>

{{ aaq_widget(request) }}
{% if show_aaq_widget %}
{{ aaq_widget(request) }}
{% endif %}

{% if fallback_reason == 'no_translation' %}
{# If there is no translation, there is no document and the (future) parent is document. #}
Expand Down
6 changes: 6 additions & 0 deletions kitsune/wiki/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ def maybe_vary_on_accept_language(response):

is_first_revision = doc.revisions.filter(is_approved=True).count() == 1

show_aaq_widget = (
not (doc.parent and doc.parent.slug == "get-community-support")
and doc.slug != "get-community-support"
)

data = {
"document": doc,
"is_first_revision": is_first_revision,
Expand All @@ -318,6 +323,7 @@ def maybe_vary_on_accept_language(response):
"ga_products": ga_products,
"ga_article_locale": ga_article_locale,
"related_products": doc.related_products.exclude(pk=product.pk),
"show_aaq_widget": show_aaq_widget,
"breadcrumb_items": breadcrumbs,
"document_css_class": document_css_class,
"any_localizable_revision": any_localizable_revision,
Expand Down

0 comments on commit 1cd35a6

Please sign in to comment.