Skip to content

Commit

Permalink
Merge pull request #774 from philborman/master
Browse files Browse the repository at this point in the history
Display enhancements
  • Loading branch information
philborman authored May 9, 2017
2 parents 22152ef + c5dd150 commit 02bf3d7
Show file tree
Hide file tree
Showing 26 changed files with 343 additions and 107 deletions.
6 changes: 3 additions & 3 deletions data/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ INPUT[type="radio"]
}
INPUT[type="checkbox"]
{
vertical-align: bottom;
vertical-align: center;
}
.ie7 INPUT[type="checkbox"]
{
vertical-align: baseline;
vertical-align: center;
}
.ie6 INPUT
{
Expand Down Expand Up @@ -849,7 +849,7 @@ TABLE#book_table
}
TABLE#book_table TH#select
{
vertical-align: middle;
vertical-align: middle;
text-align: center;
width: 10px
}
Expand Down
29 changes: 27 additions & 2 deletions data/interfaces/bookstrap/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,16 @@ <h1><a href="${author['AuthorLink']}" target="_blank" rel="noreferrer">${author[
<p>&nbsp;</p>
<div class="table-responsive">
<table class="display table table-striped table-hover table-bordered" id="book_table">
<%
if lazylibrarian.CONFIG['BOOK_IMG'] == True:
hidden = ''
else:
hidden = 'hidden'
%>
<thead>
<tr>
<th class="select no-sort"><input type="checkbox" onClick="toggleAll(this)" /></th>
<th class="bookart text-center no-sort hidden-xs">Cover</th>
<th class="bookart text-center no-sort hidden-xs ${hidden}">Cover</th>
<th class="authorname hidden">Author</th>
<th class="bookname">Title</th>
<th class="series">Series</th>
Expand Down Expand Up @@ -176,7 +182,21 @@ <h1><a href="${author['AuthorLink']}" target="_blank" rel="noreferrer">${author[
return '<a href="' + data + '" target="_blank" rel="noreferrer"><img src="' + data + '" alt="Cover" class="bookcover-sm img-responsive"></a>';} },
{ targets: [2], class: "hidden" },
{ targets: [5], 'render': function(data, type, row) {
return '<img src="images/' + data + '" alt="Rating">';} }
return '<img src="images/' + data + '-stars.png" alt="Rating">';} },
{ targets: [7], 'render': function(data, type, row) {
var btn = data
if ( btn == 'Open' ) {
btn = '<a class="button green btn btn-xs btn-warning" href="openBook?bookid=' + row[9] +
'" target="_self"><i class="fa fa-book"></i>Open</a>'}
else if ( btn == 'Wanted' ) {
btn = '<p><a class="a btn btn-xs btn-danger">Wanted</a></p><p><a class="b btn btn-xs btn-success" href="searchForBook?bookid=' + row[9] + '" target="_self"><i class="fa fa-search"></i> Search</a></p>'}
else if ( btn == 'Snatched' ) {
btn = '<a class="button btn btn-xs btn-info">Snatched</a>'}
else if ( btn == 'Have' ) {
btn = '<a class="button btn btn-xs btn-info">Have</a>'}
else {
btn = '<a class="button btn btn-xs btn-default grey">' + row[7] + '</a>'}
return btn;} }
],
"oLanguage": {
"sLengthMenu":"_MENU_ rows per page",
Expand All @@ -192,6 +212,11 @@ <h1><a href="${author['AuthorLink']}" target="_blank" rel="noreferrer">${author[
"aLengthMenu": [[5, 10, 15, 25, 50, 100, -1], [5, 10, 15, 25, 50, 100, "All"]],
"iDisplayLength": ${lazylibrarian.CONFIG['DISPLAYLENGTH']},
"fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
var show = ${lazylibrarian.CONFIG['BOOK_IMG']};
if ( show != '1' )
{
$('td', nRow).eq(1).addClass('hidden');
}
$('td', nRow).eq(1).addClass('text-center');
$('td', nRow).eq(5).addClass('text-center');
$('td', nRow).eq(6).addClass('text-center');
Expand Down
29 changes: 27 additions & 2 deletions data/interfaces/bookstrap/books.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ <h1>${title}</h1>
<p>&nbsp;</p>
<div class="table-responsive">
<table class="display table table-striped table-hover table-bordered" id="book_table">
<%
if lazylibrarian.CONFIG['BOOK_IMG'] == True:
hidden = ''
else:
hidden = 'hidden'
%>
<thead>
<tr>
<th class="select no-sort"><input type="checkbox" onClick="toggleAll(this)" /></th>
<th class="bookart text-center no-sort hidden-xs">Cover</th>
<th class="bookart text-center no-sort hidden-xs ${hidden}">Cover</th>
<th class="authorname">Author</th>
<th class="bookname">Title</th>
<th class="series">Series</th>
Expand Down Expand Up @@ -103,7 +109,21 @@ <h1>${title}</h1>
{ targets: [2], 'render': function(data, type, row) {
return '<a href="authorPage?AuthorID=' + row[8] + '">' + data + '</a>';} },
{ targets: [5], 'render': function(data, type, row) {
return '<img src="images/' + data + '" alt="Rating">';} }
return '<img src="images/' + data + '-stars.png" alt="Rating">';} },
{ targets: [7], 'render': function(data, type, row) {
var btn = data
if ( btn == 'Open' ) {
btn = '<a class="button green btn btn-xs btn-warning" href="openBook?bookid=' + row[9] +
'" target="_self"><i class="fa fa-book"></i>Open</a>'}
else if ( btn == 'Wanted' ) {
btn = '<p><a class="a btn btn-xs btn-danger">Wanted</a></p><p><a class="b btn btn-xs btn-success" href="searchForBook?bookid=' + row[9] + '" target="_self"><i class="fa fa-search"></i> Search</a></p>'}
else if ( btn == 'Snatched' ) {
btn = '<a class="button btn btn-xs btn-info">Snatched</a>'}
else if ( btn == 'Have' ) {
btn = '<a class="button btn btn-xs btn-info">Have</a>'}
else {
btn = '<a class="button btn btn-xs btn-default grey">' + row[7] + '</a>'}
return btn;} }
],
"oLanguage": {
"sLengthMenu":"_MENU_ rows per page",
Expand All @@ -120,6 +140,11 @@ <h1>${title}</h1>
"sAjaxSource": 'getBooks?source=Books&booklang=${booklang}',
"bFilter": true,
"fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
var show = ${lazylibrarian.CONFIG['BOOK_IMG']};
if ( show != '1' )
{
$('td', nRow).eq(1).addClass('hidden');
}
$('td', nRow).eq(5).addClass('text-center');
$('td', nRow).eq(6).addClass('text-center');
$('td', nRow).eq(7).addClass('text-center');
Expand Down
57 changes: 56 additions & 1 deletion data/interfaces/bookstrap/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h1>${title}</h1>
%>
<label for="https_enabled" class="control-label">
<input type="checkbox" id="https_enabled" name="https_enabled" value="1" ${checked} />
Enable https</label>
Enable https access to lazylibrarian</label>
</div>
<fieldset id="https_options">
<div class="form-group">
Expand Down Expand Up @@ -176,6 +176,61 @@ <h1>${title}</h1>
</fieldset>
<fieldset>
<legend>Appearance</legend>
<div class="checkbox">
<%
if lazylibrarian.CONFIG['AUTHOR_IMG'] == True:
checked = 'checked="checked"'
else:
checked = ''
%>
<label for="author_img" class="control-label">
<input type="checkbox" id="author_img" name="author_img" value="1" ${checked} />
Show Author Images</label>
</div>
<div class="checkbox">
<%
if lazylibrarian.CONFIG['BOOK_IMG'] == True:
checked = 'checked="checked"'
else:
checked = ''
%>
<label for="book_img" class="control-label">
<input type="checkbox" id="book_img" name="book_img" value="1" ${checked} />
Show Book Images</label>
</div>
<div class="checkbox">
<%
if lazylibrarian.CONFIG['MAG_IMG'] == True:
checked = 'checked="checked"'
else:
checked = ''
%>
<label for="mag_img" class="control-label">
<input type="checkbox" id="mag_img" name="mag_img" value="1" ${checked} />
Show Magazine Images</label>
</div>
<div class="checkbox">
<%
if lazylibrarian.CONFIG['SERIES_TAB'] == True:
checked = 'checked="checked"'
else:
checked = ''
%>
<label for="series_tab" class="control-label">
<input type="checkbox" id="series_tab" name="series_tab" value="1" ${checked} />
Show Series</label>
</div>
<div class="checkbox">
<%
if lazylibrarian.CONFIG['MAG_TAB'] == True:
checked = 'checked="checked"'
else:
checked = ''
%>
<label for="mag_tab" class="control-label">
<input type="checkbox" id="mag_tab" name="mag_tab" value="1" ${checked} />
Show Magazines</label>
</div>
<div class="form-group">
<label for="http_look">Interface:</label>
<select id="http_look" name="http_look" class="form-control">
Expand Down
10 changes: 8 additions & 2 deletions data/interfaces/bookstrap/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@
<h1>${title}</h1>
<div class="table-responsive">
<table class="display table table-striped table-hover table-bordered" id="author_table">
<%
if lazylibrarian.CONFIG['AUTHOR_IMG'] == True:
hidden = ''
else:
hidden = 'hidden'
%>
<thead>
<tr>
<th class="authorimg no-sort col-xs-1">Image</th>
<th class="authorimg no-sort col-xs-1 ${hidden}">Image</th>
<th class="authorname col-xs-3">Author</th>
<th class="bookname col-xs-4">Latest Book</th>
<th class="date col-xs-1 text-center">Released</th>
Expand Down Expand Up @@ -54,7 +60,7 @@ <h1>${title}</h1>
grade = 'X'
%>
<tr>
<td class="name text-center"><a href="${author['AuthorImg']}" target="_blank" rel="noreferrer"><img src="${author['AuthorImg']}" alt="Cover" class="bookcover-sm"></a></td>
<td class="name text-center ${hidden}"><a href="${author['AuthorImg']}" target="_blank" rel="noreferrer"><img src="${author['AuthorImg']}" alt="Cover" class="bookcover-sm"></a></td>
<td class="name"><a href="authorPage?AuthorID=${author['AuthorID']|u}">${author['AuthorName']}</a></td>
<td class="bookname"><span title="${author['LastBook']}"></span><a href="${author['LastLink']}" target="_blank" rel="noreferrer">${author['LastBook']}</a></td>
<td class="date text-center">${author['LastDate']}</td>
Expand Down
2 changes: 1 addition & 1 deletion data/interfaces/bookstrap/logs.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<%def name="body()">
<h1>${title}</h1>
<div align="center">Refresh rate:
<select id="refreshrate" onchange="setRefresh()">
<select id="refreshrate" class="button btn btn-sm btn-primary" onchange="setRefresh()">
<option value="0" selected="selected">No Refresh</option>
<option value="5">5 Seconds</option>
<option value="15">15 Seconds</option>
Expand Down
15 changes: 13 additions & 2 deletions data/interfaces/bookstrap/managebooks.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,16 @@ <h1>${title}</h1>
<input type="hidden" name="redirect" value="manage">
<div class="table-responsive">
<table class="display table table-striped table-hover table-bordered" id="book_table">
<%
if lazylibrarian.CONFIG['BOOK_IMG'] == True:
hidden = ''
else:
hidden = 'hidden'
%>
<thead>
<tr>
<th class="select text-center no-sort"><input type="checkbox" onClick="toggleAll(this)" /></th>
<th class="bookart text-center no-sort hidden-xs">Cover</th>
<th class="bookart text-center no-sort hidden-xs ${hidden}">Cover</th>
<th class="authorname">Author</th>
<th class="bookname">Title</th>
<th class="series">Series</th>
Expand Down Expand Up @@ -86,7 +92,7 @@ <h1>${title}</h1>
{ targets: [2], 'render': function(data, type, row) {
return '<a href="authorPage?AuthorID=' + row[7] + '">' + data + '</a>';} },
{ targets: [5], 'render': function(data, type, row) {
return '<img src="images/' + data + '" alt="Rating">';} }
return '<img src="images/' + data + '-stars.png" alt="Rating">';} }
],
"oLanguage": {
"sLengthMenu":"_MENU_ rows per page",
Expand All @@ -102,6 +108,11 @@ <h1>${title}</h1>
"sAjaxSource": 'getBooks?whichStatus=${whichStatus}&source=Manage',
"bFilter": true,
"fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
var show = ${lazylibrarian.CONFIG['BOOK_IMG']};
if ( show != '1' )
{
$('td', nRow).eq(1).addClass('hidden');
}
$('td', nRow).eq(0).addClass('text-center');
$('td', nRow).eq(1).addClass('text-center');
$('td', nRow).eq(5).addClass('text-center');
Expand Down
32 changes: 29 additions & 3 deletions data/interfaces/default/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,15 @@
</p>
<table class="display" id="book_table">
<thead>
<%
if lazylibrarian.CONFIG['BOOK_IMG'] == True:
hidden = ''
else:
hidden = 'class="hidden"'
%>
<tr>
<th id="select"><input type="checkbox" onClick="toggleAll(this)" /></th>
<th id="bookart">Cover</th>
<th id="bookart" ${hidden}>Cover</th>
<th id="authorname" class="hidden">Title</th>
<th id="bookname">Title</th>
<th id="series">Series</th>
Expand Down Expand Up @@ -160,11 +166,26 @@
null,
{ "sType": "natural" },
{ "fnRender": function ( oObj ) {
return '<img src="images/' + oObj.aData[5] + '" alt="Rating">'
return '<img src="images/' + oObj.aData[5] + '-stars.png" alt="Rating">'
}
},
null,
null
{ "fnRender": function ( oObj ) {
var btn = oObj.aData[7]
if ( btn == 'Open' ) {
btn = '<a class="button green" href="openBook?bookid=' + oObj.aData[9] + '" target="_self">Open</a>'}
else if ( btn == 'Wanted' ) {
btn = '<a class="button red" href="searchForBook?bookid=' + oObj.aData[9] +
'" target="_self"><span class="a">Wanted</span><span class="b">Search</span></a>'}
else if ( btn == 'Snatched' ) {
btn = '<a class="button">Snatched</a>'}
else if ( btn == 'Have' ) {
btn = '<a class="button">Have</a>'}
else {
btn = '<a class="button grey">' + oObj.aData[7] + '</a>'}
return btn
}
}
],
"order": [[ 6, 'desc']],
"oLanguage": {
Expand All @@ -186,6 +207,11 @@
$('td', nRow).eq(2).addClass('hidden');
$('td', nRow).eq(6).addClass('center');
$('td', nRow).eq(7).addClass('center');
var show = ${lazylibrarian.CONFIG['BOOK_IMG']};
if ( show != '1' )
{
$('td', nRow).eq(1).addClass('hidden');
}
var w = window.innerWidth;
if ( w < 1024 )
{ // hide stars,date on medium devices
Expand Down
Loading

0 comments on commit 02bf3d7

Please sign in to comment.