changeset 133:c515b7401078

Use the new common way to apply markItUp to textareas and to get the smiley and markdown help dialogs for all the remaining apps except for forums and comments.
author Brian Neal <bgneal@gmail.com>
date Fri, 27 Nov 2009 00:21:47 +0000
parents 06503edcc56b
children b8474ffe76d9
files gpp/bio/forms.py gpp/downloads/forms.py gpp/membermap/forms.py gpp/messages/forms.py gpp/templates/downloads/add.html gpp/templates/membermap/index.html gpp/templates/messages/compose.html media/js/bio.js media/js/downloads/add.js media/js/downloads_admin.js media/js/membermap.js media/js/messages/compose.js
diffstat 12 files changed, 32 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/gpp/bio/forms.py	Thu Nov 26 22:51:07 2009 +0000
+++ b/gpp/bio/forms.py	Fri Nov 27 00:21:47 2009 +0000
@@ -32,6 +32,10 @@
     interests = forms.CharField(required=False, widget=forms.TextInput(attrs={'size' : 64 }))
     time_zone = forms.CharField(required=False, widget=forms.HiddenInput())
     use_24_time = forms.BooleanField(label='Show times in 24-hour mode', required=False)
+    profile_text = forms.CharField(required=False, 
+            widget=forms.Textarea(attrs={'class': 'markItUp'}))
+    signature = forms.CharField(required=False, 
+            widget=forms.Textarea(attrs={'class': 'markItUp'}))
 
     class Meta:
         model = UserProfile
--- a/gpp/downloads/forms.py	Thu Nov 26 22:51:07 2009 +0000
+++ b/gpp/downloads/forms.py	Fri Nov 27 00:21:47 2009 +0000
@@ -20,6 +20,10 @@
 
 class AddDownloadForm(forms.ModelForm):
     """Form to allow adding downloads."""
+    title = forms.CharField(required=True, 
+            widget=forms.TextInput(attrs={'size': 64, 'maxlength': 64}))
+    description = forms.CharField(required=False, 
+            widget=forms.Textarea(attrs={'class': 'markItUp smileyTarget'}))
 
     def clean_file(self):
         file = self.cleaned_data['file']
@@ -35,8 +39,8 @@
         
     class Media:
         css = {
-            'all': settings.GPP_THIRD_PARTY_CSS['markitup'],
+            'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] +
+                    settings.GPP_THIRD_PARTY_CSS['jquery-ui'])
         }
-        js = settings.GPP_THIRD_PARTY_JS['markitup'] + \
-            ('js/downloads/add.js', )
-
+        js = (settings.GPP_THIRD_PARTY_JS['markitup'] +
+              settings.GPP_THIRD_PARTY_JS['jquery-ui'])
--- a/gpp/membermap/forms.py	Thu Nov 26 22:51:07 2009 +0000
+++ b/gpp/membermap/forms.py	Fri Nov 27 00:21:47 2009 +0000
@@ -8,6 +8,10 @@
 
 
 class MapEntryForm(forms.ModelForm):
+    location = forms.CharField(required=True, 
+            widget=forms.TextInput(attrs={'size': 64, 'maxlength': 255}))
+    message = forms.CharField(required=False, 
+            widget=forms.Textarea(attrs={'class': 'markItUp smileyTarget'}))
 
     class Meta:
         model = MapEntry
@@ -15,8 +19,9 @@
 
     class Media:
         css = {
-            'all': settings.GPP_THIRD_PARTY_CSS['markitup']
+            'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] +
+                    settings.GPP_THIRD_PARTY_CSS['jquery-ui'])
         }
-        js = settings.GPP_THIRD_PARTY_JS['markitup']
+        js = (settings.GPP_THIRD_PARTY_JS['markitup'] +
+              settings.GPP_THIRD_PARTY_JS['jquery-ui'])
 
-# vim: ts=4 sw=4
--- a/gpp/messages/forms.py	Thu Nov 26 22:51:07 2009 +0000
+++ b/gpp/messages/forms.py	Fri Nov 27 00:21:47 2009 +0000
@@ -24,7 +24,7 @@
          max_length=30,
          widget=AutoCompleteUserInput())
    subject = forms.CharField(max_length=120, widget=forms.TextInput(attrs={'size': 52}))
-   message = forms.CharField(widget=forms.Textarea(attrs={'rows': 20, 'cols': 80}))
+   message = forms.CharField(widget=forms.Textarea(attrs={'class': 'markItUp smileyTarget'}))
    attach_signature = forms.BooleanField(label='Attach Signature?', required=False)
 
    def __init__(self, user, *args, **kwargs):
@@ -67,9 +67,11 @@
 
    class Media:
       css = {
-         'all': settings.GPP_THIRD_PARTY_CSS['markitup'],
+          'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] +
+                  settings.GPP_THIRD_PARTY_CSS['jquery-ui'])
       }
-      js = ('js/messages/compose.js', ) + settings.GPP_THIRD_PARTY_JS['markitup']
+      js = (settings.GPP_THIRD_PARTY_JS['markitup'] +
+            settings.GPP_THIRD_PARTY_JS['jquery-ui'])
 
 
 class OptionsForm(forms.ModelForm):
--- a/gpp/templates/downloads/add.html	Thu Nov 26 22:51:07 2009 +0000
+++ b/gpp/templates/downloads/add.html	Fri Nov 27 00:21:47 2009 +0000
@@ -1,5 +1,6 @@
 {% extends 'base.html' %}
 {% load downloads_tags %}
+{% load core_tags %}
 {% block title %}Add Download{% endblock %}
 {% block custom_css %}
 {{ add_form.media }}
@@ -37,6 +38,7 @@
 <tr>
    <th>&nbsp;</th>
    <td>
+      {% comment_dialogs %}
       <input type="submit" name="submit_button" value="Add Download" />
    </td>
 </table>
--- a/gpp/templates/membermap/index.html	Thu Nov 26 22:51:07 2009 +0000
+++ b/gpp/templates/membermap/index.html	Fri Nov 27 00:21:47 2009 +0000
@@ -1,4 +1,5 @@
 {% extends 'base.html' %}
+{% load core_tags %}
 {% block title %}Member Map{% endblock %}
 {% block custom_js %}
 <script type="text/javascript" src="{{ MEDIA_URL }}js/membermap.js"></script>
@@ -58,11 +59,11 @@
         </ul>
         <form action="" method="post">
             {{ form.as_p }}
-            <p>
+            {% comment_dialogs %}
             <input type="submit" id="member_map_submit" name="submit" value="Submit" />
             <input type="submit" id="member_map_delete" name="delete" value="Delete" />
-            </p>
         </form>
+        <br />
         {% else %}
         <p>
         The member map allows members to place themselves on a google map along with a short message.
--- a/gpp/templates/messages/compose.html	Thu Nov 26 22:51:07 2009 +0000
+++ b/gpp/templates/messages/compose.html	Fri Nov 27 00:21:47 2009 +0000
@@ -1,4 +1,5 @@
 {% extends 'messages/base.html' %}
+{% load core_tags %}
 {% block title %}Messages: Compose{% endblock %}
 {% block custom_js %}
    {{ compose_form.media }}
@@ -12,6 +13,7 @@
 <tr>
    <td>&nbsp;</td>
    <td>
+      {% comment_dialogs %}
       <input type="submit" name="submit_button" value="Send" />
       <input type="submit" name="submit_button" value="Cancel" />
    </td>
--- a/media/js/bio.js	Thu Nov 26 22:51:07 2009 +0000
+++ b/media/js/bio.js	Fri Nov 27 00:21:47 2009 +0000
@@ -1,7 +1,5 @@
 
 $(document).ready(function() {
-    $('#id_profile_text').markItUp(mySettings);
-    $('#id_signature').markItUp(mySettings);
     $('#id_birthday').datepicker({changeMonth: true, 
        changeYear: true,
        dateFormat: 'yy-mm-dd',
--- a/media/js/downloads/add.js	Thu Nov 26 22:51:07 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-$(document).ready(function() {
-    $('#id_description').markItUp(mySettings);
-});
--- a/media/js/downloads_admin.js	Thu Nov 26 22:51:07 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-$(document).ready(function() {
-    $('#id_description').markItUp(mySettings);
-});
--- a/media/js/membermap.js	Thu Nov 26 22:51:07 2009 +0000
+++ b/media/js/membermap.js	Fri Nov 27 00:21:47 2009 +0000
@@ -30,7 +30,6 @@
       'and click the Submit button.'
 };
 $(document).ready(function() {
-   $('#id_message').markItUp(mySettings);
    if (GBrowserIsCompatible())
    {
       $(window).unload(GUnload);
--- a/media/js/messages/compose.js	Thu Nov 26 22:51:07 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-$(document).ready(function() {
-    $('#id_message').markItUp(mySettings);
-});