Skip to content

Commit

Permalink
Book title blue and underlined
Browse files Browse the repository at this point in the history
  • Loading branch information
merwhite11 committed Jun 10, 2024
1 parent 09dd662 commit ce95cc4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 224 deletions.
4 changes: 2 additions & 2 deletions openlibrary/macros/FulltextSearchSuggestion.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
$:macros.FulltextSuggestionSnippet(query, doc=doc)

$if results and results.get('hits'):
$ hits = results['hits'].get('hits', [])[:3]
$ hits = results['hits'].get('hits', [])
$ num_found = commify(results['hits'].get('total', 0))
$ ia_base_url = "https://archive.org"
<div id="fulltextSuggestions" class="fulltext-suggestions">
<div class="fulltext-suggestions__header">
<a class="fulltext-suggestions__link" href="/search/inside?$urlencode(dict(q=query))" title="$_('Search Inside Icon')">
<a class="fulltext-suggestions__icon" href="/search/inside?$urlencode(dict(q=query))" title="$_('Search Inside Icon')">
<img src="/static/images/icons/icon_search-inside.svg"
width="30" height="30"
alt="$_('search inside icon')"/>
Expand Down
4 changes: 2 additions & 2 deletions openlibrary/macros/FulltextSearchSuggestionItem.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
</span>
<div class="fsi__book-details">
<div class="fsi__title-author">
<h3 itemprop="name" class="fsi__book-title">
<a itemprop="url" href="$work_edition_url" class="results">$full_title</a>
<h3 class="fsi__book-title" itemprop="name">
<a class="fsi__book-title-link" itemprop="url" href="$work_edition_url">$full_title</a>
</h3>
<p class="fsi__book-author" itemprop="author" itemscope itemtype="https://schema.org/Organization">
$ authors = None
Expand Down
4 changes: 0 additions & 4 deletions openlibrary/macros/FulltextSnippet.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@
</ul>
</section>

$if availability.get('status') == 'open':
<p class="center"><a href="https://archive.org/stream/$(ia)?ref=ol&access=1#search/$(q)">See All Results</a></p>

$if availability.get('status') == 'borrow_available':
<p class="center">Borrow &amp; <a href="https://archive.org/stream/$(ia)?ref=ol&access=1#search/$(q)">See All Results</a></p>
50 changes: 12 additions & 38 deletions static/css/components/fulltext-search-suggestion-item.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
&__main {
.display-flex();
flex-direction: row;
// display: grid;
// grid-template-areas:
// "bookcover titleAndAuthor"
// "excerpts excerpts";
// grid-template-columns: 1fr 2fr;
// grid-template-rows: auto 1fr;
background-color: white;
padding: 5px;
margin-bottom: 5px;
Expand All @@ -16,28 +10,21 @@
overflow: hidden;
@media (min-width: @width-breakpoint-tablet) {
flex-direction: row;
// height: 100px;
// grid-template-areas:
// "bookcover titleAndAuthor"
// "bookcover excerpts";
// grid-template-columns: 1fr 8fr;
// grid-template-rows: auto 1fr;
}
}

&__book-cover {
grid-area: bookcover;
overflow: hidden;
height: 100%;
// height: 80px;
width: auto;
min-width: 90px;
border-radius: 4px;
align-self: center;
justify-self: center;
margin-top: 5px;
@media (min-width: @width-breakpoint-tablet) {
height: 100px;
height: 130px;
margin-bottom: 5px;
}
}
Expand All @@ -55,35 +42,28 @@
&__book-details {
display: flex;
flex-direction: column;
// display: inline-flex;
gap: 10px;
margin: 5px 10px 0 10px;
@media (min-width: @width-breakpoint-tablet) {
// flex-direction: row;
align-items: flex-start;
}
}

&__title-author {
grid-area: titleAndAuthor;
display: flex;
flex-direction: column;
padding: 5px 3px 0 10px;
width: 50%;
// color: #003266;
// text-decoration: underline;
@media (min-width: 375px) {
width: 70%
}
@media (min-width: 425px) {
width: 80%
}
}

// &__booktitle-container {
// overflow: auto;
// margin: 0 !important;
// font-family: @lucida_sans_serif-1;
// color: @grey;
// }
}

&__book-title,
&__book-author {
Expand All @@ -92,33 +72,27 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #003266;
color: @dark-grey;
font-family: @lucida_sans_serif-6;
@media (min-width: @width-breakpoint-desktop) {
text-decoration: none;
color: #000;
}

}
&__book-title {
margin: 0 !important;
font-family: @lucida_sans_serif-1;
color: @grey;
display: block;
margin: 0;
padding: 0;
color: @dark-grey;
font-weight: 700;
font-family: @lucida_sans_serif-6;
line-height: 1.2em;
// @media(min-width: 425px) {
// font-size: 1.0em;
// }
// @media (min-width: @width-breakpoint-tablet) {
// font-size: 1.0em;
// }
}

&__book-author {
// font-size: small;
line-height: 1.2em;
margin: 3px 0 0;
// @media(min-width: 425px) {
// font-size: 1.0em;
// }
}

// &__excerpts {
Expand Down
179 changes: 4 additions & 175 deletions static/css/components/fulltext-search-suggestion.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Search Result Item
* https://github.com/internetarchive/openlibrary/wiki/Design-Pattern-Library#searchresultitem
*/
@import "buttonBtn.less";
@import "buttonCta.less";
// @import "buttonBtn.less";
// @import "buttonCta.less";

.bookauthor {
font-family: @lucida_sans_serif-6;
Expand Down Expand Up @@ -41,179 +41,8 @@
}
}

&__link {
color: #003266;
text-decoration: underline;
&__icon {
margin-top: 5px;
}

// .header {
// display: flex;
// flex-direction: row;
// align-items: center;
// padding: 5px;
// margin-bottom: 3px;
// .title {
// display: block;
// margin: 0;
// padding: 5px;
// // color: @dark-grey;
// font-size: medium;
// font-weight: 700;
// font-family: @lucida_sans_serif-6;
// @media (min-width: @width-breakpoint-tablet) {
// font-size: large;
// }
// a[href] {
// // text-decoration: none;
// // color: @dark-grey;
// color: #003266;
// text-decoration: underline;
// }
// a[href]:hover {
// color: #003266;
// text-decoration: underline;
// }
// }
// }
// .fsi__container {
// .display-flex();
// flex-direction: column;
// padding: 5px;
// }
// .fsi__main {
// // .display-flex();
// // flex-direction: column;
// display: grid;
// grid-template-areas:
// "bookcover titleAndAuthor"
// "excerpts excerpts";
// grid-template-columns: 1fr 2fr;
// grid-template-rows: auto 1fr;

// background-color: white;
// padding: 3px;
// margin-bottom: 5px;
// border-bottom: 1px solid @light-beige;
// border-radius: 3px;
// overflow: hidden;
// @media (min-width: @width-breakpoint-tablet) {
// // flex-direction: row;
// // height: 100px;
// grid-template-areas:
// "bookcover titleAndAuthor"
// "bookcover excerpts";
// grid-template-columns: 1fr 8fr;
// grid-template-rows: auto 1fr;
// }
// .bookDetails {
// display: flex;
// flex-direction: row;
// // display: inline-flex;
// gap: 10px;
// margin: 5px 10px 0 10px;
// @media (min-width: @width-breakpoint-tablet) {
// flex-direction: row;
// align-items: flex-start;
// gap: 20px;
// }
// }

// .bookcover {
// grid-area: bookcover;
// overflow: hidden;
// height: 80px;
// width: auto;
// min-width: 90px;
// border-radius: 4px;
// align-self: center;
// justify-self: center;
// margin-top: 5px;
// @media (min-width: @width-breakpoint-tablet) {
// height: 100px;
// margin-bottom: 5px;
// }
// img {
// height: 100%;
// width: 100%;
// object-fit: cover;
// }
// }
// .bookcover--blur {
// img {
// filter: blur(4px);
// }
// }
// .imageLg {
// text-align: center;
// width: 100%;
// margin: 10px 10px 0 5px;
// img {
// max-width: 100%;
// max-height: 110px;
// }
// }
// a[href] {
// text-decoration: none;
// }
// .titleAndAuthor {
// grid-area: titleAndAuthor;
// display: flex;
// flex-direction: column;
// padding: 5px 3px 0 10px;
// .resultTitle {
// overflow: auto;
// margin: 0 !important;
// font-family: @lucida_sans_serif-1;
// color: @grey;
// h3 {
// display: block;
// margin: 0;
// padding: 0;
// color: @dark-grey;
// // font-size: 1.0em;
// font-weight: 700;
// font-family: @lucida_sans_serif-6;
// line-height: 1.2em;
// @media(min-width: 425px) {
// font-size: 1.0em;
// }
// @media (min-width: @width-breakpoint-tablet) {
// font-size: 1.0em;
// }
// }
// }
// .bookauthor {
// font-size: small;
// line-height: 1.2em;
// margin: 10px 0;
// @media(min-width: 425px) {
// font-size: 1.0em;
// }
// }
// }
// .excerpts {
// grid-area: excerpts;
// display: inline;
// width: 100%;
// padding: 5px;
// margin: 0;
// @media (min-width: @width-breakpoint-tablet) {
// width: auto;
// }
// .fulltext-excerpt {
// padding: 5px;
// margin: 0 5px;
// line-height: 1.6em;
// }
// .page-nums {
// color: @dark-grey;
// font-weight: 700;
// display: block;
// @media (min-width: @width-breakpoint-tablet) {
// display: inline;
// }
// }
// }
// }
}

4 changes: 1 addition & 3 deletions static/css/components/fulltext-suggestion-snippet.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@
padding: 5px;
margin: 0 5px;
line-height: 1.6em;
font-family: Georgia, 'Times New Roman', Times, serif
}

&__page-num {
color: @dark-grey;
font-weight: 700;
display: block;
// @media (min-width: @width-breakpoint-tablet) {
// display: inline;
// }
}
}

0 comments on commit ce95cc4

Please sign in to comment.