fix all the pronto remarks finally
- fix map controls in stream
This commit is contained in:
parent
52fac5740e
commit
1cdcc50c63
8 changed files with 16 additions and 9 deletions
|
|
@ -30,7 +30,9 @@ app.views.LocationStream = app.views.Content.extend({
|
||||||
|
|
||||||
tiles = L.tileLayer("https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}", {
|
tiles = L.tileLayer("https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}", {
|
||||||
id: gon.appConfig.map.mapbox.id,
|
id: gon.appConfig.map.mapbox.id,
|
||||||
|
/* jshint camelcase: false */
|
||||||
accessToken: gon.appConfig.map.mapbox.access_token,
|
accessToken: gon.appConfig.map.mapbox.access_token,
|
||||||
|
/* jshint camelcase: true */
|
||||||
attribution: "Map data © <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors, " +
|
attribution: "Map data © <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors, " +
|
||||||
"<a href='http://creativecommons.org/licenses/by-sa/2.0/''>CC-BY-SA</a>, " +
|
"<a href='http://creativecommons.org/licenses/by-sa/2.0/''>CC-BY-SA</a>, " +
|
||||||
"Imagery © <a href='https://www.mapbox.com'>Mapbox</a>",
|
"Imagery © <a href='https://www.mapbox.com'>Mapbox</a>",
|
||||||
|
|
@ -40,7 +42,7 @@ app.views.LocationStream = app.views.Content.extend({
|
||||||
|
|
||||||
tiles.addTo(map);
|
tiles.addTo(map);
|
||||||
|
|
||||||
var markerOnMap = L.marker(location).addTo(map);
|
L.marker(location).addTo(map);
|
||||||
mapContainer.removeClass("empty");
|
mapContainer.removeClass("empty");
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,9 @@ app.views.SinglePostContent = app.views.Base.extend({
|
||||||
|
|
||||||
tiles = L.tileLayer("https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}", {
|
tiles = L.tileLayer("https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}", {
|
||||||
id: gon.appConfig.map.mapbox.id,
|
id: gon.appConfig.map.mapbox.id,
|
||||||
|
/* jshint camelcase: false */
|
||||||
accessToken: gon.appConfig.map.mapbox.access_token,
|
accessToken: gon.appConfig.map.mapbox.access_token,
|
||||||
|
/* jshint camelcase: true */
|
||||||
attribution: "Map data © <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors, " +
|
attribution: "Map data © <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors, " +
|
||||||
"<a href='http://creativecommons.org/licenses/by-sa/2.0/''>CC-BY-SA</a>, " +
|
"<a href='http://creativecommons.org/licenses/by-sa/2.0/''>CC-BY-SA</a>, " +
|
||||||
"Imagery © <a href='https://www.mapbox.com'>Mapbox</a>",
|
"Imagery © <a href='https://www.mapbox.com'>Mapbox</a>",
|
||||||
|
|
@ -68,7 +70,7 @@ app.views.SinglePostContent = app.views.Base.extend({
|
||||||
map.invalidateSize();
|
map.invalidateSize();
|
||||||
|
|
||||||
// put marker on map
|
// put marker on map
|
||||||
var markerOnMap = L.marker(location).addTo(map);
|
L.marker(location).addTo(map);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,9 @@
|
||||||
font-size: $font-size-small;
|
font-size: $font-size-small;
|
||||||
color: $text-grey;
|
color: $text-grey;
|
||||||
}
|
}
|
||||||
|
.leaflet-control-zoom {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
.grey { color: $text-grey; }
|
.grey { color: $text-grey; }
|
||||||
.post-content p:last-of-type { margin-bottom: 0; }
|
.post-content p:last-of-type { margin-bottom: 0; }
|
||||||
.nsfw-shield {
|
.nsfw-shield {
|
||||||
|
|
|
||||||
|
|
@ -140,10 +140,9 @@ FactoryGirl.define do
|
||||||
end
|
end
|
||||||
|
|
||||||
factory(:location) do
|
factory(:location) do
|
||||||
address "Starco Mart, Mission Street, West SoMa, San Francisco, San Francisco "\
|
address "Fernsehturm Berlin, Berlin, Germany"
|
||||||
"City and County, Kalifornien, 94103, Vereinigte Staaten von Amerika"
|
lat 52.520645
|
||||||
lat 37.78
|
lng 13.409779
|
||||||
lng -122.41
|
|
||||||
end
|
end
|
||||||
|
|
||||||
factory(:poll) do
|
factory(:poll) do
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@ describe("app.views.LocationStream", function() {
|
||||||
beforeEach(function(){
|
beforeEach(function(){
|
||||||
this.post = factory.post();
|
this.post = factory.post();
|
||||||
this.view = new app.views.LocationStream({model : this.post});
|
this.view = new app.views.LocationStream({model : this.post});
|
||||||
|
/* jshint camelcase: false */
|
||||||
gon.appConfig = {map: { mapbox: {enabled: true, id: "yourID", access_token: "yourAccessToken" }}};
|
gon.appConfig = {map: { mapbox: {enabled: true, id: "yourID", access_token: "yourAccessToken" }}};
|
||||||
|
/* jshint camelcase: true */
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("toggleMap", function() {
|
describe("toggleMap", function() {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
describe("app.views.Location", function(){
|
describe("app.views.Location", function(){
|
||||||
beforeEach(function(){
|
beforeEach(function(){
|
||||||
OSM = {};
|
|
||||||
OSM.Locator = function(){return { getAddress:function(){}}};
|
OSM.Locator = function(){return { getAddress:function(){}}};
|
||||||
|
|
||||||
this.view = new app.views.Location();
|
this.view = new app.views.Location();
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ var factory = {
|
||||||
|
|
||||||
location : function() {
|
location : function() {
|
||||||
return {
|
return {
|
||||||
address: "Starco Mart, Mission Street, West SoMa, San Francisco, San Francisco City and County, Kalifornien, 94103, Vereinigte Staaten von Amerika",
|
address: "Starco Mart, Mission Street, San Francisco, Kalifornien, 94103, Vereinigte Staaten von Amerika",
|
||||||
lat: 37.78,
|
lat: 37.78,
|
||||||
lng: -122.41
|
lng: -122.41
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ describe StatusMessage, type: :model do
|
||||||
describe ".guids_for_author" do
|
describe ".guids_for_author" do
|
||||||
it "returns an array of the status_message guids" do
|
it "returns an array of the status_message guids" do
|
||||||
status_message_1 = FactoryGirl.create(:status_message, author: alice.person)
|
status_message_1 = FactoryGirl.create(:status_message, author: alice.person)
|
||||||
status_message_2 = FactoryGirl.create(:status_message, author: bob.person)
|
FactoryGirl.create(:status_message, author: bob.person)
|
||||||
guids = StatusMessage.guids_for_author(alice.person)
|
guids = StatusMessage.guids_for_author(alice.person)
|
||||||
expect(guids).to eq([status_message_1.guid])
|
expect(guids).to eq([status_message_1.guid])
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue