GwR updates to catalog css

This commit is contained in:
GRiker 2011-02-03 06:41:40 -07:00
parent 3723cc885a
commit c7da3c8c1f
2 changed files with 43 additions and 35 deletions

View File

@ -52,6 +52,17 @@ p.formats {
text-indent: 0.0in; text-indent: 0.0in;
} }
/*
* Minimize widows and orphans by logically grouping chunks
* Some reports of problems with Sony (ADE) ereaders
* ADE: page-break-inside:avoid;
* iBooks: display:inline-block;
* width:100%;
*/
div.author_logical_group {
page-break-inside:avoid;
}
div.description > p:first-child { div.description > p:first-child {
margin: 0 0 0 0; margin: 0 0 0 0;
text-indent: 0em; text-indent: 0em;
@ -62,27 +73,19 @@ div.description {
text-indent: 1em; text-indent: 1em;
} }
/* div.initial_letter {
* Attempt to minimize widows and orphans by logically grouping chunks page-break-before:always;
* Recommend enabling for iPad
* Some reports of problems with Sony ereaders, presumably ADE engines
*/
/*
div.logical_group {
display:inline-block;
width:100%;
} }
*/
p.date_index { p.author_title_letter_index {
font-size:x-large; font-size:x-large;
text-align:center; text-align:center;
font-weight:bold; font-weight:bold;
margin-top:1em; margin-top:0px;
margin-bottom:0px; margin-bottom:0px;
} }
p.letter_index { p.date_index {
font-size:x-large; font-size:x-large;
text-align:center; text-align:center;
font-weight:bold; font-weight:bold;
@ -99,6 +102,14 @@ p.series {
text-indent:-2em; text-indent:-2em;
} }
p.series_letter_index {
font-size:x-large;
text-align:center;
font-weight:bold;
margin-top:1em;
margin-bottom:0px;
}
p.read_book { p.read_book {
text-align:left; text-align:left;
margin-top:0px; margin-top:0px;

View File

@ -1832,8 +1832,6 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
body.insert(btc,pTag) body.insert(btc,pTag)
btc += 1 btc += 1
# <p class="letter_index">
# <p class="book_title">
divTag = Tag(soup, "div") divTag = Tag(soup, "div")
dtc = 0 dtc = 0
current_letter = "" current_letter = ""
@ -1861,11 +1859,12 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
divTag.insert(dtc, divRunningTag) divTag.insert(dtc, divRunningTag)
dtc += 1 dtc += 1
divRunningTag = Tag(soup, 'div') divRunningTag = Tag(soup, 'div')
divRunningTag['class'] = "logical_group" if dtc > 0:
divRunningTag['class'] = "initial_letter"
drtc = 0 drtc = 0
current_letter = self.letter_or_symbol(book['title_sort'][0]) current_letter = self.letter_or_symbol(book['title_sort'][0])
pIndexTag = Tag(soup, "p") pIndexTag = Tag(soup, "p")
pIndexTag['class'] = "letter_index" pIndexTag['class'] = "author_title_letter_index"
aTag = Tag(soup, "a") aTag = Tag(soup, "a")
aTag['name'] = "%s" % self.letter_or_symbol(book['title_sort'][0]) aTag['name'] = "%s" % self.letter_or_symbol(book['title_sort'][0])
pIndexTag.insert(0,aTag) pIndexTag.insert(0,aTag)
@ -1973,8 +1972,6 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
body.insert(btc, aTag) body.insert(btc, aTag)
btc += 1 btc += 1
# <p class="letter_index">
# <p class="author_index">
divTag = Tag(soup, "div") divTag = Tag(soup, "div")
dtc = 0 dtc = 0
divOpeningTag = None divOpeningTag = None
@ -2008,10 +2005,11 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
current_letter = self.letter_or_symbol(book['author_sort'][0].upper()) current_letter = self.letter_or_symbol(book['author_sort'][0].upper())
author_count = 0 author_count = 0
divOpeningTag = Tag(soup, 'div') divOpeningTag = Tag(soup, 'div')
divOpeningTag['class'] = "logical_group" if dtc > 0:
divOpeningTag['class'] = "initial_letter"
dotc = 0 dotc = 0
pIndexTag = Tag(soup, "p") pIndexTag = Tag(soup, "p")
pIndexTag['class'] = "letter_index" pIndexTag['class'] = "author_title_letter_index"
aTag = Tag(soup, "a") aTag = Tag(soup, "a")
aTag['name'] = "%sauthors" % self.letter_or_symbol(current_letter) aTag['name'] = "%sauthors" % self.letter_or_symbol(current_letter)
pIndexTag.insert(0,aTag) pIndexTag.insert(0,aTag)
@ -2023,16 +2021,21 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
# Start a new author # Start a new author
current_author = book['author'] current_author = book['author']
author_count += 1 author_count += 1
if author_count == 2: if author_count >= 2:
# Add divOpeningTag to divTag, kill divOpeningTag # Add divOpeningTag to divTag, kill divOpeningTag
if divOpeningTag:
divTag.insert(dtc, divOpeningTag) divTag.insert(dtc, divOpeningTag)
dtc += 1 dtc += 1
divOpeningTag = None divOpeningTag = None
dotc = 0 dotc = 0
# Create a divRunningTag for the rest of the authors in this letter # Create a divRunningTag for the next author
if author_count > 2:
divTag.insert(dtc, divRunningTag)
dtc += 1
divRunningTag = Tag(soup, 'div') divRunningTag = Tag(soup, 'div')
divRunningTag['class'] = "logical_group" divRunningTag['class'] = "author_logical_group"
drtc = 0 drtc = 0
non_series_books = 0 non_series_books = 0
@ -2364,8 +2367,6 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
body.insert(btc,pTag) body.insert(btc,pTag)
btc += 1 btc += 1
# <p class="letter_index">
# <p class="author_index">
divTag = Tag(soup, "div") divTag = Tag(soup, "div")
dtc = 0 dtc = 0
@ -2549,8 +2550,6 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
body.insert(btc, aTag) body.insert(btc, aTag)
btc += 1 btc += 1
# <p class="letter_index">
# <p class="author_index">
divTag = Tag(soup, "div") divTag = Tag(soup, "div")
dtc = 0 dtc = 0
@ -2652,8 +2651,6 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
body.insert(btc, aTag) body.insert(btc, aTag)
btc += 1 btc += 1
# <p class="letter_index">
# <p class="author_index">
divTag = Tag(soup, "div") divTag = Tag(soup, "div")
dtc = 0 dtc = 0
current_letter = "" current_letter = ""
@ -2668,7 +2665,7 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
# Start a new letter with Index letter # Start a new letter with Index letter
current_letter = self.letter_or_symbol(sort_title[0].upper()) current_letter = self.letter_or_symbol(sort_title[0].upper())
pIndexTag = Tag(soup, "p") pIndexTag = Tag(soup, "p")
pIndexTag['class'] = "letter_index" pIndexTag['class'] = "series_letter_index"
aTag = Tag(soup, "a") aTag = Tag(soup, "a")
aTag['name'] = "%s_series" % self.letter_or_symbol(current_letter) aTag['name'] = "%s_series" % self.letter_or_symbol(current_letter)
pIndexTag.insert(0,aTag) pIndexTag.insert(0,aTag)