community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1746040 - in /comdev/nearby_people: nearby/dates.py templates/years_map.html
Date Sun, 29 May 2016 18:07:04 GMT
Author: nick
Date: Sun May 29 18:07:04 2016
New Revision: 1746040

URL: http://svn.apache.org/viewvc?rev=1746040&view=rev
Log:
Mostly get the slider working for the map-by-year

Modified:
    comdev/nearby_people/nearby/dates.py
    comdev/nearby_people/templates/years_map.html

Modified: comdev/nearby_people/nearby/dates.py
URL: http://svn.apache.org/viewvc/comdev/nearby_people/nearby/dates.py?rev=1746040&r1=1746039&r2=1746040&view=diff
==============================================================================
--- comdev/nearby_people/nearby/dates.py (original)
+++ comdev/nearby_people/nearby/dates.py Sun May 29 18:07:04 2016
@@ -68,7 +68,7 @@ class UIDDates(object):
             self.dates = {}
             ldif = open(UID_CREATED_LDIF, "r")
             for line in ldif.readlines():
-                if not line:
+                if line.startswith("# "):
                     if "uid" in person and "created" in person:
                         self.dates[person["uid"]] = person["created"]
                     person = {}
@@ -78,5 +78,6 @@ class UIDDates(object):
                          k = "created"
                          ymd = [int(x) for x in (v[0:4],v[4:6],v[6:8])]
                          v = datetime.date(*ymd)
+                    person[k] = v
         except IOError, e:
              sys.stderr.write("Unable to process created LDIF file: %s\n" % e)

Modified: comdev/nearby_people/templates/years_map.html
URL: http://svn.apache.org/viewvc/comdev/nearby_people/templates/years_map.html?rev=1746040&r1=1746039&r2=1746040&view=diff
==============================================================================
--- comdev/nearby_people/templates/years_map.html (original)
+++ comdev/nearby_people/templates/years_map.html Sun May 29 18:07:04 2016
@@ -8,6 +8,7 @@
 {% block initmap %}
 <script type="text/javascript" charset="utf-8">
 <!--
+var years = {};
 $(document).ready(function(){
 	if (GBrowserIsCompatible()) {
 		map = new GMap2(document.getElementById('map'));
@@ -25,13 +26,62 @@ $(document).ready(function(){
             marker = createMarker("{{person.name}}",{{person.latitude}},
                          {{person.longitude}},"{{person.link}}", projectNames,
                          "{{person.avatar}}","{{person.email|emailformat}}");
+            marker.onMap = true;
             map.addOverlay(marker);
             markers["{{person.uid}}"] = marker;
+            years["{{person.uid}}"] = {{person.year}};
       {% endfor %}
    }
+
+   var sliderUpdate = function() {
+      // Update the year display
+      var until = $('#slider').val();
+      $('#year').text(until + " and before");
+
+      // Change markers
+      Object.keys(years).forEach(function(uid) {
+         var year = years[uid];
+         var marker = markers[uid];
+         var shouldShow = false;
+         if (year <= until) {
+            shouldShow = true;
+         }
+         if (shouldShow == marker.onMap) {
+            // No change needed
+         } else if (shouldShow) {
+            map.addOverlay(marker);
+            marker.onMap = true;
+         } else {
+            map.removeOverlay(marker);
+            marker.onMap = false;
+         } 
+      });
+   };
+   // Update display on slider change
+   $('#slider').change(sliderUpdate);
+   // Ensure we have a consistent starting display
+   sliderUpdate();
 });
 //-->
 </script>
+<style type="text/css">
+#map.col1map {
+   float: left; 
+}
+div#years {
+   float: right;
+   width: 15%;
+   height: 500px;
+}
+#withslider {
+   margin-top: 3em;
+}
+input#slider {
+   /* transform: rotate(90deg); */
+   -webkit-appearance: slider-vertical;
+   writing-mode: bt-lr;
+}
+</style>
 {% endblock %}
 {% block content %}
 
@@ -40,12 +90,22 @@ $(document).ready(function(){
  FOAF files. It allows you to <i>somewhat</i> see how this has changed
  over time. Caveats below!.</p>
 
-<p><b>TODO: Filtering</b></p>
-
 <div id="map" class="col1map"></div>
 
+<!-- TODO veritical on the right -->
+<div id="years">
+  <div>People who became committers:</div>
+  <fieldset>
+    <label for="slider" id="year">{{end_year}}</label>
+    <span id="withslider">
+      <input type="range" id="slider" class="vSlider" 
+             orient="vertical" value="{{end_year}}"
+             min="{{start_year}}" max="{{end_year}}" step="1" />
+    </span>
+  </fieldset>
+</div>
+
 <br clear="all" />
-<br /><br /><br />
 
 <p>Some notes:</p>
 <ul>
@@ -60,24 +120,7 @@ $(document).ready(function(){
   then.</li>
 </ul>
 
-<p>This map is updated every few hours based on committer FOAF files
- with locations in. If you're an ASF committer and you'd like to be
- shown here, please see
- <a href="http://web.archive.org/web/20160123121801/https://people.apache.org/foaf/index.html">this
archived page</a>
- for details on what your FOAF file needs to contain and where it needs
- to live.</p>
-<p>If you are interested, you can also list yourself as a
- <a href="http://community.apache.org/localmentors.html">Local Mentor</a>
- or as a 
- <a href="http://community.apache.org/speakers/speakers.html">Local Speaker</a>,
- which will allow people to search for you <a href="/">here</a>.
-</p>
-
-<br />
-
-<p>To see somewhat how this map has changed over time, please see the
- <a href="/map/years/">map of current public locations, filtered by the year
- someone became a committer</a>.
-</p>
+<p>If you're a committer, please see <a href="/map">the main map</a> for

+ more details on getting yourself added in</p>
 
 {% endblock %}



Mime
View raw message