Browse Source

Fix replying not working from notifications page

Whoops, need to have that <template> included on the notifications page
as well.
merge-requests/68/head
Deimos 6 years ago
parent
commit
9284a730c2
  1. 20
      tildes/tildes/templates/macros/comments.jinja2
  2. 6
      tildes/tildes/templates/notifications_unread.jinja2
  3. 19
      tildes/tildes/templates/topic.jinja2

20
tildes/tildes/templates/macros/comments.jinja2

@ -2,6 +2,7 @@
{# SPDX-License-Identifier: AGPL-3.0-or-later #}
{% from 'datetime.jinja2' import adaptive_date_responsive %}
{% from 'forms.jinja2' import markdown_textarea %}
{% from 'links.jinja2' import username_linked %}
{% macro render_single_comment(comment) %}
@ -303,3 +304,22 @@
</menu>
</template>
{% endmacro %}
{% macro comment_reply_template() %}
<template id="comment-reply">
<form
method="post"
autocomplete="off"
data-js-confirm-cancel="Discard your reply?"
data-js-prevent-double-submit
data-js-confirm-leave-page-unsaved
data-ic-replace-target="true"
>
{{ markdown_textarea(auto_focus=True) }}
<div class="form-buttons">
<button type="submit" class="btn btn-primary">Post comment</button>
<button type="button" class="btn btn-link" data-js-cancel-button>Cancel</button>
</div>
</form>
</template>
{% endmacro %}

6
tildes/tildes/templates/notifications_unread.jinja2

@ -3,7 +3,7 @@
{% extends 'base_user_menu.jinja2' %}
{% from 'macros/comments.jinja2' import comment_label_options_template, render_single_comment with context %}
{% from 'macros/comments.jinja2' import comment_label_options_template, comment_reply_template, render_single_comment with context %}
{% from 'macros/links.jinja2' import group_linked, username_linked %}
{% block title %}Unread notifications{% endblock %}
@ -79,3 +79,7 @@
{% if request.user %}{{ comment_label_options_template(comment_label_options) }}{% endif %}
{% endblock %}
{% block templates %}
{{ comment_reply_template() }}
{% endblock %}

19
tildes/tildes/templates/topic.jinja2

@ -3,7 +3,7 @@
{% extends 'base.jinja2' %}
{% from 'macros/comments.jinja2' import comment_label_options_template, render_comment_tree with context %}
{% from 'macros/comments.jinja2' import comment_label_options_template, comment_reply_template, render_comment_tree with context %}
{% from 'macros/datetime.jinja2' import adaptive_date_responsive, time_ago %}
{% from 'macros/forms.jinja2' import markdown_textarea %}
{% from 'macros/links.jinja2' import group_linked, username_linked %}
@ -12,22 +12,7 @@
{% block title %}{{ topic.title }} - ~{{ topic.group.path }}{% endblock %}
{% block templates %}
<template id="comment-reply">
<form
method="post"
autocomplete="off"
data-js-confirm-cancel="Discard your reply?"
data-js-prevent-double-submit
data-js-confirm-leave-page-unsaved
data-ic-replace-target="true"
>
{{ markdown_textarea(auto_focus=True) }}
<div class="form-buttons">
<button type="submit" class="btn btn-primary">Post comment</button>
<button type="button" class="btn btn-link" data-js-cancel-button>Cancel</button>
</div>
</form>
</template>
{{ comment_reply_template() }}
{% endblock %}
{% block header_context_link %}

Loading…
Cancel
Save