mirror of
https://github.com/lazylibrarian/LazyLibrarian.git
synced 2026-06-12 09:35:37 -04:00
216 lines
10 KiB
HTML
216 lines
10 KiB
HTML
<%
|
|
import lazylibrarian
|
|
%>
|
|
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<title>LazyLibrarian - ${title}</title>
|
|
<meta name="description" content="">
|
|
<meta name="author" content="">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<link rel="shortcut icon" type="image/png" href="images/ll.ico">
|
|
<link rel="apple-touch-icon" href="images/ll.png">
|
|
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/s/bs-3.3.5/jqc-1.11.3,dt-1.10.10,b-1.1.0/datatables.min.css"/>
|
|
%if lazylibrarian.BOOKSTRAP_THEMELIST:
|
|
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.6/${lazylibrarian.CONFIG['BOOKSTRAP_THEME']}/bootstrap.min.css" rel="stylesheet">
|
|
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
|
|
%else:
|
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
|
%endif
|
|
<link href="css/bookstrap.css" rel="stylesheet">
|
|
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
|
|
<script src="https://code.jquery.com/jquery-migrate-1.3.0.min.js"></script>
|
|
<script src="js/lazylibrarian-bs.js"></script>
|
|
${next.headIncludes()}
|
|
<script type="text/javascript">
|
|
// Allow the user to reset the filter box
|
|
$(document).ready(function () {
|
|
$.fn.dataTableExt.oApi.clearSearch = function ( oSettings ) {
|
|
var table = this;
|
|
var clearSearch = $('<i class="fa fa-remove" style="cursor:pointer;width:16px;text-align:left;" title="Reset Filter"></i>');
|
|
|
|
$(clearSearch).click( function ()
|
|
{
|
|
table.fnFilter('');
|
|
$('input[type=search]').val('');
|
|
});
|
|
$(oSettings.nTableWrapper).find('div.dataTables_filter').append(clearSearch);
|
|
$(oSettings.nTableWrapper).find('div.dataTables_filter label').css('margin-right', '-16px');//16px the image width
|
|
$(oSettings.nTableWrapper).find('div.dataTables_filter input').css('padding-right', '16px');
|
|
}
|
|
|
|
//auto-execute, no code needs to be added
|
|
$.fn.dataTable.models.oSettings['aoInitComplete'].push( {
|
|
"fn": $.fn.dataTableExt.oApi.clearSearch,
|
|
"sName": 'whatever'
|
|
});
|
|
});
|
|
</script>
|
|
${next.javascriptIncludes()}
|
|
<script type="text/javascript">
|
|
// Check or uncheck all checkboxes in the same table
|
|
function toggleAll(e) {
|
|
var table = $(e).closest('table');
|
|
$('td input:checkbox', table).prop('checked', e.checked);
|
|
}
|
|
</script>
|
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
|
|
<script type="text/javascript" src="https://cdn.datatables.net/s/bs-3.3.5/jqc-1.11.3,dt-1.10.10,b-1.1.0/datatables.min.js"></script>
|
|
<script src="js/natural.js"></script>
|
|
<script src="js/bootbox.min.js"></script>
|
|
<script src="js/bootstrap-notify.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="container">
|
|
<header>
|
|
<div id="headercontainer" class="navbar navbar-default navbar-fixed-top">
|
|
<div class="container">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#MainNav" aria-expanded="false">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<a class="navbar-brand" href="home"><i class="fa fa-home"></i> LazyLibrarian</a>
|
|
</div>
|
|
<div class="collapse navbar-collapse" id="MainNav">
|
|
<ul class="nav navbar-nav">
|
|
<!--li><a href="home" class="navbarele">Authors</a></li-->
|
|
%if perm > 0:
|
|
%if lazylibrarian.CONFIG['USER_ACCOUNTS'] == True:
|
|
%if lazylibrarian.AUTOLOGIN != True:
|
|
<li><a href="logout" class="navbarele" id="logout">Logout</a></li>
|
|
%endif
|
|
%if perm&lazylibrarian.perm_config == 0:
|
|
<li><a href="profile" class="navbarele" id="profile">User</a></li>
|
|
%endif
|
|
%endif
|
|
%endif
|
|
% if perm&lazylibrarian.perm_ebook:
|
|
<li><a id="books" href="books" class="navbarele">eBooks</a></li>
|
|
%endif
|
|
% if lazylibrarian.SHOW_SERIES != 0:
|
|
%if perm&lazylibrarian.perm_series:
|
|
<li><a id="series" href="series" class="navbarele">Series</a></li>
|
|
% endif
|
|
% endif
|
|
% if lazylibrarian.SHOW_AUDIO != 0:
|
|
%if perm&lazylibrarian.perm_audio:
|
|
<li><a id="audio" href="audio" class="navbarele">AudioBooks</a></li>
|
|
% endif
|
|
% endif
|
|
% if lazylibrarian.SHOW_MAGS != 0:
|
|
%if perm&lazylibrarian.perm_magazines:
|
|
<li><a id="magazines" href="magazines" class="navbarele">Magazines</a></li>
|
|
% endif
|
|
% endif
|
|
%if perm&lazylibrarian.perm_managebooks:
|
|
<li><a id="manage" href="manage" class="navbarele">Manage</a></li>
|
|
% endif
|
|
%if perm&lazylibrarian.perm_history:
|
|
<li><a id="history" href="history" class="navbarele">History</a></li>
|
|
% endif
|
|
%if perm&lazylibrarian.perm_logs:
|
|
<li><a id="logs" href="logs" class="navbarele">Logs</a></li>
|
|
% endif
|
|
%if perm&lazylibrarian.perm_config:
|
|
<li><a id="config" href="config" class="navbarcfg"><i class="fa fa-cog"></i> Config</a></li>
|
|
% endif
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div id="subnav" class="navbar-inverse">
|
|
<div id="subhead" class="container">
|
|
${next.headerIncludes()}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div id="main" class="main container">
|
|
${next.body()}
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
msg = '';
|
|
% if lazylibrarian.CONFIG['INSTALL_TYPE'] == 'git' or lazylibrarian.CONFIG['INSTALL_TYPE'] == 'source':
|
|
title = 'LazyLibrarian Update'
|
|
% if not lazylibrarian.CONFIG['CURRENT_VERSION']:
|
|
msg = '<div class="input-group">You are running an unknown version of lazylibrarian.</div><a href="update" class="btn btn-xs btn-primary pull-right">Update</a>'
|
|
% elif (lazylibrarian.CONFIG['INSTALL_TYPE'] == 'source' and lazylibrarian.CONFIG['CURRENT_VERSION'] == 'No Version File' ):
|
|
msg = '<div class="input-group">Running Unknown version via source install. Update from central area now</div><a href="update" class="btn btn-xs btn-primary pull-right">Update</a>'
|
|
% elif lazylibrarian.CONFIG['CURRENT_VERSION'] != lazylibrarian.CONFIG['LATEST_VERSION']:
|
|
% if lazylibrarian.CONFIG['LATEST_VERSION'] == 'Not_Available_From_GitHUB':
|
|
msg = '<div class="input-group">Unable to get latest version from GITHub</div>'
|
|
% elif lazylibrarian.CONFIG['COMMITS_BEHIND'] < 0:
|
|
msg = '<div class="input-group">Running a local updated version. Push changes to GITHub or rollback to Master release</div>'
|
|
% elif lazylibrarian.CONFIG['COMMITS_BEHIND'] > 1:
|
|
msg = '<div class="input-group">New version available. You are ${lazylibrarian.CONFIG['COMMITS_BEHIND']} commits behind.</div><div class="pull-right"><a href="#" class="btn btn-xs btn-primary" data-toggle="tooltip" title="Ignore the update message for 24 hours" id="ignoreUpdate">Ignore</a> <a href="update" class="btn btn-xs btn-primary" data-toggle="tooltip" title="Update to the latest release">Update</a></div>'
|
|
% elif lazylibrarian.CONFIG['COMMITS_BEHIND'] == 1:
|
|
msg = '<div class="input-group">New version available. You are one commit behind.</div><div class="pull-right"><a href="#" class="btn btn-xs btn-primary" data-toggle="tooltip" title="Ignore the update message for 24 hours" id="ignoreUpdate">Ignore</a> <a href="update" class="btn btn-xs btn-primary" data-toggle="tooltip" title="Update to the latest release">Update</a></div>'
|
|
% endif
|
|
% endif
|
|
% endif
|
|
|
|
$(document).ready(function() {
|
|
if (readCookie('ignoreUpdate') != null) { msg = '' }
|
|
|
|
if (msg != '') {
|
|
$.notify({
|
|
icon: "images/ll48.png",
|
|
title: '<strong>'+title+'</strong>',
|
|
message: msg
|
|
},{
|
|
icon_type: 'image'
|
|
},{
|
|
type: 'warning'
|
|
});
|
|
}
|
|
|
|
$('#ignoreUpdate').click(function() {
|
|
createCookie("ignoreUpdate", true, 1);
|
|
});
|
|
});
|
|
|
|
// Initialise tooltips
|
|
$(function () {
|
|
$('[data-toggle="tooltip"]').tooltip()
|
|
})
|
|
|
|
|
|
function createCookie(name, value, days) {
|
|
var expires;
|
|
|
|
if (days) {
|
|
var date = new Date();
|
|
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
|
expires = "; expires=" + date.toGMTString();
|
|
} else {
|
|
expires = "";
|
|
}
|
|
document.cookie = encodeURIComponent(name) + "=" + encodeURIComponent(value) + expires + "; path=/";
|
|
}
|
|
|
|
function readCookie(name) {
|
|
var nameEQ = encodeURIComponent(name) + "=";
|
|
var ca = document.cookie.split(';');
|
|
for (var i = 0; i < ca.length; i++) {
|
|
var c = ca[i];
|
|
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
if (c.indexOf(nameEQ) === 0) return decodeURIComponent(c.substring(nameEQ.length, c.length));
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function eraseCookie(name) {
|
|
createCookie(name, "", -1);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
<%def name="javascriptIncludes()"></%def>
|
|
<%def name="headIncludes()"></%def>
|
|
<%def name="headerIncludes()"></%def>
|