# HG changeset patch # User Brian Neal # Date 1261251256 0 # Node ID 13d052fbe4f108dce826ef55104ca8ba78384ce2 # Parent bc657962941e9d977233b690964bda9319243331 Fixing #28, cosmetic issues with member map. Also fixed a bug involving the smiley and markdown interactions. Single quotes were getting HTML REMOVED by markdown. diff -r bc657962941e -r 13d052fbe4f1 gpp/membermap/models.py --- a/gpp/membermap/models.py Sat Dec 19 04:59:06 2009 +0000 +++ b/gpp/membermap/models.py Sat Dec 19 19:34:16 2009 +0000 @@ -7,8 +7,9 @@ from django.template.defaultfilters import escapejs import django.utils.simplejson as json +from core.markup import site_markup -# Create your models here. + class MapEntry(models.Model): """Represents a user's entry on the map.""" user = models.ForeignKey(User) @@ -27,7 +28,10 @@ verbose_name_plural = 'map entries' def save(self, force_insert=False, force_update=False): - msg = render_to_string('membermap/markdown.html', {'entry': self}).strip() + msg = render_to_string('membermap/markdown.html', { + 'user': self.user, + 'msg': site_markup(self.message)}).strip() + self.json = json.dumps({'name': self.user.username, 'lat': '%10.6f' % self.lat, 'lon': '%10.6f' % self.lon, @@ -35,4 +39,3 @@ }) super(MapEntry, self).save(force_insert, force_update) -# vim: ts=4 sw=4 diff -r bc657962941e -r 13d052fbe4f1 gpp/smiley/templatetags/smiley_tags.py --- a/gpp/smiley/templatetags/smiley_tags.py Sat Dec 19 04:59:06 2009 +0000 +++ b/gpp/smiley/templatetags/smiley_tags.py Sat Dec 19 19:34:16 2009 +0000 @@ -22,7 +22,10 @@ @register.filter @stringfilter def smiley_markdown(value, autoescape=False): - """A filter to "smilify" text by replacing text with HTML img tags of smilies.""" + """ + A filter to "smilify" text by replacing text with Markdown image notation + for smilies. + """ from smiley import smilify_markdown return mark_safe(smilify_markdown(value, autoescape=autoescape)) smiley_markdown.needs_autoescape = True diff -r bc657962941e -r 13d052fbe4f1 gpp/templates/membermap/index.html --- a/gpp/templates/membermap/index.html Sat Dec 19 04:59:06 2009 +0000 +++ b/gpp/templates/membermap/index.html Sat Dec 19 19:34:16 2009 +0000 @@ -27,18 +27,11 @@
Members on the map: 0 • Recent updates: + • All Members: +
{% endif %} -
- {% if user.is_authenticated %} -
- Members:
- -
- {% endif %} -
-
+
{% if user.is_authenticated %} diff -r bc657962941e -r 13d052fbe4f1 gpp/templates/membermap/markdown.html --- a/gpp/templates/membermap/markdown.html Sat Dec 19 04:59:06 2009 +0000 +++ b/gpp/templates/membermap/markdown.html Sat Dec 19 19:34:16 2009 +0000 @@ -1,4 +1,4 @@ {% load markup %} {% load smiley_tags %} {% load avatar_tags %} -{% avatar entry.user "left" %}{{ entry.user.username }}:
{{ entry.message|smiley_markdown|markdown:"safe" }} +{% avatar user "left" %}{{ user.username }}:
{{ msg|safe }} diff -r bc657962941e -r 13d052fbe4f1 media/css/membermap.css --- a/media/css/membermap.css Sat Dec 19 04:59:06 2009 +0000 +++ b/media/css/membermap.css Sat Dec 19 19:34:16 2009 +0000 @@ -2,10 +2,10 @@ float: left; } #member_map_map { - float: left; - width: 640px; - height: 480px; + width: 720px; + height: 540px; border: 1px solid black; + margin: 0 auto; } #member_map_info { padding-top: 1em; diff -r bc657962941e -r 13d052fbe4f1 media/js/membermap.js --- a/media/js/membermap.js Sat Dec 19 04:59:06 2009 +0000 +++ b/media/js/membermap.js Sat Dec 19 19:34:16 2009 +0000 @@ -18,11 +18,6 @@ clear: function() { mmap.users.length = 0; }, - resizeUserList: function() { - var sel = $('#member_map_members'); - sel[0].size = Math.min(29, sel[0].length); - $('#member_map_count').html(sel[0].length); - }, selectText: "(select)", onMapDir: 'You have previously added yourself to the member map. Your information appears below. You may change ' + 'the information if you wish. To delete yourself from the map, click the Delete button.', @@ -47,6 +42,7 @@ mmap.map.clearOverlays(); var sel = $('#member_map_members'); sel[0].length = 0; + sel.append($('