Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

talks: configure maximum number of talk authors to list explicitly #729

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a future improvement, it would be nice to tweak the formatting here for more than two names so it returns
Author A, Author B, Author C & Author D
instead of
Author A & Author B & Author C & Author D

return _(u'%s, et al.') % names[0]

Expand Down
Loading