Skip to content

Commit f9de722

Browse files
committed
Stub out initial custom collection display
1 parent 398ce1b commit f9de722

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

FrontEnd/styles/package.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,17 @@
156156
align-items: center;
157157
}
158158
}
159+
160+
li.custom-collections {
161+
grid-column-start: span 2;
162+
background-image: var(--image-tags);
163+
164+
a {
165+
display: flex;
166+
gap: 5px;
167+
align-items: center;
168+
}
169+
}
159170
}
160171

161172
section.sidebar-links {

Sources/App/Views/PackageController/GetRoute.Model+ext.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,20 @@ extension API.PackageController.GetRoute.Model {
398398
}
399399
}
400400

401+
func customCollectionsItem() -> Node<HTML.ListContext> {
402+
let collections: [CustomCollection] = [.init(.init(name: "Collection 1", url: URL(string: "https://github.com/foo/bar/list1.json")!)),
403+
.init(.init(name: "Collection 2", url: URL(string: "https://github.com/foo/bar/list2.json")!))]
404+
return .li(
405+
.class("custom-collections"),
406+
.forEach(collections, { collection in
407+
.a(
408+
.href(collection.url), // FIXME: link to custom collection page
409+
.text("\(collection.name)")
410+
)
411+
})
412+
)
413+
}
414+
401415
func latestReleaseMetadata() -> Node<HTML.ListContext> {
402416
guard let dateLink = releases.stable else { return .empty }
403417
return releaseMetadata(dateLink, title: "Latest Release", cssClass: "stable")

Sources/App/Views/PackageController/PackageShow+View.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ extension PackageShow {
180180
model.productTypeListItem(.plugin),
181181
model.targetTypeListItem(.macro),
182182
model.dataRaceSafeListItem(),
183-
model.keywordsListItem()
183+
model.keywordsListItem(),
184+
model.customCollectionsItem()
184185
)
185186
)
186187
}

0 commit comments

Comments
 (0)