[extensions-web/filter-sort-ui: 18/20] Remove the "Preview" button when posting comments.



commit 292009b63a9084bbceb1e988c894c54410fdb68b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Jan 2 16:01:21 2012 -0500

    Remove the "Preview" button when posting comments.

 .../discussions/templates/comments/form.html       |   19 +++++++++++++++++++
 sweettooth/settings.py                             |    5 ++++-
 2 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/sweettooth/discussions/templates/comments/form.html b/sweettooth/discussions/templates/comments/form.html
new file mode 100644
index 0000000..5b3e575
--- /dev/null
+++ b/sweettooth/discussions/templates/comments/form.html
@@ -0,0 +1,19 @@
+{% load comments i18n %}
+<form action="{% comment_form_target %}" method="post">{% csrf_token %}
+  {% if next %}<div><input type="hidden" name="next" value="{{ next }}" /></div>{% endif %}
+  {% for field in form %}
+    {% if field.is_hidden %}
+      <div>{{ field }}</div>
+    {% else %}
+      {% if field.errors %}{{ field.errors }}{% endif %}
+      <p
+        {% if field.errors %} class="error"{% endif %}
+        {% ifequal field.name "honeypot" %} style="display:none;"{% endifequal %}>
+        {{ field.label_tag }} {{ field }}
+      </p>
+    {% endif %}
+  {% endfor %}
+  <p class="submit">
+    <input type="submit" name="post" class="submit-post" value="{% trans "Post" %}" />
+  </p>
+</form>
diff --git a/sweettooth/settings.py b/sweettooth/settings.py
index 65ce8b2..cb6b848 100644
--- a/sweettooth/settings.py
+++ b/sweettooth/settings.py
@@ -116,6 +116,10 @@ LOGIN_URL = '/accounts/login/'
 INSTALLED_APPS = (
     'django.contrib.auth',
 
+    # 'discussions' goes before django's comments
+    # app so it will find our templates
+    'discussions',
+
     'registration',
 
     'django.contrib.comments',
@@ -130,7 +134,6 @@ INSTALLED_APPS = (
     'auth',
     'review',
     'errorreports',
-    'discussions',
 
     # Uncomment the next line to enable the admin:
     'django.contrib.admin',



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]