-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pages tagged with place get a full-width map across the top of the page (instead of in the sidebar) #5518
Merged
Merged
Pages tagged with place get a full-width map across the top of the page (instead of in the sidebar) #5518
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1027f97
full width map from sidebar
sagarpreet-chadha cd56a97
indentation done
sagarpreet-chadha 4b218b5
code climate issue fixed
sagarpreet-chadha 0a4d444
system test added
sagarpreet-chadha 0d14076
system test added
sagarpreet-chadha e386cd7
system test modification
sagarpreet-chadha a508aee
assert presence of div
sagarpreet-chadha 3adec0f
assert_selector used
sagarpreet-chadha 0ff21d6
tests modified
sagarpreet-chadha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,9 @@ | |
<% if @node && @node.has_power_tag('response') %> | ||
<%= render partial: 'sidebar/notes', locals: { notes: @node.responses, title: I18n.t('sidebar._related.responses_to_note'), node: @node } %> | ||
<% end %> | ||
<% if @node && [email protected]_power_tag('place') && @node.lat && @node.lon %> | ||
<% if @node && @node.has_tag("place") && @node.lat && @node.lon %> | ||
<%= render_top_map(@node.lat, @node.lon) %> | ||
<% elsif @node && @node.lat && @node.lon %> | ||
<%= render_map(@node.lat, @node.lon) %> | ||
<% elsif @node&.has_power_tag('place') && [email protected] && [email protected] %> | ||
<div id="map_template" style="position: relative; display: inline-block;"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,3 +103,7 @@ SubLatitudeLongitude2: | |
balloon: | ||
tid: 26 | ||
name: balloon | ||
|
||
place: | ||
tid: 27 | ||
name: place |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require "application_system_test_case" | ||
|
||
class PlaceTagsTest < ApplicationSystemTestCase | ||
|
||
# node blog has lat and lon tag and place tag . | ||
test "pages tagged with place get a full-width map across the top of the page" do | ||
visit nodes(:blog).path | ||
assert_selector('h1', text: 'Blog post') | ||
assert_selector('div#top_map') | ||
assert_selector('div.leaflet-layer') | ||
end | ||
|
||
# one map has no place tag . | ||
test "pages not tagged with place gets a side map" do | ||
visit nodes(:one).path | ||
assert_selector('h1', text: 'Canon A1200 IR conversion at PLOTS Barnraising at LUMCON') | ||
assert_selector('div.leaflet-layer' , count: 0) | ||
end | ||
|
||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, @sagarpreet-chadha can you see if I'm doing anything wrong here? #5605