Opened 15 years ago

Closed 14 years ago

Last modified 12 years ago

#10285 closed (fixed)

Render comment list

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

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 15 years ago.
django/contrib/comments/templates/comments/list.html
comments.py (10.6 KB ) - added by Kyle Fuller 15 years ago.
django/contrib/comments/templatestags/comments.py
comments.diff (2.0 KB ) - added by Kyle Fuller 15 years ago.
diff of svn revosopm 9844 against my changes
templatetag_tests.diff (640 bytes ) - added by Kyle Fuller 15 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 15 years ago.
Complete diff of all changes

Download all attachments as: .zip

Change History (12)

by Kyle Fuller, 15 years ago

Attachment: list.html added

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

by Kyle Fuller, 15 years ago

Attachment: comments.py added

django/contrib/comments/templatestags/comments.py

by Kyle Fuller, 15 years ago

Attachment: comments.diff added

diff of svn revosopm 9844 against my changes

comment:1 by Jacob, 15 years ago

milestone: 1.1 beta
Triage Stage: UnreviewedAccepted

by Kyle Fuller, 15 years ago

Attachment: templatetag_tests.diff added

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

comment:2 by Malcolm Tredinnick, 15 years ago

Summary: Render commet listRender comment list

comment:3 by Jacob, 15 years ago

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.

by Kyle Fuller, 15 years ago

Attachment: render_comment_list.diff added

Complete diff of all changes

comment:4 by Kyle Fuller, 15 years ago

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 by Kyle Fuller, 15 years ago

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 by Jannis Leidel, 14 years ago

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 by Jacob, 12 years ago

milestone: 1.2

Milestone 1.2 deleted

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