Skip to content

Commit

Permalink
Org: Show QRCode in directories.
Browse files Browse the repository at this point in the history
TYPE: Feature
LINK: OGC-1333
  • Loading branch information
cyrillkuettel authored Nov 23, 2023
1 parent 8325f80 commit 914f7ca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/onegov/org/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -2616,6 +2616,7 @@ def editbar_links(self):
)

def links():
qr_link = None
if self.request.is_admin:
yield Link(
text=_("Configure"),
Expand All @@ -2636,6 +2637,12 @@ def links():
attrs={'class': 'import-link'}
)

qr_link = QrCodeLink(
text=_("QR"),
url=self.request.link(self.model),
attrs={'class': 'qr-code-link'}
)

if self.request.is_admin:
yield Link(
text=_("Delete"),
Expand Down Expand Up @@ -2682,6 +2689,8 @@ def links():
if not self.request.is_logged_in:
yield export_link

if qr_link:
yield qr_link
return list(links())

def get_pub_link(self, text, filter=None, toggle_active=True):
Expand Down
10 changes: 9 additions & 1 deletion src/onegov/town6/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -2200,7 +2200,7 @@ def editbar_links(self):
)

def links():

qr_link = None
if self.request.is_admin:
yield Link(
text=_("Configure"),
Expand All @@ -2221,6 +2221,12 @@ def links():
attrs={'class': 'import-link'}
)

qr_link = QrCodeLink(
text=_("QR"),
url=self.request.link(self.model),
attrs={'class': 'qr-code-link'}
)

if self.request.is_admin:
yield Link(
text=_("Delete"),
Expand Down Expand Up @@ -2263,6 +2269,8 @@ def links():
)
]
)
if qr_link:
yield qr_link

return list(links())

Expand Down

0 comments on commit 914f7ca

Please sign in to comment.