[damned-lies] Wider and autogrow comment field (Bug #584267)



commit ed013cd1634457da8924839fa267fc3da8c823dc
Author: Claude Paroz <claude 2xlibre net>
Date:   Sat May 30 14:22:16 2009 +0200

    Wider and autogrow comment field (Bug #584267)
---
 README                                  |    7 +++++--
 templates/vertimus/vertimus_detail.html |    9 +++++++++
 vertimus/forms.py                       |    4 ++--
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/README b/README
index bc44589..1d111a7 100644
--- a/README
+++ b/README
@@ -17,8 +17,11 @@ Requirements
 
 2 - Python 2.5 (for hashlib module).
 
-3 - jQuery (tested with 1.3.1) (http://jquery.com) and jQuery 
-    tablesorter (http://tablesorter.com).
+3 - jQuery (tested with 1.3.1) (http://jquery.com) and plugins:
+    * jQuery tablesorter (http://tablesorter.com)
+      in /media/js/jquery.tablesorter.min.js
+    * jQuery growfield (http://kuindji.com/jquery/growfield/growfield.xml)
+      in /media/js/jquery.growfield2.js
 
 4 - [Optional] Django Evolution is an extension to Django that allows
     you to track changes in your models over time, and to update the
diff --git a/templates/vertimus/vertimus_detail.html b/templates/vertimus/vertimus_detail.html
index a5f719a..7fe8030 100644
--- a/templates/vertimus/vertimus_detail.html
+++ b/templates/vertimus/vertimus_detail.html
@@ -6,6 +6,15 @@
 {% blocktrans with module.get_description as name %}Module Translation: {{ name }}{% endblocktrans %}
 {% endblock %}
 
+{% block extrahead %}
+<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.growfield2.js"></script>
+<script type="text/javascript">
+$(document).ready(function() {
+    $("#id_comment").growfield();
+});
+</script>
+{% endblock %}
+
 {% block content %}
 <div class="mainpage">
 {% with branch.releases.all as releases %}
diff --git a/vertimus/forms.py b/vertimus/forms.py
index ea877e5..d147500 100644
--- a/vertimus/forms.py
+++ b/vertimus/forms.py
@@ -41,9 +41,9 @@ class ActionForm(forms.Form):
         widget=ActionWidget)
     comment = forms.CharField(label=_("Comment"),
 #        help_text="Leave a comment to explain your action",
-        max_length=1000,
+        max_length=5000,
         required=False,
-        widget=forms.Textarea)
+        widget=forms.Textarea(attrs={'rows':8, 'cols':70}))
     file = forms.FileField(label=_("File"), required=False,
                            help_text=_("Upload a .po, .gz, .bz2 or .png file"))
 



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