Skip to content

Commit 6dc725c

Browse files
committed
show the correct GitHub URLs on account settings page
1 parent c2aa4ec commit 6dc725c

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

Sources/UnidocServer/Building/Unidoc.BuildCoordinator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ extension Unidoc
3030
extension Unidoc.BuildCoordinator
3131
{
3232
public static
33-
func run<T>(watching db:Unidoc.Database,
34-
registrar:any Unidoc.Registrar,
33+
func run<T>(registrar:any Unidoc.Registrar,
34+
watching db:Unidoc.Database,
3535
with body:(Unidoc.BuildCoordinator) async throws -> T) async rethrows -> T
3636
{
3737
let events:AsyncStream<Event>

Sources/UnidocUI/Endpoints/User/Unidoc.UserSettingsPage.Installation.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ extension Unidoc.UserSettingsPage
44
{
55
struct Installation
66
{
7+
let organization:String?
78
let id:Int32?
89

9-
init(id:Int32?)
10+
init(organization:String?, id:Int32?)
1011
{
12+
self.organization = organization
1113
self.id = id
1214
}
1315
}
@@ -22,7 +24,11 @@ extension Unidoc.UserSettingsPage.Installation:HTML.OutputStreamable
2224
div[.a]
2325
{
2426
$0.target = "_blank"
25-
$0.href = "https://github.com/settings/installations/\(id)"
27+
$0.href = self.organization.map
28+
{
29+
"https://github.com/organizations/\($0)/settings/installations/\(id)"
30+
} ?? "https://github.com/settings/installations/\(id)"
31+
2632
$0.rel = .external
2733
} = "installation settings"
2834
}

Sources/UnidocUI/Endpoints/User/Unidoc.UserSettingsPage.swift

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ extension Unidoc.UserSettingsPage:Unidoc.ApplicationPage
7878
{
7979
$0[.a]
8080
{
81-
$0.href = "https://github.com/\(github.login)"
8281
$0.target = "_blank"
82+
$0.href = "https://github.com/\(github.login)"
83+
$0.rel = .external
8384
} = "@\(github.login)"
8485

8586
guard
@@ -150,6 +151,25 @@ extension Unidoc.UserSettingsPage:Unidoc.ApplicationPage
150151
}
151152
}
152153

154+
// $0[.p]
155+
// {
156+
// $0[.label]
157+
// {
158+
// $0.class = "checkbox"
159+
// }
160+
// content:
161+
// {
162+
// $0[.input]
163+
// {
164+
// $0.type = "checkbox"
165+
// $0.name = "private"
166+
// $0.value = "true"
167+
// }
168+
169+
// $0[.span] = "This is a private repository"
170+
// }
171+
// }
172+
153173
$0[.button]
154174
{
155175
$0.class = "area"
@@ -182,6 +202,7 @@ extension Unidoc.UserSettingsPage:Unidoc.ApplicationPage
182202
for organization:Unidoc.User in self.organizations
183203
{
184204
$0[.li] = organization.card(some: Installation.init(
205+
organization: organization.symbol,
185206
id: organization.githubInstallation))
186207
}
187208
}

0 commit comments

Comments
 (0)