Opened 7 years ago

Closed 6 years ago

#9604 closed (duplicate)

a patch to the docs regarding "how a complete example form could look like"

Reported by: vak <khamenya@…> Owned by: nobody
Component: contrib.comments Version: master
Severity: Keywords: doc patch
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


there is an example of a complete form in the section "RENDERING A CUSTOM COMMENT FOR" on this page:

it is not fully correct, because:

  1. the example results in a list of tr elements not surrounded by table element.
  2. the button below the form is a mess between "preview" and "post".

the example might be like:

<h2>Post a comment</h2>
{% get_comment_form for blog.entry 1 as form %}
<div id="myform">
    <form action="{% comment_form_target %}" method="POST">
        {{ form }}
        <tr id="action_buttons">
            <input type="submit" name="submit" class="preview-post" value="Preview">
            <input type="submit" name="submit" class="submit-post" value="Post">

and a few lines of the following stylesheet

<style type="text/css">
#myform label[for="id_honeypot"], #myform input#id_honeypot {

#myform table th, #myform #action_buttons {

will help to all newbies like I am.


Change History (3)

comment:1 Changed 7 years ago by mtredinnick

  • Has patch unset
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

If somebody wants to make a patch for something like this, it would be a start.

Note, however, that there's no need to include CSS in the example. There's nothing Django-specific about that and, in the above example, it's all up to whomever writes the template. However, the documentation for comments could mention any specific CSS classes that the template tags create (if there are any).

Also, the example template fragment isn't correct, since there shouldn't be two controls for separate purposes with the same "name" attribute (it's broken for internationalisation purposes). The template fragments in the comments application show the correct approach.

(I don't know why "has patch" has been checked here, since there's no patch attached.)

comment:2 Changed 7 years ago by thejaswi_puthraya

Subset of #9819 that has a patch (w/o the CSS).

comment:3 Changed 6 years ago by jezdez

  • Resolution set to duplicate
  • Status changed from new to closed

Closing as duplicate in favor of #9819.

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