-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add 'Show on a map' button to Location in profile, fix layout #26214
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
8fdd3ac
Add OpenStreetMap URL to Location field in profile
n0toose 560cc47
Fix small indentation error in CSS
n0toose 3833501
Address comments by wxiaoguang
n0toose 8d77d74
Oops, I actually forgot to push the changes.
n0toose 4554222
Improve tips in app.example.ini
n0toose 5b79191
Okay, I mixed up the spaces and the tabs, oops
n0toose e35e391
Address comments, use <span> for 'Joined on'
n0toose 7ff0695
Generalize string
n0toose 6452720
Address some further comments, replace 'Show' with 'View'
n0toose 62ce4ca
Remove class="ui right" entirely, as flex-grow: 1 does the job
n0toose c667c6c
Oops, missed one.
n0toose 19183f3
Merge branch 'main' into osm-urls-in-profiles
n0toose b6e4991
Disable feature by default
n0toose f19f308
sync config name, add config doc, add QueryEscape
wxiaoguang d00a49e
fix layout
wxiaoguang 635c6e4
add test for manually escaping
wxiaoguang 682bd4b
Merge branch 'main' into osm-urls-in-profiles
GiteaBot 2b3e152
Merge branch 'main' into osm-urls-in-profiles
GiteaBot 650babd
Merge branch 'main' into osm-urls-in-profiles
GiteaBot 6506687
Merge branch 'main' into osm-urls-in-profiles
GiteaBot fed5bc1
Merge branch 'main' into osm-urls-in-profiles
GiteaBot f48ff4f
Merge branch 'main' into osm-urls-in-profiles
GiteaBot 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
package integration | ||
|
||
import ( | ||
"fmt" | ||
"net/http" | ||
"testing" | ||
|
||
|
@@ -12,6 +13,7 @@ import ( | |
repo_model "code.gitea.io/gitea/models/repo" | ||
"code.gitea.io/gitea/models/unittest" | ||
user_model "code.gitea.io/gitea/models/user" | ||
"code.gitea.io/gitea/modules/setting" | ||
api "code.gitea.io/gitea/modules/structs" | ||
"code.gitea.io/gitea/modules/test" | ||
"code.gitea.io/gitea/modules/translation" | ||
|
@@ -276,3 +278,41 @@ func TestListStopWatches(t *testing.T) { | |
assert.Greater(t, apiWatches[0].Seconds, int64(0)) | ||
} | ||
} | ||
|
||
func TestGetOpenStreetMapLink(t *testing.T) { | ||
n0toose marked this conversation as resolved.
Show resolved
Hide resolved
|
||
setting.Service.EnableOSMButton = true | ||
defer tests.PrepareTestEnv(t)() | ||
|
||
testLocations := map[string]string{ | ||
"Αθήνα": "%ce%91%ce%b8%ce%ae%ce%bd%ce%b1", | ||
" Αθήνα": "%20%20%ce%91%ce%b8%ce%ae%ce%bd%ce%b1", | ||
"Barbarossabrunnen, Düsseldorf": "Barbarossabrunnen%2c%20D%c3%bcsseldorf", | ||
"39.91025,116.40753": "39.91025%2c116.40753", | ||
"པེ་ཅིང་གྲོང་ཁྱེར།": "%e0%bd%94%e0%bd%ba%e0%bc%8b%e0%bd%85%e0%bd%b2%e0%bd%84%e0%bc%8b%e0%bd%82%e0%be%b2%e0%bd%bc%e0%bd%84%e0%bc%8b%e0%bd%81%e0%be%b1%e0%bd%ba%e0%bd%a2%e0%bc%8d", | ||
"Internet Archive": "Internet%20Archive", | ||
"Schönhauser Allee 2, Berlin, Deutschland": "Sch%c3%b6nhauser%20Allee%202%2c%20Berlin%2c%20Deutschland", | ||
"Miestna knižnica Podunajské Biskupice": "Miestna%20kni%c5%benica%20Podunajsk%c3%a9%20Biskupice", | ||
"東京タワー": "%e6%9d%b1%e4%ba%ac%e3%82%bf%e3%83%af%e3%83%bc", | ||
"Carnarvon Space & Technology Centre": "Carnarvon%20Space%20%26%20Technology%20Centre", | ||
} | ||
|
||
session := loginUser(t, "user2") | ||
for location, encodedLocation := range testLocations { | ||
t.Run(location, func(t *testing.T) { | ||
req := NewRequestWithValues(t, "POST", "/user/settings", map[string]string{ | ||
"_csrf": GetCSRF(t, session, "/user/settings"), | ||
"name": "user2", | ||
"email": "[email protected]", | ||
"language": "en-US", | ||
"location": location, | ||
}) | ||
session.MakeRequest(t, req, http.StatusSeeOther) | ||
|
||
req = NewRequest(t, "GET", "/user2/") | ||
resp := session.MakeRequest(t, req, http.StatusOK) | ||
htmlDoc := NewHTMLParser(t, resp.Body) | ||
|
||
htmlDoc.AssertElement(t, fmt.Sprintf("a[href='https://www.openstreetmap.org/search?query=%s']", encodedLocation), true) | ||
}) | ||
} | ||
} |
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.