Skip to content

Commit b944972

Browse files
authored
patch templates (#1548)
1 parent 75522ad commit b944972

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pcweb/pages/gallery/apps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ def load_all_gallery_apps():
3232
gallery_apps_data_copy = {
3333
path: doc for (path, _), doc in gallery_apps_data.items()
3434
}
35+
gallery_apps_data_open_source = {
36+
(path, folder): doc
37+
for (path, folder), doc in load_all_gallery_apps().items()
38+
if folder == "templates/"
39+
}
3540

3641

3742
def more_posts(current_post: dict) -> rx.Component:

pcweb/pages/hosting/views/templates.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def gallery_app_card(app: dict) -> rx.Component:
77
rx.box(
88
rx.link(
99
rx.image(
10-
src=app["image"],
10+
src=f"/templates/{app['image']}",
1111
loading="lazy",
1212
alt="Image preview for app: " + app["title"],
1313
class_name="w-full h-full duration-150 object-top object-cover hover:scale-105 transition-transform ease-out",
@@ -48,9 +48,9 @@ def gallery_app_card(app: dict) -> rx.Component:
4848

4949

5050
def component_grid() -> rx.Component:
51-
from pcweb.pages.gallery.apps import gallery_apps_data
51+
from pcweb.pages.gallery.apps import gallery_apps_data_open_source
5252

53-
apps_copy = copy.deepcopy(gallery_apps_data)
53+
apps_copy = copy.deepcopy(gallery_apps_data_open_source)
5454

5555
posts = []
5656
for path, document in list(apps_copy.items()):

0 commit comments

Comments
 (0)