Browse Source

Add data-topic-posted-by attr to topics in listing

This will give people a way to set up filters or use CSS/extensions to
display the poster's username, if they really want to.
merge-requests/55/head
Deimos 6 years ago
parent
commit
2e2997d33c
  1. 5
      tildes/tildes/templates/macros/topics.jinja2

5
tildes/tildes/templates/macros/topics.jinja2

@ -5,7 +5,10 @@
{% from 'macros/links.jinja2' import group_linked, username_linked %} {% from 'macros/links.jinja2' import group_linked, username_linked %}
{% macro render_topic_for_listing(topic, show_group=False, rank=None) %} {% macro render_topic_for_listing(topic, show_group=False, rank=None) %}
<article id="topic-{{ topic.topic_id36 }}" class="{{ topic_classes(topic)|trim }}">
<article id="topic-{{ topic.topic_id36 }}"
class="{{ topic_classes(topic)|trim }}"
data-topic-posted-by="{{ topic.user.username }}"
>
<header> <header>
{% if topic.is_link_type %} {% if topic.is_link_type %}
<div class="topic-icon topic-icon-{{ topic.link_domain.replace('.', '_') }}"></div> <div class="topic-icon topic-icon-{{ topic.link_domain.replace('.', '_') }}"></div>

Loading…
Cancel
Save