Automatically insert mentions in comments

Fix some bug with mentions too

Fix #52
This commit is contained in:
Bat
2018-06-21 14:05:35 +01:00
parent 0fd181e7ea
commit 7ba6f77e0f
7 changed files with 64 additions and 46 deletions
+2 -1
View File
@@ -8,7 +8,8 @@
<h1>{{ 'Comment "{{ post }}"' | _(post=post.title) }}</h1>
<form method="post">
<label for="content">{{ "Content" | _ }}</label>
<textarea id="content" name="content"></textarea>
{# Ugly, but we don't have the choice if we don't want weird paddings #}
<textarea id="content" name="content">{% filter trim %}{% if previous %}{% if previous.author.fqn != user_fqn %}@{{ previous.author.fqn }} {% endif %}{% for mention in previous.mentions %}{% if mention != user_fqn %}@{{ mention }} {% endif %}{% endfor %}{% endif %}{% endfilter %}</textarea>
<input type="submit" value="{{ "Submit comment" | _ }}" />
</form>
{% endblock content %}