Browse Source

User page: add a fake title for old deleted topics

The script that cleans up old deleted data wipes out the title of
deleted topics (along with most of the other data), but this breaks the
little headers on a user page that say which topic a comment was in.
This just adds a "<deleted topic>" marker in place of the title.

This should probably be generalized out to other locations eventually
too, but this is probably the most prominent place it will be needed.
merge-requests/55/head
Deimos 6 years ago
parent
commit
4a2ce33274
  1. 8
      tildes/tildes/templates/user.jinja2

8
tildes/tildes/templates/user.jinja2

@ -50,7 +50,13 @@
{% if post is topic %} {% if post is topic %}
{{ render_topic_for_listing(post, show_group=True) }} {{ render_topic_for_listing(post, show_group=True) }}
{% elif post is comment %} {% elif post is comment %}
<h2>Comment on <a href="{{ post.topic.permalink }}">{{ post.topic.title }}</a> in {{ group_linked(post.topic.group.path) }}</h2>
<h2>Comment on <a href="{{ post.topic.permalink }}">
{% if post.topic.is_deleted and not post.topic.title %}
&lt;deleted topic&gt;
{% else %}
{{ post.topic.title }}
{% endif %}
</a> in {{ group_linked(post.topic.group.path) }}</h2>
{{ render_single_comment(post) }} {{ render_single_comment(post) }}
{% endif %} {% endif %}
</li> </li>

Loading…
Cancel
Save