Skip to content

Commit

Permalink
Improve log display
Browse files Browse the repository at this point in the history
  • Loading branch information
rixx committed Nov 7, 2023
1 parent 3b22193 commit bf799b4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pretalx_pages/signals.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from django.dispatch import receiver
from django.urls import reverse
from django.utils.html import escape
from django.utils.translation import gettext_lazy as _
from pretalx.cfp.signals import footer_link
from pretalx.common.signals import activitylog_display
from pretalx.common.signals import activitylog_display, activitylog_display_object
from pretalx.common.urls import build_absolute_uri
from pretalx.orga.signals import event_copy_data, nav_event

Expand Down Expand Up @@ -45,6 +46,16 @@ def pretalx_activitylog_display(sender, activitylog, **kwargs):
return names.get(event_type)


@receiver(signal=activitylog_display_object)
def pretalx_activitylog_display_object(sender, activitylog, **kwargs):
if isinstance(activitylog.content_object, Page):
return (
_("Page")
+ f' <a href="{activitylog.content_object.urls.public}">{escape(activitylog.content_object.title)}</a>'
)
return activitylog.content_object.title


@receiver(footer_link, dispatch_uid="pages_footer_links")
def footer_link_pages(sender, request=None, **kwargs):
return [
Expand Down

0 comments on commit bf799b4

Please sign in to comment.