From 24807a07a9d8d13bfb3c8bcf7ab0933668ccc779 Mon Sep 17 00:00:00 2001 From: Ivan Fonseca Date: Tue, 24 Jul 2018 15:45:39 -0400 Subject: [PATCH] Use data attribute for open text links in new tabs setting --- .../{comment-text.js => external-links-new-tabs.js} | 2 +- tildes/tildes/templates/macros/comments.jinja2 | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) rename tildes/static/js/behaviors/{comment-text.js => external-links-new-tabs.js} (65%) diff --git a/tildes/static/js/behaviors/comment-text.js b/tildes/static/js/behaviors/external-links-new-tabs.js similarity index 65% rename from tildes/static/js/behaviors/comment-text.js rename to tildes/static/js/behaviors/external-links-new-tabs.js index 572002b..ff46571 100644 --- a/tildes/static/js/behaviors/comment-text.js +++ b/tildes/static/js/behaviors/external-links-new-tabs.js @@ -1,4 +1,4 @@ -$.onmount('[data-js-comment-text]', function() { +$.onmount('[data-js-external-links-new-tabs]', function() { // Make all links in comment open in new tab $(this).find('a[href^="http"]').attr('target', '_blank'); }); diff --git a/tildes/tildes/templates/macros/comments.jinja2 b/tildes/tildes/templates/macros/comments.jinja2 index a61043d..4d9b147 100644 --- a/tildes/tildes/templates/macros/comments.jinja2 +++ b/tildes/tildes/templates/macros/comments.jinja2 @@ -94,7 +94,11 @@ {% endif %} -
+
{% if comment.is_removed and 'admin' in request.effective_principals %}

Comment removed

{% endif %}