forked from internetarchive/openlibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request internetarchive#8375 from anujamerwade/7311/featur…
…e/loan-history 7311/feature/loan history code for rendering loan_history page
- Loading branch information
Showing
10 changed files
with
221 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
$def with (doc, ia_base_url="https://archive.org") | ||
$ ocaid = doc.get('ocaid') | ||
<li class="searchResultItem"> | ||
<span class="bookcover"> | ||
$ cover = "%s/services/img/%s" % (ia_base_url, ocaid) | ||
<a href="$ia_base_url/details/$ocaid"> | ||
<img itemprop="image" | ||
src="$cover" | ||
alt="$_('Cover of: %(title)s', title=ocaid)" | ||
title="$_('Cover of: %(title)s', title=ocaid)" | ||
/> | ||
</a> | ||
</span> | ||
|
||
<div class="details"> | ||
<div class="resultTitle"> | ||
<h3 itemprop="name" class="booktitle"> | ||
<a itemprop="url" href="$ia_base_url/details/$ocaid" class="results">Borrowed from Internet Archive: $ocaid</a> | ||
</h3> | ||
</div> | ||
</div> | ||
$# The following (empty) <div> is to aid in formatting the layout. | ||
<div class="searchResultItemCTA"> | ||
</div> | ||
</li> | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$def with (page, show_next=True) | ||
<div class="clearfix"></div> | ||
<div class="pagination"> | ||
$if page != 1: | ||
<a href="$changequery(page=None)" class="ChoosePage">« $_('First')</a> | ||
<a href="$changequery(page=page-1)" class="ChoosePage">< $_('Previous')</a> | ||
$if show_next: | ||
<a href="$changequery(page=page+1)" class="ChoosePage">$_('Next') ></a> | ||
</div> |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
$def with (docs, current_page, include_ratings=False, ratings=[], show_next=False, ia_base_url="") | ||
<div class="mybooks-list"> | ||
|
||
$if len(docs) > 0: | ||
$:macros.Pager_loanhistory(page=current_page, show_next=show_next) | ||
<ul class="list-books"> | ||
$if docs: | ||
$# enumerate because using zip() will result in empty iterator when no ratings are passed, and ratings are only used on already-read. | ||
$for idx, doc in enumerate(docs): | ||
$if doc.get('ia_only'): | ||
$:macros.IABook(doc=doc, ia_base_url=ia_base_url) | ||
$else: | ||
$ star_rating = macros.StarRatings(doc, redir_url='/account/books/already-read', id=idx+1, rating=ratings[idx]) if include_ratings else None | ||
$:macros.SearchResultsWork(doc, availability=doc.get('availability'), rating=star_rating) | ||
</ul> | ||
$:macros.Pager_loanhistory(page=current_page, show_next=show_next) | ||
$else: | ||
<ul class="list-books"> | ||
<p>$_("No loans found in your borrow history.")</p> | ||
<p>$:_('<a href="/search">Search for a book</a> to borrow.')</p> | ||
</ul> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ | |
margin-bottom: 28px; | ||
} | ||
|
||
overflow-wrap: break-word; | ||
overflow-wrap: anywhere; | ||
} | ||
|
||
.mybooks-list--clean { | ||
|