Ticket #8905: 8905.diff

File 8905.diff, 2.8 KB (added by Thejaswi Puthraya, 16 years ago)

git-patch against latest checkout

  • django/contrib/comments/templates/comments/form.html

    diff --git a/django/contrib/comments/templates/comments/form.html b/django/contrib/comments/templates/comments/form.html
    index 183b668..3ac5247 100644
    a b  
    11{% load comments %}
     2{% load i18n %}
    23<form action="{% comment_form_target %}" method="post">
    34  {% for field in form %}
    45    {% if field.is_hidden %}
     
    1314    {% endif %}
    1415  {% endfor %}
    1516  <p class="submit">
    16     <input type="submit" name="submit" class="submit-post" value="Post" />
    17     <input type="submit" name="submit" class="submit-preview" value="Preview" />
     17    <input type="submit" name="post" class="submit-post" value="{% trans 'Post' %}" />
     18    <input type="submit" name="preview" class="submit-preview" value="{% trans 'Preview' %}" />
    1819  </p>
    1920</form>
  • django/contrib/comments/templates/comments/preview.html

    diff --git a/django/contrib/comments/templates/comments/preview.html b/django/contrib/comments/templates/comments/preview.html
    index 0947476..01aaaa2 100644
    a b  
    44
    55{% block content %}
    66  {% load comments %}
     7  {% load i18n %}
    78  <form action="{% comment_form_target %}" method="post">
    89    {% if form.errors %}
    910      <h1>Please correct the error{{ form.errors|pluralize }} below</h1>
     
    1112      <h1>Preview your comment</h1>
    1213      <blockquote>{{ comment|linebreaks }}</blockquote>
    1314      <p>
    14         and <input type="submit" name="submit" value="Post your comment" id="submit"> or make changes:
     15        and <input type="submit" name="post" value="{% trans 'Post your comment' %}" id="submit"> or make changes:
    1516      </p>
    1617    {% endif %}
    1718    {% for field in form %}
     
    2728      {% endif %}
    2829    {% endfor %}
    2930    <p class="submit">
    30       <input type="submit" name="submit" class="submit-post" value="Post">
    31       <input type="submit" name="submit" class="submit-preview" value="Preview">
     31      <input type="submit" name="post" class="submit-post" value="{% trans 'Post' %}">
     32      <input type="submit" name="preview" class="submit-preview" value="{% trans 'Preview' %}">
    3233    </p>
    3334  </form>
    3435{% endblock %}
  • django/contrib/comments/views/comments.py

    diff --git a/django/contrib/comments/views/comments.py b/django/contrib/comments/views/comments.py
    index e583d9d..ea66f25 100644
    a b def post_comment(request, next=None):  
    6262                (escape(ctype), escape(object_pk)))
    6363
    6464    # Do we want to preview the comment?
    65     preview = data.get("submit", "").lower() == "preview" or \
    66               data.get("preview", None) is not None
     65    preview = data.get("preview", None) is not None
    6766
    6867    # Construct the comment form
    6968    form = comments.get_form()(target, data=data)
Back to Top