Opened 8 years ago

Closed 7 years ago

Last modified 5 years ago

#10285 closed (fixed)

Render comment list

Reported by: Kyle Fuller Owned by: Kyle Fuller
Component: contrib.comments Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

This patch adds the ability to render a comment list directly.

It tries the following templates:

  • "comments/<app>/<model>/list.html",
  • "comments/<app>/list.html",
  • "comments/list.html"

Once it has found a template, it will pass a list of comments. This templatetag stop repetition as many templates I have written are implementing a comment list again and again.

The templatetag can be used like:

{% render_comment_list for [object] %}
{% render_comment_list for [app].[model] [object_id] %}

Attachments (5)

list.html (224 bytes) - added by Kyle Fuller 8 years ago.
django/contrib/comments/templates/comments/list.html
comments.py (10.6 KB) - added by Kyle Fuller 8 years ago.
django/contrib/comments/templatestags/comments.py
comments.diff (2.0 KB) - added by Kyle Fuller 8 years ago.
diff of svn revosopm 9844 against my changes
templatetag_tests.diff (640 bytes) - added by Kyle Fuller 8 years ago.
Diff for django/trunk/tests/regressiontests/comment_tests/tests/templatetag_tests.py at rev 8557
render_comment_list.diff (4.4 KB) - added by Kyle Fuller 8 years ago.
Complete diff of all changes

Download all attachments as: .zip

Change History (12)

Changed 8 years ago by Kyle Fuller

Attachment: list.html added

django/contrib/comments/templates/comments/list.html

Changed 8 years ago by Kyle Fuller

Attachment: comments.py added

django/contrib/comments/templatestags/comments.py

Changed 8 years ago by Kyle Fuller

Attachment: comments.diff added

diff of svn revosopm 9844 against my changes

comment:1 Changed 8 years ago by Jacob

milestone: 1.1 beta
Triage Stage: UnreviewedAccepted

Changed 8 years ago by Kyle Fuller

Attachment: templatetag_tests.diff added

Diff for django/trunk/tests/regressiontests/comment_tests/tests/templatetag_tests.py at rev 8557

comment:2 Changed 8 years ago by Malcolm Tredinnick

Summary: Render commet listRender comment list

comment:3 Changed 8 years ago by Jacob

milestone: 1.1 beta1.2

The patch doesn't apply cleanly because it's not in unified diff format, and even when applied by hand the tests fail. Looks like this won't make it into 1.1.

Changed 8 years ago by Kyle Fuller

Attachment: render_comment_list.diff added

Complete diff of all changes

comment:4 Changed 8 years ago by Kyle Fuller

I have fixed the problem with the tests. I have attached the file render_comment_list.diff, this is the output from the command svn diff.

comment:5 Changed 7 years ago by Kyle Fuller

Fixed this, on my git repo (git://github.com/kylef/django.git), commit d042fde575d2f28b0d4f155efd1c78269ae2377d

If anyone wants to pull and merge it into svn/django.

comment:6 Changed 7 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

(In [12082]) Fixed #10285 - Added render_comment_list template tag to comments app. Thanks Kyle Fuller for the patch.

comment:7 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top