Browse Source

Reduce gaudiness of "replying to old" warning

merge-requests/77/head
Deimos 5 years ago
parent
commit
36ac6247aa
  1. 7
      tildes/static/js/behaviors/comment-reply-button.js
  2. 5
      tildes/tildes/templates/topic.jinja2

7
tildes/static/js/behaviors/comment-reply-button.js

@ -89,10 +89,11 @@ $.onmount("[data-js-comment-reply-button]", function() {
// add a warning if the comment being replied to is over a week old // add a warning if the comment being replied to is over a week old
if (Date.now() - parentCommentTimestamp > 1000 * 3600 * 24 * 7) { if (Date.now() - parentCommentTimestamp > 1000 * 3600 * 24 * 7) {
var warningDiv = document.createElement("div"); var warningDiv = document.createElement("div");
warningDiv.classList.add("toast", "toast-minor", "toast-warning");
warningDiv.classList.add("warning-old-reply");
warningDiv.innerHTML = warningDiv.innerHTML =
"<h2>The comment you're replying to is over a week old.</h2>" +
"<p>(Replying to old comments is fine, just making sure it's intentional)</p>";
'<p class="text-warning text-small">The comment you\'re replying to ' +
"is over a week old. Replying to old comments is fine as long as " +
"you're contributing to the discussion.</p>";
clone.querySelector("form").prepend(warningDiv); clone.querySelector("form").prepend(warningDiv);
} }

5
tildes/tildes/templates/topic.jinja2

@ -214,9 +214,8 @@
data-js-confirm-leave-page-unsaved data-js-confirm-leave-page-unsaved
> >
{% if old_topic_warning %} {% if old_topic_warning %}
<div class="toast toast-minor toast-warning">
<h2>This topic is over a week old.</h2>
<p>(Replying to old topics is fine, just making sure it's intentional)</p>
<div class="warning-old-reply">
<p class="text-warning text-small">This topic is over a week old. Replying to old topics is fine as long as you're contributing to the discussion.</p>
</div> </div>
{% endif %} {% endif %}
<input type="hidden" name="csrf_token" value="{{ get_csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ get_csrf_token() }}">

Loading…
Cancel
Save