Opened 15 years ago

Closed 15 years ago

Last modified 12 years ago

#10445 closed (fixed)

Custom comment form example doesn't show submit button

Reported by: nab Owned by: Kevin Kubasik
Component: Documentation Version: 1.0
Severity: Keywords: kkmegapatch
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Django's comments framework: http://docs.djangoproject.com/en/dev/ref/contrib/comments/#rendering-a-custom-comment-form

The following snippet doesn't show the submit button:

{% get_comment_form for event as form %}
<form action="{% comment_form_target %}" method="POST">
  {{ form }}
  <p class="submit">
    <input type="submit" name="preview" class="submit-post" value="Preview">
  </p>
</form>

Should be something of the form:

{% 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>

Attachments (1)

updated_form.diff (730 bytes ) - added by Jeff Anderson 15 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Jacob, 15 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

by Jeff Anderson, 15 years ago

Attachment: updated_form.diff added

comment:2 by Jeff Anderson, 15 years ago

Triage Stage: AcceptedReady for checkin

comment:3 by Malcolm Tredinnick, 15 years ago

Has patch: set
Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

How about if we fix the whole problem? The form, as given in the docs, is pretty broken. It claims to be an entire form, but spits out HTML tr and td elements without putting them inside a table. That's why the problem occurs. It's probably not a bad idea to put the submit button in a "p" element, for easier styling. The trick is to remember to close the table element first. Which means we should probably open it as well. (The other motivation for using a paragraph element there is to provide a subtle lead that they're not always required to only use table elements or only use list elements or whatever: they can use the appropriate HTML element in the appropriate place.)

Even if we go end up going with putting the submit button into the table, we should include the table elements

comment:4 by Kevin Kubasik, 15 years ago

Keywords: kkmegapatch added
Owner: changed from nobody to Kevin Kubasik

comment:5 by Jacob, 15 years ago

Resolution: fixed
Status: newclosed

Fixed by [10303].

comment:6 by Jacob, 12 years ago

milestone: 1.1

Milestone 1.1 deleted

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