From 02d60762bc7320ddf5c43adfa653d86731e0878e Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Wed, 9 Oct 2024 15:53:59 -0300 Subject: [PATCH] talks: configure maximum number of talk authors to list explicitly I have been using wafer instances for single-track events, where there is plenty of space in the schedule to just list all authors. This will let me configure my instances to list a higher number than 2. --- docs/settings.rst | 6 ++++++ wafer/settings.py | 4 ++++ wafer/talks/models.py | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index 57159060..6ae1ce6a 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -128,6 +128,12 @@ Wafer's settings When ``True``, users can register for the conference. (Note, this is not the same as signing up for an account on the website.) +``WAFER_SCHEDULE_MAX_AUTHORS`` + A number. + This is the maximum list of people to be listed as talk authors in the + schedule. If the number of talk authors is higher than this, then they get + displayed as "First Author, et al." + ``WAFER_SSO`` A list of SSO mechanisms in use. Possible options are: ``'github'``, ``'gitlab'``. diff --git a/wafer/settings.py b/wafer/settings.py index 0a0b5982..3127efa0 100644 --- a/wafer/settings.py +++ b/wafer/settings.py @@ -362,3 +362,7 @@ # Hide the schedule from users without permission to edit it WAFER_HIDE_SCHEDULE = False + +# Number of talk authors to list explicitly, before listing them as "First +# Author, et al." +WAFER_SCHEDULE_MAX_AUTHORS = 2 diff --git a/wafer/talks/models.py b/wafer/talks/models.py index 235f19c8..49e1e19d 100644 --- a/wafer/talks/models.py +++ b/wafer/talks/models.py @@ -283,7 +283,7 @@ def get_authors_display_name(self): key=lambda author: u'' if author == self.corresponding_author else author.userprofile.display_name()) names = [author.userprofile.display_name() for author in authors] - if len(names) <= 2: + if len(names) <= settings.WAFER_SCHEDULE_MAX_AUTHORS: return u' & '.join(names) return _(u'%s, et al.') % names[0]