Monorepo for Tangled tangled.org

appview/pages: use queryParams func to build pagination URLs; wrap in safeUrl #1012

merged opened by oppi.li targeting master from op/oyvtlzoswwqm

when constructing a url using url.Values.Encode, we need to avoid escaping the = symbol, which is performed by the default urlescaper behavior in href contexts; so we wrap the call with safeUrl.

Signed-off-by: oppiliappan me@oppi.li

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3mcyyzlcqds22
+4 -4
Diff #0
+2 -2
appview/pages/templates/fragments/pagination.html
··· 1 1 {{ define "fragments/pagination" }} 2 - {{/* Params: Page (pagination.Page), TotalCount (int), BasePath (string), QueryParams (string) */}} 2 + {{/* Params: Page (pagination.Page), TotalCount (int), BasePath (string), QueryParams (url.Values) */}} 3 3 {{ $page := .Page }} 4 4 {{ $totalCount := .TotalCount }} 5 5 {{ $basePath := .BasePath }} 6 - {{ $queryParams := .QueryParams }} 6 + {{ $queryParams := safeUrl .QueryParams.Encode }} 7 7 8 8 {{ $prev := $page.Previous.Offset }} 9 9 {{ $next := $page.Next.Offset }}
+1 -1
appview/pages/templates/repo/issues/issues.html
··· 80 80 "Page" .Page 81 81 "TotalCount" .IssueCount 82 82 "BasePath" (printf "/%s/issues" .RepoInfo.FullName) 83 - "QueryParams" (printf "state=%s&q=%s" $state .FilterQuery) 83 + "QueryParams" (queryParams "state" $state "q" .FilterQuery) 84 84 ) }} 85 85 {{ end }} 86 86 {{ end }}
+1 -1
appview/pages/templates/repo/pulls/pulls.html
··· 166 166 "Page" .Page 167 167 "TotalCount" .PullCount 168 168 "BasePath" (printf "/%s/pulls" .RepoInfo.FullName) 169 - "QueryParams" (printf "state=%s&q=%s" .FilteringBy.String .FilterQuery) 169 + "QueryParams" (queryParams "state" .FilteringBy.String "q" .FilterQuery) 170 170 ) }} 171 171 {{ end }} 172 172 {{ end }}

History

1 round 0 comments
sign up or login to add to the discussion
oppi.li submitted #0
1 commit
expand
appview/pages: use queryParams func to build pagination URLs; wrap in safeUrl
3/3 success
expand
expand 0 comments
pull request successfully merged