Skip to content

Commit

Permalink
Town6: Fixes photoswipe not working if photo album inlined in page.
Browse files Browse the repository at this point in the history
TYPE: Bugfix
LINK: OGC-1934
  • Loading branch information
cyrillkuettel authored Nov 27, 2024
1 parent d3b6bb4 commit 0df602b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/onegov/org/views/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def view_topic(
return morepath.redirect(self.content['url'])

layout = layout or PageLayout(self, request)
if self.photo_album_id:
request.include('photoswipe')

if request.is_manager:
layout.editbar_links = self.get_editbar_links(request)
Expand Down Expand Up @@ -209,6 +211,8 @@ def get_description(item: News) -> str:

if request.is_manager:
layout.editbar_links = list(self.get_editbar_links(request))
if self.photo_album_id:
request.include('photoswipe')

assert self.trait is not None
return {
Expand Down
2 changes: 1 addition & 1 deletion src/onegov/town6/templates/macros.pt
Original file line number Diff line number Diff line change
Expand Up @@ -2979,7 +2979,7 @@

<metal:b define-macro="render_inline_photo_album">
<tal:b tal:condition="imageset and imageset.files">
<!--! Inline imagesets are always renderd as grid -->
<!--! Inline imagesets are always rendered as grid -->
<div class="page-text grid-imageset photoswipe">
<div class="image-grid">
<div tal:repeat="image imageset.files" class="image-container">
Expand Down
1 change: 1 addition & 0 deletions tests/onegov/town6/test_views_topics.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

def test_sort_topics(client):
client.login_admin().follow()

Expand Down

0 comments on commit 0df602b

Please sign in to comment.