annotate gpp/templates/membermap/index.html @ 318:c550933ff5b6

Fix a bug where you'd get an error when trying to delete a forum thread (topic does not exist). Apparently when you call topic.delete() the posts would get deleted, but the signal handler for each one would run, and it would try to update the topic's post count or something, but the topic was gone? Reworked the code a bit and explicitly delete the posts first. I also added a sync() call on the parent forum since post counts were not getting adjusted.
author Brian Neal <bgneal@gmail.com>
date Sat, 05 Feb 2011 21:46:52 +0000
parents 88b2b9cb8c1f
children
rev   line source
gremmie@1 1 {% extends 'base.html' %}
bgneal@310 2 {% load url from future %}
bgneal@133 3 {% load core_tags %}
gremmie@1 4 {% block title %}Member Map{% endblock %}
gremmie@1 5 {% block custom_js %}
bgneal@312 6 <script type="text/javascript" src="{{ STATIC_URL }}js/membermap.js"></script>
bgneal@72 7 <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAql_1Xw9MGW3mOxzo8gLb3hSrh5-ALlu4lmYDsscYaAokjyRNqBRaVcqVr3jaDgMRVSK_3HydK9tYWw" type="text/javascript"></script>
gremmie@1 8 {{ form.media }}
bgneal@312 9 <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/membermap.css" />
gremmie@1 10 <script type="text/javascript">
gremmie@1 11 //<![CDATA[
gremmie@1 12 var mmapUser = {
gremmie@1 13 {% if user.is_authenticated %}
gremmie@1 14 userName : "{{ user.username }}",
gremmie@1 15 userId : "{{ user.id }}"
gremmie@1 16 {% else %}
gremmie@1 17 userName : null,
gremmie@1 18 userId : null
gremmie@1 19 {% endif %}
gremmie@1 20 };
gremmie@1 21 //]]>
gremmie@1 22 </script>
gremmie@1 23 {% endblock %}
gremmie@1 24 {% block content %}
gremmie@1 25 <h2>Member Map</h2>
gremmie@1 26 <div id="member_map_main">
gremmie@1 27 {% if user.is_authenticated %}
gremmie@1 28 <div id="member_map_top">
gremmie@1 29 Members on the map: <span id="member_map_count">0</span> &bull; Recent updates:
gremmie@1 30 <select id="member_map_recent"><option value="0" selected="selected">(select)</option></select>
bgneal@153 31 &bull; All Members:
bgneal@153 32 <select id="member_map_members"><option value="0" selected="selected">(select)</option></select>
gremmie@1 33 </div>
gremmie@1 34 {% endif %}
bgneal@153 35 <div id="member_map_map">
gremmie@1 36 </div>
gremmie@1 37 <div id="member_map_info">
gremmie@1 38 {% if user.is_authenticated %}
gremmie@1 39 <p id="member_map_directions"></p>
gremmie@1 40 <p>
gremmie@1 41 The location you enter below will not be shown to others, but can be determined from the map.
gremmie@1 42 For privacy reasons, we don't recommend you enter your exact address. Use a nearby intersection,
gremmie@1 43 landmark, or just keep it city and state.
gremmie@1 44 </p>
gremmie@1 45 <p>
gremmie@1 46 Example locations:
gremmie@1 47 </p>
gremmie@1 48 <ul>
gremmie@1 49 <li>3rd and Main, Chicago, IL</li>
gremmie@1 50 <li>Tucson, Arizona</li>
gremmie@1 51 <li>Rome, Italy</li>
gremmie@1 52 <li>5018EA, Tilburg, Netherlands</li>
gremmie@1 53 </ul>
bgneal@194 54 <form action="" method="post">{% csrf_token %}
gremmie@1 55 {{ form.as_p }}
bgneal@133 56 {% comment_dialogs %}
gremmie@1 57 <input type="submit" id="member_map_submit" name="submit" value="Submit" />
gremmie@1 58 <input type="submit" id="member_map_delete" name="delete" value="Delete" />
gremmie@1 59 </form>
bgneal@133 60 <br />
gremmie@1 61 {% else %}
gremmie@1 62 <p>
gremmie@1 63 The member map allows members to place themselves on a google map along with a short message.
gremmie@1 64 This feature is only for registered users of SurfGuitar101.com. Please
bgneal@310 65 <a href="{% url 'accounts-login' %}">login</a> or
bgneal@310 66 <a href="{% url 'accounts-register' %}">register</a> to use the member map.
gremmie@1 67 </p>
gremmie@1 68 {% endif %}
gremmie@1 69 </div>
gremmie@1 70 </div>
gremmie@1 71 {% endblock %}