Browse Source

Fix comment tagging from user page

merge-requests/37/head
Deimos 6 years ago
parent
commit
64dbbe1bf9
  1. 4
      tildes/tildes/templates/user.jinja2
  2. 8
      tildes/tildes/views/user.py

4
tildes/tildes/templates/user.jinja2

@ -3,7 +3,7 @@
{% extends 'base_user_menu.jinja2' %} {% extends 'base_user_menu.jinja2' %}
{% from 'macros/comments.jinja2' import render_single_comment with context %}
{% from 'macros/comments.jinja2' import comment_tag_options_template, render_single_comment with context %}
{% from 'macros/links.jinja2' import group_linked, username_linked %} {% from 'macros/links.jinja2' import group_linked, username_linked %}
{% from 'macros/topics.jinja2' import render_topic_for_listing with context %} {% from 'macros/topics.jinja2' import render_topic_for_listing with context %}
@ -72,6 +72,8 @@
</div> </div>
{% endif %} {% endif %}
{{ comment_tag_options_template(comment_tag_options) }}
{% endblock %} {% endblock %}
{% block sidebar %} {% block sidebar %}

8
tildes/tildes/views/user.py

@ -12,6 +12,7 @@ from pyramid.view import view_config
from sqlalchemy.sql.expression import desc from sqlalchemy.sql.expression import desc
from webargs.pyramidparser import use_kwargs from webargs.pyramidparser import use_kwargs
from tildes.enums import CommentTagOption
from tildes.models.comment import Comment from tildes.models.comment import Comment
from tildes.models.topic import Topic from tildes.models.topic import Topic
from tildes.models.user import User, UserInviteCode from tildes.models.user import User, UserInviteCode
@ -104,7 +105,12 @@ def get_user(
else: else:
posts = _get_user_recent_activity(request, user) posts = _get_user_recent_activity(request, user)
return {"user": user, "posts": posts, "post_type": post_type}
return {
"user": user,
"posts": posts,
"post_type": post_type,
"comment_tag_options": CommentTagOption,
}
@view_config(route_name="invite", renderer="invite.jinja2") @view_config(route_name="invite", renderer="invite.jinja2")

Loading…
Cancel
Save