<commit_before>{% extends 'base/one_column.html' %}

{% block title %}
People
{% endblock title %}

{% block css %}
{{ block.super }}
@import url('/static/css/profile/search_people.css');
{% endblock css %}

{% block main %}
<img alt='People on OpenHatch' id='people-search' alt='People on OpenHatch' src='/static/images/people-search.png' />
<div id='big-people-list' class='module'>
    <div class='module-content body'>
        {% if property and value %}
        where {{ property }} = {{ value }}
        {% endif %}
        <div id="map_canvas" style="float: left; margin-right: 10px; width:70%; height:450px"></div>
        <ul style='float: left; width: 20%;'>
            {% for person in people %}
            {% if person.user.username %}
	    <li id="person_bullet_{{person.pk}}" style="display: none;">
            <a href='/people/{{person.user.username}}'>
                {% if person.user.first_name or person.user.last_name %}
                {{ person.user.first_name }} {{ person.user.last_name }} ({{ person.user.username }})
                {% else %}
                {{ person.user.username }}
                {% endif %}
            </a>
            </li>
            {% endif %}
            {% endfor %}
        </ul>
    </div>
</div>
{% endblock main %}

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

  var person_id2data = {{ person_id2data_as_json|safe}};

var update_all_markers;

  function initialize() {
 

    var all_markers = [];

    var geocoder =  new google.maps.Geocoder();

    var latlng = new google.maps.LatLng(-34.397, 150.644);
    var myOptions = {
      zoom: 8,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

    for (var person_id in person_id2data) {
      var data = person_id2data[person_id];
      var location_name = data['location'];
      var name = data['name'];
      
      function create_a_callback(person_name) {
	return function(results, status) {
	  if (status == google.maps.GeocoderStatus.OK) {
	    map.setCenter(results[0].geometry.location);
	    var marker = new google.maps.Marker({
	      map: map, 
		  title: name,
		  person_id: person_id,
		  position: results[0].geometry.location
		  });
	    google.maps.event.addListener(marker,
					  'click',
					  function() { 	alert('hi'); });
	    all_markers.push(marker);
	  } else {
	    console.log("Geocode was not successful for the following reason: " + status);
	  }
	}
      };

      geocoder.geocode( { 'address': location_name}, create_a_callback(name));
    
    }

    function generate_update_all_markers(map) {
      return function() {
	/* This only makes up to 10 people show on the right. */
	var shown_this_many = 0;
	
	for (var i = 0; i < all_markers.length; i++) {
	  var marker = all_markers[i];
	  var $person_bullet = $('#person_bullet_' + marker.person_id);
	  if (map.getBounds().contains(marker.position) && 
	      shown_this_many < 10) {
	    $person_bullet.show();<commit_msg>Use a variable instead of a magic number<commit_after>{% extends 'base/one_column.html' %}

{% block title %}
People
{% endblock title %}

{% block css %}
{{ block.super }}
@import url('/static/css/profile/search_people.css');
{% endblock css %}

{% block main %}
<img alt='People on OpenHatch' id='people-search' alt='People on OpenHatch' src='/static/images/people-search.png' />
<div id='big-people-list' class='module'>
    <div class='module-content body'>
        {% if property and value %}
        where {{ property }} = {{ value }}
        {% endif %}
        <div id="map_canvas" style="float: left; margin-right: 10px; width:70%; height:450px"></div>
        <ul style='float: left; width: 20%;'>
            {% for person in people %}
            {% if person.user.username %}
	    <li id="person_bullet_{{person.pk}}" style="display: none;">
            <a href='/people/{{person.user.username}}'>
                {% if person.user.first_name or person.user.last_name %}
                {{ person.user.first_name }} {{ person.user.last_name }} ({{ person.user.username }})
                {% else %}
                {{ person.user.username }}
                {% endif %}
            </a>
            </li>
            {% endif %}
            {% endfor %}
        </ul>
    </div>
</div>
{% endblock main %}

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

  var person_id2data = {{ person_id2data_as_json|safe}};

var update_all_markers;

  function initialize() {
 

    var all_markers = [];

    var geocoder =  new google.maps.Geocoder();

    var latlng = new google.maps.LatLng(-34.397, 150.644);
    var myOptions = {
      zoom: 8,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

    for (var person_id in person_id2data) {
      var data = person_id2data[person_id];
      var location_name = data['location'];
      var name = data['name'];
      
      function create_a_callback(person_name) {
	return function(results, status) {
	  if (status == google.maps.GeocoderStatus.OK) {
	    map.setCenter(results[0].geometry.location);
	    var marker = new google.maps.Marker({
	      map: map, 
		  title: name,
		  person_id: person_id,
		  position: results[0].geometry.location
		  });
	    google.maps.event.addListener(marker,
					  'click',
					  function() { 	alert('hi'); });
	    all_markers.push(marker);
	  } else {
	    console.log("Geocode was not successful for the following reason: " + status);
	  }
	}
      };

      geocoder.geocode( { 'address': location_name}, create_a_callback(name));
    
    }

    function generate_update_all_markers(map) {
      return function() {
	/* This only makes up to 10 people show on the right. */
	var MAX_TO_SHOW = 10;
	var shown_this_many = 0;
	
	for (var i = 0; i < all_markers.length; i++) {
	  var marker = all_markers[i];
	  var $person_bullet = $('#person_bullet_' + marker.person_id);
	  if (map.getBounds().contains(marker.position) && 
	      shown_this_many < MAX_TO_SHOW) {
	    $person_bullet.show();
{'fraction_non_alphanumeric': 0.15510460909233914, 'fraction_numerical': 0.010382255781028787, 'mean_word_length': 2.694363742010459, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 35, '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': '3395878', 'n_tokens_mistral': 2215, 'n_tokens_neox': 1994, 'n_words': 435}