Skip to content

Commit

Permalink
Merge pull request #6076 from akatsoulas/widget-wording
Browse files Browse the repository at this point in the history
Update AAQ widget redirects and text
  • Loading branch information
akatsoulas committed Jun 19, 2024
2 parents c9016e7 + 25bc2ec commit e6d0a0d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
15 changes: 9 additions & 6 deletions kitsune/products/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,15 @@ def document_listing(request, topic_slug, product_slug=None, subtopic_slug=None)
except TopicSlugHistory.DoesNotExist:
...

product = get_object_or_404(Product, slug=product_slug) if product_slug else None
product = None
if product_slug:
product = get_object_or_404(Product, slug=product_slug)
request.session["aaq_context"] = {
"has_ticketing_support": product.has_ticketing_support,
"key": _get_aaq_product_key(product_slug),
"has_public_forum": product.questions_enabled(locale=request.LANGUAGE_CODE),
}

doc_kw = {
"locale": request.LANGUAGE_CODE,
"products": [product] if product else None,
Expand Down Expand Up @@ -136,11 +144,6 @@ def document_listing(request, topic_slug, product_slug=None, subtopic_slug=None)
subtopic = get_object_or_404(Topic, slug=subtopic_slug, product=product, parent=topic)
doc_kw["topics"] = [subtopic]

request.session["aaq_context"] = {
"has_ticketing_support": product.has_ticketing_support,
"key": _get_aaq_product_key(product_slug),
}

if not topics.exists():
raise Http404
template = "products/documents.html"
Expand Down
22 changes: 11 additions & 11 deletions kitsune/questions/jinja2/questions/includes/aaq_macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,18 @@ <h2 class="card--title has-bottom-margin">
</h2>
{% if aaq_context %}
{% set link_detail = aaq_context.key %}
{% if request.user.is_authenticated and aaq_context.has_ticketing_support %}
{# user authenticated and ticketing support #}
<p> {{ _('Still need help? Continue to contact our support team.') }}</p>
{% elif request.user.is_authenticated and aaq_context.has_public_forum %}
{# user is authenticated and forum support #}
<p>{{ _('Still need help? Continue to ask your question on our forums.') }}</p>
{% elif not aaq_context.has_ticketing_support %}
{# user not authenticated and forum support #}
<p>{{ _('Still need help? Sign in to ask your question on our forums.') }}</p>
{% if request.user.is_authenticated %}
{% if aaq_context.has_ticketing_support %}
<p> {{ _('Still need help? Continue to contact our support team.') }}</p>
{% elif aaq_context.has_public_forum %}
<p>{{ _('Still need help? Continue to ask your question on our forums.') }}</p>
{% endif %}
{% else %}
{# user not authenticated and ticketing support #}
<p>{{ _('Still need help? Sign in to contact our support team.') }}</p>
{% if aaq_context.has_ticketing_support %}
<p>{{ _('Still need help? Sign in to contact our support team.') }}</p>
{% elif aaq_context.has_public_forum %}
<p>{{ _('Still need help? Sign in to ask your question on our forums.') }}</p>
{% endif %}
{% endif %}

{% if not aaq_context.has_public_forum and not aaq_context.has_ticketing_support %}
Expand Down

0 comments on commit e6d0a0d

Please sign in to comment.