Opened 8 years ago

Closed 7 years ago

Last modified 5 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: UI/UX:

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 8 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by Jacob

milestone: 1.1
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Changed 8 years ago by Jeff Anderson

Attachment: updated_form.diff added

comment:2 Changed 8 years ago by Jeff Anderson

Triage Stage: AcceptedReady for checkin

comment:3 Changed 8 years ago by Malcolm Tredinnick

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 Changed 8 years ago by Kevin Kubasik

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

comment:5 Changed 7 years ago by Jacob

Resolution: fixed
Status: newclosed

Fixed by [10303].

comment:6 Changed 5 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

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