Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 28 additions & 23 deletions kitsune/sumo/jinja2/sumo/includes/question_entry.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,24 +194,26 @@ <h3 class="question-entry--title">
<div class="question-entry--meta">
<div class="question-entry--meta-primary">
{% if question.product and _product_url %}
<span class="question-entry--meta-item">
<a class="question-entry--meta-item"
href="{{ _product_url }}"
title="{{ _('{product} questions')|f(product=question.product.title) }}">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
aria-hidden="true">
<rect x="2" y="3" width="7" height="7"/><rect x="15" y="3" width="7" height="7"/>
<rect x="2" y="14" width="7" height="7"/><rect x="15" y="14" width="7" height="7"/>
</svg>
{{ question.product.title }}
</a>
{% if question.channel != "direct_support" and user_is_contributor and question.product_version %}
{{ question.product_version }}
{% endif %}
</span>
{% set _product_title = pgettext('DB: products.Product.title', question.product.title) %}
<span class="question-entry--meta-item">
<a class="question-entry--meta-item"
href="{{ _product_url }}"
title="{{ _('{product} questions')|f(product=_product_title) }}">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
aria-hidden="true">
<rect x="2" y="3" width="7" height="7"/><rect x="15" y="3" width="7" height="7"/>
<rect x="2" y="14" width="7" height="7"/><rect x="15" y="14" width="7" height="7"/>
</svg>
{{ _product_title }}
</a>
{% if question.channel != "direct_support" and user_is_contributor and question.product_version %}
{{ question.product_version }}
{% endif %}
</span>
{% endif %}
{% if question.topic and _topic_url %}
{% set _topic_title = pgettext("DB: products.Topic.title", question.topic.title) %}
<a class="question-entry--meta-item"
href="{{ _topic_url }}"
{% if htmx_filters -%}
Expand All @@ -222,13 +224,13 @@ <h3 class="question-entry--title">
hx-swap="outerHTML"
hx-push-url="true"
{%- endif %}
title="{{ _('{topic} questions')|f(topic=question.topic.title) }}">
title="{{ _('{topic} questions')|f(topic=_topic_title) }}">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
aria-hidden="true">
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>
</svg>
{{ question.topic.title }}
{{ _topic_title }}
</a>
{% endif %}
<span class="question-entry--meta-item">
Expand All @@ -238,7 +240,7 @@ <h3 class="question-entry--title">
<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>
</svg>
{% if user_is_contributor and not profile_username %}
{{ _('asked by') }} <a class="question-entry--meta-asked-by"
{{ _('asked by') }} <a class="question-entry--meta-bold"
href="{{ url('users.profile', question.creator.id) }}"
title="{{ display_name(question.creator) }}">{{ display_name(question.creator)|truncate(20) }}</a>
<time datetime="{{ question.created.isoformat() }}">{{ question.created|timesince }}</time>
Expand All @@ -248,16 +250,19 @@ <h3 class="question-entry--title">
</span>
</div>
{% if question.channel != "direct_support" and question.last_answer %}
<span class="question-entry--last-reply"
<span class="question-entry--meta-item"
title="{{ _('Last reply by {user}')|f(user=display_name(question.last_answer.creator)) }}">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
aria-hidden="true">
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
</svg>
<span class="question-entry--last-reply-name">{{ display_name(question.last_answer.creator)|truncate(20) }}</span>
<span class="question-entry--last-reply-verb">{{ _('replied') }}</span>
<a class="question-entry--last-reply-time" href="{{ question.last_answer.get_absolute_url() }}" rel="nofollow">{{ question.last_answer.created|timesince }}</a>
{% trans name=display_name(question.last_answer.creator)|truncate(20),
b_open='<span class="question-entry--meta-bold">'|safe, b_close='</span>'|safe,
when=question.last_answer.created|timesince,
a_open='<a href="'|safe + question.last_answer.get_absolute_url() + '" rel="nofollow">'|safe, a_close='</a>'|safe %}
{{ b_open }}{{ name }}{{ b_close }} replied {{ a_open }}{{ when }}{{ a_close }}
{% endtrans %}
</span>
{% endif %}
</div>
Expand Down
26 changes: 12 additions & 14 deletions kitsune/sumo/jinja2/sumo/includes/thread_post.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
<div class="thread-detail--context">
<div class="thread-detail--context-left">
{% if obj.product %}
{% set _product_title = pgettext('DB: products.Product.title', obj.product.title) %}
{% if obj.channel == "direct_support" %}
<span class="question-entry--meta-item">{{ obj.product.title }}</span>
<span class="question-entry--meta-item">{{ _product_title }}</span>
{% else %}
{% set _product_title = pgettext('DB: products.Product.title', obj.product.title) %}
<a class="question-entry--meta-item"
href="{{ url('questions.list', product_slug=obj.product.slug) }}"
title="{{ _('{product} questions')|f(product=_product_title) }}">
Expand All @@ -85,10 +85,10 @@
{% endif %}
{% endif %}
{% if obj.topic %}
{% set _topic_title = pgettext('DB: products.Topic.title', obj.topic.title) %}
{% if obj.channel == "direct_support" %}
<span class="question-entry--meta-item">{{ obj.topic.title }}</span>
<span class="question-entry--meta-item">{{ _topic_title }}</span>
{% else %}
{% set _topic_title = pgettext('DB: products.Topic.title', obj.topic.title) %}
<a class="question-entry--meta-item"
href="{{ url('questions.list_by_topic', topic_slug=obj.topic.slug) }}"
title="{{ _('{topic} questions')|f(topic=_topic_title) }}">
Expand All @@ -114,25 +114,23 @@
</span>
</div>
{% if obj.channel != "direct_support" and obj.last_answer %}
<span class="question-entry--last-reply"
<span class="question-entry--meta-item"
title="{{ _('Last reply by {user}')|f(user=display_name(obj.last_answer.creator)) }}">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
aria-hidden="true">
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
</svg>
<span class="question-entry--last-reply-name">{{ display_name(obj.last_answer.creator)|truncate(20) }}</span>
<span class="question-entry--last-reply-verb">{{ _('replied') }}</span>
<a class="question-entry--last-reply-time" href="{{ obj.last_answer.get_absolute_url() }}" rel="nofollow">
<time itemprop="dateModified" datetime="{{ obj.last_answer.created.isoformat() }}">{{ obj.last_answer.created|timesince }}</time>
</a>
{% trans name=display_name(obj.last_answer.creator)|truncate(20),
b_open='<span class="question-entry--meta-bold">'|safe, b_close='</span>'|safe,
when=obj.last_answer.created|timesince,
a_open='<a href="'|safe + obj.last_answer.get_absolute_url() + '" rel="nofollow">'|safe, a_close='</a>'|safe %}
{{ b_open }}{{ name }}{{ b_close }} replied {{ a_open }}{{ when }}{{ a_close }}
{% endtrans %}
</span>
{% elif obj.channel == "direct_support" and obj.zd_updated_at and obj.zd_updated_at != obj.created %}
<span class="question-entry--meta-item">
{{ _('Updated') }}
<time datetime="{{ obj.zd_updated_at.isoformat() }}">
{{ datetimeformat(obj.zd_updated_at, use_timesince=True) }}
</time>
{{ _('Updated {when}')|f(when=datetimeformat(obj.zd_updated_at, use_timesince=True)) }}
</span>
{% endif %}
</div>
Expand Down
35 changes: 3 additions & 32 deletions kitsune/sumo/static/sumo/scss/layout/_question-entry.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
display: inline-flex;
align-items: center;
gap: p.$spacing-xs;
color: inherit;
text-decoration: none;
white-space: nowrap;

svg {
width: p.$spacing-md;
Expand All @@ -119,6 +119,7 @@

a.question-entry--meta-item,
.question-entry--meta-item a {
color: inherit;
text-decoration: none;

&:hover {
Expand Down Expand Up @@ -151,41 +152,11 @@
}
}

.question-entry--meta-asked-by {
.question-entry--meta-bold {
color: var(--color-heading);
font-weight: 600;
}

.question-entry--last-reply {
display: inline-flex;
align-items: center;
gap: p.$spacing-xs;
white-space: nowrap;

svg {
width: p.$spacing-md;
height: p.$spacing-md;
flex-shrink: 0;
}
}

.question-entry--last-reply-name {
color: var(--color-heading);
font-weight: 600;
}

.question-entry--last-reply-time {
position: relative;
z-index: 1;
color: var(--color-text-light);
text-decoration: none;

&:hover {
text-decoration: underline;
color: var(--color-link);
}
}

.question-entry--extras {
position: relative;
z-index: 1;
Expand Down