Skip to content

Conversation

@lukepayyapilli
Copy link
Contributor

@lukepayyapilli lukepayyapilli commented Dec 28, 2025

Summary

  • Add CSS line-clamp truncation for author lists on front page and search results.
  • Apply .card-authors class to both homepage_content_list.html and content_list.html.
  • Update demo fixtures to include a project with 14 authors to demonstrate truncation.

Approach

Uses CSS-only truncation with line-clamp to limit author lists to a single line with ellipsis. This is simpler than a Django filter approach and provides consistent rendering across all cards.

Screenshots

author-trunc content-list-trunc

Fixes #2462

@lukepayyapilli
Copy link
Contributor Author

@tompollard - let me know if this works for the issue. Thanks!

Copy link
Member

@tompollard tompollard left a comment

Choose a reason for hiding this comment

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

Thanks Luke! Right now it looks like we are applying two independent filters (CSS line clamp and Django filter). This could lead to inconsistent rendering (sometimes et al, sometimes not). I think we should probably just apply one.

I'm okay with either, but I think my preference is the CSS method with the ellipsis, for simplicity. The "et al" is good for formal citations, but perhaps more than we need here.

Side note and we can do in a separate PR if needed, but we should probably apply the filtering method to the search results too, to avoid this: https://physionet.org/content/. It's in the template here:

<p class="text-muted">
{% for author in published_project.author_list %}
{{ author.get_full_name }}{% if not forloop.last %}, {% endif %}
{% endfor %}

@lukepayyapilli lukepayyapilli force-pushed the fix/truncate-author-list-front-page branch from 181546c to 479992d Compare December 29, 2025 18:55
@lukepayyapilli
Copy link
Contributor Author

updated @tompollard!

Copy link
Member

@tompollard tompollard left a comment

Choose a reason for hiding this comment

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

Looks great, thanks Luke.

@lukepayyapilli lukepayyapilli added this pull request to the merge queue Dec 30, 2025
Merged via the queue into MIT-LCP:dev with commit 7408b4d Dec 30, 2025
7 checks passed
@lukepayyapilli lukepayyapilli deleted the fix/truncate-author-list-front-page branch December 30, 2025 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Author list on front page should be truncated

2 participants