Skip to content

Commit

Permalink
talks: configure maximum number of talk authors to list explicitly
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
terceiro committed Nov 25, 2024
1 parent 94da162 commit 02d6076
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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'``.
Expand Down
4 changes: 4 additions & 0 deletions wafer/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion wafer/talks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 02d6076

Please sign in to comment.