Changeset - dddf6058a9ba
[Not reviewed]
0 2 0
Ben Sturmfels (bsturmfels) - 3 months ago 2024-01-31 23:37:31
ben@sturm.com.au
usethesource: Linkify URLs in description and comments, retain line breaks
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
conservancy/usethesource/templates/usethesource/candidate.html
Show inline comments
...
 
@@ -25,13 +25,13 @@
 
      <div class="mt2">
 
        <div><a href="{% url 'usethesource:download' slug=candidate.slug download_type='source' %}" class="white bg-green db pv2 ph3 mb2">Download source</a></div>
 
        <div><a href="{% url 'usethesource:download' slug=candidate.slug download_type='binary' %}" class="white bg-green db pv2 ph3">Download image</a></div>
 
      </div>
 
    </div>
 

	
 
    {{ candidate.description|linebreaks }}
 
    {{ candidate.description|urlize|linebreaksbr }}
 

	
 
    {% with comments=candidate.comment_set.all %}
 
      {% if comments or user.is_staff %}<h3 class="f3 lh-title mt4">Comments</h3>{% endif %}
 
      {% for comment in comments %}
 
        {% include "usethesource/comment_partial.html" %}
 
      {% endfor %}
conservancy/usethesource/templates/usethesource/comment_partial.html
Show inline comments
 
<div hx-target="this" hx-swap="outerHTML"><strong>{{ comment.user }} — {{ comment.time }}</strong>
 
  {% if user.is_staff %}
 
    <a href="#" class="f7 white bg-light-silver ph2" hx-get="{% url 'usethesource:edit_comment' comment_id=comment.id %}">edit</a>
 
    <a href="#" class="f7 white bg-light-red ph2" hx-delete="{% url 'usethesource:delete_comment' comment_id=comment.id show_add='false' %}" hx-confirm="Are you sure you want to delete this comment?">delete</a>
 
  {% endif %}
 
  <br>{{ comment.message|linebreaks }}
 
  <br>{{ comment.message|urlize|linebreaksbr }}
 
</div>
0 comments (0 inline, 0 general)