Skip to content

Commit dfbed1e

Browse files
author
Alsaihn
committed
Updated locality in search fields to PA - should make a setting instead
Fixed zip/nh update on new tree save Updated verify page and rep actions
1 parent ab73dbf commit dfbed1e

File tree

9 files changed

+247
-188
lines changed

9 files changed

+247
-188
lines changed

settings_audit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ def get_diff(instance):
1616
GLOBAL_TRACK_FIELDS = (
1717
('_audit_user_rep', models.IntegerField(), get_user_rep),
1818
('_audit_diff', models.TextField(), get_diff),
19-
#('_audit_verified', models.IntegerField(), 0)
19+
('_audit_verified', models.IntegerField(), 0)
2020
)

static/treemap.js

+31-18
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ var tm_urls = {
1010
eactive_key : '898cfa06a63e5ad7a427a30896cd95c2',
1111
// now pulled in from settings file...
1212
//tc_url : 'http://tc2.beardedmaps.com/tilecache.cgi/1.0.0/'
13-
tc_url : 'http://tilecache.urbanforestmap.org/tiles/1.0.0/trees/',
13+
//tc_url : 'http://tilecache.urbanforestmap.org/tiles/1.0.0/trees/',
14+
tc_url : 'http://sajara01.internal.azavea.com/tilecache/tiles/1.0.0/trees/',
1415
qs_tile_url : '/qs_tiles/1.0.0/foo/' // layername is pulled from request.GET, can remove 'foo' eventually
1516
};
1617

@@ -85,7 +86,7 @@ var tm = {
8586
if (this.value) {
8687
tm.handleSearchLocation(this.value);
8788
} else {
88-
$("#location_search_input").val("San Francisco, CA");
89+
$("#location_search_input").val("Philadelphia, PA");
8990
delete tm.searchParams['location'];
9091
tm.updateSearch();
9192

@@ -236,7 +237,7 @@ var tm = {
236237
}
237238
function triggerSearch() {
238239
var q = $.query.empty();
239-
if ($("#location_search_input").val() != "San Francisco, CA") {
240+
if ($("#location_search_input").val() != "Philadelphia, PA") {
240241
q = q.set("location", $("#location_search_input").val());
241242
}
242243
if ($("#species_search_id").val()) {
@@ -278,10 +279,10 @@ var tm = {
278279
},
279280
setup : function(){
280281
tm.geocoder = new GClientGeocoder();
281-
tm.map.setCenter(new GLatLng(37.76, -122.45), 12);
282+
tm.map.setCenter(new GLatLng(39.99, -75.19), 11);
282283
// bounds based on new GLatLng(37.76, -122.45), 10);
283284
// we should consider making this a user-set database value
284-
tm.maxExtent = new GLatLngBounds(new GLatLng(37.65,-122.7), new GLatLng(37.85,-122.2));
285+
tm.maxExtent = new GLatLngBounds(new GLatLng(39.75,-76), new GLatLng(40.5,-74.5));
285286
tm.geocoder.setViewport(tm.maxExtent) //bias results for sf
286287
},
287288

@@ -346,7 +347,7 @@ var tm = {
346347
jQuery('#id_edit_address_street').change(function(nearby_field){
347348
//console.log(nearby_field);
348349
var new_addy = nearby_field.target.value;
349-
new_addy += ", sf";
350+
//new_addy += ", ph";
350351
if (!tm.tree_marker && new_addy){ //only add marker if it doesn't yet exist
351352

352353
tm.geocoder.getLatLng(new_addy, function(ll){
@@ -421,7 +422,7 @@ var tm = {
421422
jQuery('#id_nearby_address').change(function(nearby_field){
422423

423424
var new_addy = nearby_field.target.value;
424-
new_addy += ', sf';
425+
//new_addy += ', ph';
425426
tm.geocoder.getLatLng(new_addy, function(ll){
426427
if (tm.validate_point(ll,new_addy) && !tm.tree_marker){ //only add marker if it doesn't yet exist
427428
tm.add_new_tree_marker(ll);
@@ -543,12 +544,12 @@ var tm = {
543544

544545
this.set_default_map_zoom_levels();
545546
//set map zoom levels
546-
jQuery.each(tm.map.getMapTypes(), function(i,mt){
547-
mt.getMinimumResolution = function() {return 12;}
548-
mt.getMaximumResolution = function() {return 19;}
549-
if (mt.getName() == 'Terrain') {mt.getMaximumResolution = function() { return 15;}}
550-
//if (mt.getName() == 'Satellite') {tm.map.removeMapType(mt);}
551-
});
547+
//jQuery.each(tm.map.getMapTypes(), function(i,mt){
548+
// mt.getMinimumResolution = function() {return 10;}
549+
// mt.getMaximumResolution = function() {return 19;}
550+
// if (mt.getName() == 'Terrain') {mt.getMaximumResolution = function() { return 15;}}
551+
// //if (mt.getName() == 'Satellite') {tm.map.removeMapType(mt);}
552+
// });
552553

553554
//todo replace map layer with custom
554555

@@ -631,7 +632,7 @@ var tm = {
631632
set_default_map_zoom_levels : function(){
632633
//set map zoom levels
633634
jQuery.each(tm.map.getMapTypes(), function(i,mt){
634-
mt.getMinimumResolution = function() {return 12;}
635+
mt.getMinimumResolution = function() {return 10;}
635636
mt.getMaximumResolution = function() {return 19;}
636637
if (mt.getName() == 'Terrain') {mt.getMaximumResolution = function() { return 15;}}
637638
//if (mt.getName() == 'Satellite') {tm.map.removeMapType(mt);}
@@ -878,7 +879,7 @@ var tm = {
878879
//ew.html(addy + ' in ' + geog.name);
879880
}
880881
} else {
881-
$('#summary_subset_val').html('San Francisco');
882+
$('#summary_subset_val').html('Philadelphia');
882883
}
883884
if (results.tile_query){
884885
tm.selected_tile_query = results.tile_query;
@@ -966,7 +967,7 @@ var tm = {
966967
var lat_lon = new GLatLng(point.lat(),point.lng(),0);
967968

968969
if (tm.maxExtent && !tm.maxExtent.containsLatLng(lat_lon)){
969-
alert("Sorry, '" + address + "' appears not to be within San Francisco");
970+
alert("Sorry, '" + address + "' appears to be too far away from our supported area.");
970971
return false;
971972
}
972973
return true;
@@ -977,7 +978,7 @@ var tm = {
977978
address = jQuery('#searchInput').text();
978979
}
979980
tm.geocoder.setViewport(tm.map.getBounds());
980-
var address = address + ", sf";
981+
//var address = address + ", ph";
981982
tm.geocoder.getLatLng(address,function(point) {
982983
if (tm.validate_point(point,address)) {
983984
if (tm.location_marker) {tm.map.removeOverlay(tm.location_marker)}
@@ -1545,7 +1546,19 @@ var tm = {
15451546
updateSpeciesFromKey: function(tree_code, tree_cultivar) {
15461547
alert(tree_code);
15471548
},
1548-
1549+
1550+
updateReputation: function(change_type, change_id, rep_dir) {
1551+
$.ajax({
1552+
url: '/verify/' + change_type + '/' + change_id + '/' + rep_dir,
1553+
dataType: 'json',
1554+
success: function(response) {
1555+
$("#" + response.change_type + "_" + response.change_id).fadeOut();
1556+
},
1557+
error: function(err) {
1558+
alert("Error: " + err.status + "\nQuery: " + change_type + " " + change_id + " " + rep_dir);
1559+
}
1560+
});
1561+
},
15491562

15501563
}
15511564
$.editable.addInputType("autocomplete_species", {

0 commit comments

Comments
 (0)