Skip to content

Commit

Permalink
Add author date when showing author name to librarians (internetarchi…
Browse files Browse the repository at this point in the history
…ve#9052)

* Re-implement changes

- Store data in dictionaries
- Only show years for librarians on book page

* Delete integration test

* Use a regex to determine the year to display

* Use single quotes

* Add helper function to extract a year

* Register helper

* Final fixes

* Small clean-up

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Address comments

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and merwhite11 committed May 6, 2024
1 parent 31ee897 commit a78333a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openlibrary/macros/BookByline.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<a href="$url" $:attrs>$rendered_name</a>
$else:
<span $:attrs>$rendered_name ($birth_date_formatted - $death_date_formatted)</span>
$elif url:
<a href="$url" $:attrs>$rendered_name</a>
$else:
<span $:attrs>$rendered_name</span>

$def render_overflow_link(remaining_authors, overflow_url):
<small><em><a href="$overflow_url" $:attrs>$ungettext('%(n)s other', '%(n)s others', remaining_authors, n=remaining_authors)</a></em></small>
Expand Down

0 comments on commit a78333a

Please sign in to comment.