Skip to content

Commit

Permalink
Merge pull request #729 from terceiro/config-et-al
Browse files Browse the repository at this point in the history
talks: configure maximum number of talk authors to list explicitly
  • Loading branch information
drnlm authored Nov 27, 2024
2 parents 94da162 + 02d6076 commit 9ee67a9
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 9ee67a9

Please sign in to comment.