<commit_before>{% extends 'profile/people.html' %}

{% block title %}
Map of People
{% endblock title %}

{% block people_main %}
        {% if property and value %}
        where {{ property }} = {{ value }}
        {% endif %}
        {% comment %}
            Google loads a map here -- replacing #map_loading_msg, among other things.
            The background image will hide, as intended, a few seconds after page load.
            However, this doesn't seem to work properly when the image is specified
            via an external stylesheet.
        {% endcomment %}
        <div id="map_canvas" style='float: right; margin-top: 18px; margin-right: 10px; width:65%; height:450px;background: url("/static/images/profile/map_for_loading.png") top no-repeat;'>
            <div id='map_loading_msg'>
                <img src='/static/images/icons/throbber.png' />
                <span>Loading map&hellip;</span>
            </div>
        </div>

        {# JavaScript edits this text. #}
        <p id="people-count">Loading...</p>
        
        <ul id="people-list" class="people-list-map">
            {% for person in people %}
                {% if person.user.username %}
                    {% include 'profile/person-summary-li.html' %}
                {% endif %}
            {% endfor %}
        </ul>
        {% endblock people_main %}

{% block js_before_bundle %}
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
{% endblock js_before_bundle %}

{% block js %}
{{ block.super }}
<script type="text/javascript">
    mapController = new PeopleMapController(); 
    $(function () {
        mapController.initialize({
                'person_id2data': {{ person_id2data_as_json|safe}},
                'num_of_persons_with_locations': {{ num_of_persons_with_locations }}
        });
        mapController.bindClickHandlersToPeopleListItems();
    });
</script>
{% endblock js %}

{% block js_tests %}
{% comment %}
    This block only shows up if this page has a query string with ?test=1.
    These are JavaScript unit tests. Unless /static/js/tester.js has changed,
    they will run with FireUnit <http://fireunit.org>, which is an extension for
    Firebug <http://getfirebug.com>.
{% endcomment %}
<script type='text/javascript' src="/static/js/profile/map-tests.js"></script>
{% endblock js_tests %}
<commit_msg>Now clicking a button causes you to scroll the map.<commit_after>{% extends 'profile/people.html' %}

{% block title %}
Map of People
{% endblock title %}

{% block people_main %}
        {% if property and value %}
        where {{ property }} = {{ value }}
        {% endif %}
        {% comment %}
            Google loads a map here -- replacing #map_loading_msg, among other things.
            The background image will hide, as intended, a few seconds after page load.
            However, this doesn't seem to work properly when the image is specified
            via an external stylesheet.
        {% endcomment %}
        <div id="search" style="float: right; width: 65%; margin-right: 10px;">
            <ul>
                <li style="display: inline;">Center the map at:</li>
                <li><input id="location_for_map_centering" type="text" style="float: right; display: inline; "/></li>
                <li><input id="center_the_map" type="button" style="float: right; display: inline;"/></li>
            </ul>
        </div>
        <div id="map_canvas" style='float: right; margin-top: 18px; margin-right: 10px; width:65%; height:450px;background: url("/static/images/profile/map_for_loading.png") top no-repeat;'>
            <div id='map_loading_msg'>
                <img src='/static/images/icons/throbber.png' />
                <span>Loading map&hellip;</span>
            </div>
        </div>

        {# JavaScript edits this text. #}
        <p id="people-count">Loading...</p>
        
        <ul id="people-list" class="people-list-map">
            {% for person in people %}
                {% if person.user.username %}
                    {% include 'profile/person-summary-li.html' %}
                {% endif %}
            {% endfor %}
        </ul>
        {% endblock people_main %}

{% block js_before_bundle %}
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
{% endblock js_before_bundle %}

{% block js %}
{{ block.super }}
<script type="text/javascript">
    mapController = new PeopleMapController(); 
    $(function () {
        mapController.initialize({
                'person_id2data': {{ person_id2data_as_json|safe}},
                'num_of_persons_with_locations': {{ num_of_persons_with_locations }}
        });
        mapController.bindClickHandlersToPeopleListItems();
        var center_and_zoom_the_map = function () {
            var location = $('#location_for_map_centering').val();
            var callback_to_geocode_then_center_and_zoom = function(results, status) {
                if (status == google.maps.GeocoderStatus.OK) {
                    mapController.map.setCenter(results[0].geometry.location);
                    mapController.map.setZoom(5);
                }
            };
            var geocoder = new google.maps.Geocoder();
            geocoder.geocode( {'address': location},
                              callback_to_geocode_then_center_and_zoom);
        }
        $('#center_the_map').click(center_and_zoom_the_map);
    });
</script>
{% endblock js %}

{% block js_tests %}
{% comment %}
    This block only shows up if this page has a query string with ?test=1.
    These are JavaScript unit tests. Unless /static/js/tester.js has changed,
    they will run with FireUnit <http://fireunit.org>, which is an extension for
    Firebug <http://getfirebug.com>.
{% endcomment %}
<script type='text/javascript' src="/static/js/profile/map-tests.js"></script>
{% endblock js_tests %}

{'fraction_non_alphanumeric': 0.1374174987307497, 'fraction_numerical': 0.00507700118463361, 'mean_word_length': 2.379073756432247, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4614331', 'n_tokens_mistral': 1781, 'n_tokens_neox': 1643, 'n_words': 413}