mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-23 03:52:35 -04:00
fixed boxes size with ellipsis + moved style tag to template + reduced margin/padding
This commit is contained in:
parent
1aeeaa2c3b
commit
0f480d9fb8
@ -879,21 +879,6 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Compute the Welcome HTML */
|
/* Compute the Welcome HTML */
|
||||||
string welcomeBooksCss = ""
|
|
||||||
"<style>"
|
|
||||||
".book__list { text-align: center; }"
|
|
||||||
".book {"
|
|
||||||
"display: inline-block; vertical-align: bottom; margin: 10px; padding: 15px 20px; width: 300px;"
|
|
||||||
"border: 1px solid #ccc; border-radius: 15px;"
|
|
||||||
"text-align: left; color: #000; font-family: sans-serif; font-size: 13px;"
|
|
||||||
"}"
|
|
||||||
".book:hover { background-color: #eee; box-shadow: 2px 2px 5px 0px #ccc}"
|
|
||||||
".book__background { background-repeat: no-repeat; background-size: auto; background-position: top right; }"
|
|
||||||
".book__title { font-size: 18px; color: #0645ad; }"
|
|
||||||
".book__description { padding: 5px 50px 5px 0px; font-size: 15px; }"
|
|
||||||
".book__info { line-height: 18px; color: #777; font-weight: bold; font-size: 13px; }"
|
|
||||||
"</style>";
|
|
||||||
|
|
||||||
string welcomeBooksHtml = ""
|
string welcomeBooksHtml = ""
|
||||||
"<div class='book__list'>";
|
"<div class='book__list'>";
|
||||||
for (itr = booksIds.begin(); itr != booksIds.end(); ++itr) {
|
for (itr = booksIds.begin(); itr != booksIds.end(); ++itr) {
|
||||||
@ -904,8 +889,8 @@ int main(int argc, char **argv) {
|
|||||||
"<a href='/" + currentBook.getHumanReadableIdFromPath() + "/'>"
|
"<a href='/" + currentBook.getHumanReadableIdFromPath() + "/'>"
|
||||||
"<div class='book'>"
|
"<div class='book'>"
|
||||||
"<div class='book__background' style='background-image: url(data:" + currentBook.faviconMimeType+ ";base64," + currentBook.favicon + ");'>"
|
"<div class='book__background' style='background-image: url(data:" + currentBook.faviconMimeType+ ";base64," + currentBook.favicon + ");'>"
|
||||||
"<div class='book__title'>" + currentBook.title + "</div>"
|
"<div class='book__title' title='" + currentBook.title + "'>" + currentBook.title + "</div>"
|
||||||
"<div class='book__description'>" + currentBook.description + "</div>"
|
"<div class='book__description' title='" + currentBook.description + "'>" + currentBook.description + "</div>"
|
||||||
"<div class='book__info'>"
|
"<div class='book__info'>"
|
||||||
"" + kiwix::beautifyInteger(atoi(currentBook.articleCount.c_str())) + " articles, " + kiwix::beautifyInteger(atoi(currentBook.mediaCount.c_str())) + " medias"
|
"" + kiwix::beautifyInteger(atoi(currentBook.articleCount.c_str())) + " articles, " + kiwix::beautifyInteger(atoi(currentBook.mediaCount.c_str())) + " medias"
|
||||||
"</div>"
|
"</div>"
|
||||||
@ -917,8 +902,7 @@ int main(int argc, char **argv) {
|
|||||||
welcomeBooksHtml += ""
|
welcomeBooksHtml += ""
|
||||||
"</div>";
|
"</div>";
|
||||||
|
|
||||||
welcomeHTML = replaceRegex(replaceRegex(RESOURCE::home_html_tmpl, welcomeBooksCss, "__BOOKS_STYLE__"), welcomeBooksHtml, "__BOOKS__");
|
welcomeHTML = replaceRegex(RESOURCE::home_html_tmpl, welcomeBooksHtml, "__BOOKS__");
|
||||||
|
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
/* Fork if necessary */
|
/* Fork if necessary */
|
||||||
|
@ -7,7 +7,25 @@
|
|||||||
<script type="text/javascript" src="/skin/jquery-ui/jquery-ui.min.js"></script>
|
<script type="text/javascript" src="/skin/jquery-ui/jquery-ui.min.js"></script>
|
||||||
<link type="text/css" href="/skin/jquery-ui/jquery-ui.min.css" rel="Stylesheet" />
|
<link type="text/css" href="/skin/jquery-ui/jquery-ui.min.css" rel="Stylesheet" />
|
||||||
<link type="text/css" href="/skin/jquery-ui/jquery-ui.theme.min.css" rel="Stylesheet" />
|
<link type="text/css" href="/skin/jquery-ui/jquery-ui.theme.min.css" rel="Stylesheet" />
|
||||||
__BOOKS_STYLE__
|
<style>
|
||||||
|
.book__list { text-align: center; }
|
||||||
|
.book {
|
||||||
|
display: inline-block; vertical-align: bottom; margin: 8px; padding: 12px 15px; width: 300px;
|
||||||
|
border: 1px solid #ccc; border-radius: 15px;
|
||||||
|
text-align: left; color: #000; font-family: sans-serif; font-size: 13px;
|
||||||
|
}
|
||||||
|
.book:hover { background-color: #eee; box-shadow: 2px 2px 5px 0px #ccc}
|
||||||
|
.book__background { background-repeat: no-repeat; background-size: auto; background-position: top right; }
|
||||||
|
.book__title {
|
||||||
|
padding: 0 55px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||||||
|
font-size: 18px; color: #0645ad;
|
||||||
|
}
|
||||||
|
.book__description {
|
||||||
|
padding: 5px 55px 5px 0px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
.book__info { line-height: 18px; color: #777; font-weight: bold; font-size: 13px; }
|
||||||
|
</style>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$( "#accordion" ).accordion();
|
$( "#accordion" ).accordion();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user