Move expiry date info inside ReturnForm and update My Loans table layout#12912
Open
Sadashii wants to merge 3 commits into
Open
Move expiry date info inside ReturnForm and update My Loans table layout#12912Sadashii wants to merge 3 commits into
Sadashii wants to merge 3 commits into
Conversation
for more information, see https://pre-commit.ci
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR refactors how loan expiry information is displayed, consolidating it around the ReturnForm macro and adjusting related styling.
Changes:
- Move “Expires” rendering into
ReturnFormby passingexpiryinto the macro. - Update loans and loan status templates to use the new
ReturnForm(ocaid, expiry)signature and adjust the loans table layout. - Add/adjust CSS for
.return-formspacing and remove padding from.hoverlink.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| static/css/components/read-panel.css | Adds scoped spacing rules for .return-form and its CTA button in read panel contexts. |
| static/css/components/buttonCta.css | Adds global .return-form spacing rules to align button/layout spacing. |
| static/css/base/helpers-common.css | Removes top padding from .hoverlink. |
| openlibrary/templates/account/loans.html | Removes dedicated “Loan Expires” column and reflows expiry/download messaging into the actions column; updates ReturnForm invocation. |
| openlibrary/macros/ReturnForm.html | Changes macro signature to accept expiry and renders FormatExpiry(expiry) within the form. |
| openlibrary/macros/ManageLoansButtons.html | Removes the macro file entirely. |
| openlibrary/macros/LoanStatus.html | Updates to call ReturnForm(ocaid, expiry) instead of rendering expiry separately. |
| openlibrary/macros/FormatExpiry.html | Re-formats HTML/indentation and consolidates <time> attributes. |
Comment on lines
+236
to
+242
| .return-form { | ||
| margin-bottom: 10px; | ||
| } | ||
|
|
||
| .return-form .cta-btn { | ||
| margin-bottom: var(--spacing-stack-xs); | ||
| } |
Comment on lines
+37
to
+45
| .read-options .return-form, | ||
| .btn-notice .return-form { | ||
| margin-bottom: 10px; | ||
| } | ||
|
|
||
| .read-options .return-form .cta-btn, | ||
| .btn-notice .return-form .cta-btn { | ||
| margin-bottom: var(--spacing-stack-xs); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12911
This PR fixes a layout and visual hierarchy issue with the loan expiration date and the "Return book" CTA button.
The expires in time on the my books page has too much distance from the Return Now button, and too less with the next element ruining visual hierarchy. This PR fixes that by moving the time into the return now macro.
This PR also removes the 'Expires in' time and download options on the my loans page from a seperate column into the actions column, tidying that up, hopefully clearing the path for possibly moving that table into a carousel.
Technical
FormatExpiry(expiry)inside the<form class="return-form">wrapper inReturnForm.html.expiresandactionscolumns inloans.htmlinto a singleactionscolumn. Consolidating the column handles Book Reader and Adobe Digital Editions (ADE) states cleanly, and ensures non-downloaded loans still show the correct "Not yet downloaded. Download Now" actions without leaving an empty column layout.Testing
/account/loans):Screenshot
Stakeholders
@mekarpeles