#16031 closed Cleanup/optimization (fixed)
Custom comment form is incomplete and wrong.
Reported by: | Owned by: | teraom | |
---|---|---|---|
Component: | Documentation | Version: | 1.3 |
Severity: | Normal | Keywords: | |
Cc: | Daniel Quinn | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
When viewing the documentation for the django comment framework (http://docs.djangoproject.com/en/dev/ref/contrib/comments/) this is the example form that is shown:
{% get_comment_form for event as form %} <form action="{% comment_form_target %}" method="post"> {{ form }} <tr> <td></td> <td><input type="submit" name="preview" class="submit-post" value="Preview"></td> </tr> </form>
However, the post button is missing, only the preview button appears, and it's class is shown as a post button. Not sure what the original intention was, but it would probably be better to have both buttons in the documentation:
<input type = "submit" name = "post" class = "submit-post" value = "post"> <input type = "submit" name = "preview" class = "submit-preview" value = "preview">
or at least correct the class for the preview button to submit-preview instead of submit-post.
Attachments (6)
Change History (20)
comment:1 by , 14 years ago
Description: | modified (diff) |
---|---|
Easy pickings: | set |
Triage Stage: | Unreviewed → Accepted |
by , 14 years ago
Attachment: | custom_comment_form-16031.diff added |
---|
comment:2 by , 14 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 14 years ago
Patch needs improvement: | set |
---|
The patch introduces a third column, which is not correct since the form only has two columns. It would be more correct to have a single <td colspan="2">
.
For completeness it'd also be good to wrap the form with <table></table>
tags, and also to clean up a similar example in https://docs.djangoproject.com/en/dev/ref/contrib/comments/example/
comment:4 by , 14 years ago
UI/UX: | unset |
---|
I've attached a patch that should solve the problem, however it doesn't include a {% csrf_token %}
even though it needs to be there if the form is to work at all. Should I include that as well, or leave it as is?
comment:5 by , 14 years ago
Cc: | added |
---|
comment:6 by , 14 years ago
After talking to one of the Elder Nerds here at DjangoCon, we agreed that the {% csrf_token %} should be in there, so I've added a new patch.
comment:7 by , 14 years ago
Could you make your patch relative to the trunk
directory of the svn repo? Like this: cd trunk; svn di > your_patch.diff
.
We expect to be able to apply it with cd trunk; patch -p0 < your_patch.diff
(or -p1 if you're using git).
Also, when you upload a new patch that take into account the reviewers' remarks, you can uncheck "patch needs improvement".
Thanks!
by , 14 years ago
Attachment: | index.txt-1603.1.2.diff added |
---|
Fixed the patch so that it can be applied from the root.
comment:8 by , 14 years ago
The code snippet just above the "Flagging" section in https://docs.djangoproject.com/en/dev/ref/contrib/comments/example/ should also be fixed as part of this ticket.
comment:9 by , 14 years ago
Patch needs improvement: | unset |
---|
comment:10 by , 14 years ago
Patch needs improvement: | set |
---|
This looks good. Just one more change to remove any confusion: let's completely remove all instances of class="submit-post"
by , 14 years ago
Attachment: | custom_comment_form-16031-2.diff added |
---|
Changed to one tr tag with colspan 2. Removed all class attributes. Wrapped form in table tag
comment:11 by , 14 years ago
Patch needs improvement: | unset |
---|
Agreed. There are definitely some mixed signals in that example. Might as well include both buttons for completeness.
Speaking of "preview" buttons, you might want to use Trac's preview to check your code formatting before submitting your ticket next time. ;-)