Files
LazyLibrarian/data/interfaces/bookstrap/base.html
2018-06-16 13:36:42 +02:00

279 lines
12 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="manifest" href="images/manifest.json">
<link rel="stylesheet" type="text/css" href="css/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">
%else:
<link href="css/bootstrap.min.css" rel="stylesheet">
%endif
<!--link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous"-->
<link href="css/fontawesome/fontawesome-all.css" rel="stylesheet">
<link href="css/bookstrap.css" rel="stylesheet">
<script src="js/jquery-1.12.0.min.js"></script>
<script src="js/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 () {
// Setup DataTable Defaults
$.extend( $.fn.dataTable.defaults, {
fnInitComplete: function(oSettings, json) {
// Add "Clear Filter" button to Filter
var btnClear = $('<button class="btn btn-sm btn-primary btnClearDataTableFilter" data-toggle="tooltip" data-placement="bottom" title="Clear filter"><i class="fa fa-times" aria-hidden="true"></i></button>');
btnClear.appendTo($('#' + oSettings.sTableId).parents('.dataTables_wrapper').find('.dataTables_filter'));
$('#' + oSettings.sTableId + '_wrapper .btnClearDataTableFilter').click(function () {
$('#' + oSettings.sTableId).dataTable().fnFilter('');
});
}
});
});
</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 type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/datatables.min.js"></script>
<script type="text/javascript" src="js/natural.js"></script>
<script type="text/javascript" src="js/bootbox.min.js"></script>
<script type="text/javascript" src="js/bootstrap-notify.min.js"></script>
<style>
#myBtn {
display: none;
position: fixed;
bottom: 10px;
right: 15px;
z-index: 99;
font-size: 18px;
border: none;
outline: none;
background-color: #888;
color: white;
cursor: pointer;
padding: 6px;
border-radius: 4px;
opacity: 0.4;
filter: alpha(opacity=40); /* For IE8 and earlier */
}
#myBtn:hover {
background-color: #555;
opacity: 1.0;
filter: alpha(opacity=100); /* For IE8 and earlier */
}
#myAlert {
display: block;
position: fixed;
bottom: 48px;
right: 15px;
z-index: 99;
font-size: 14px;
border: none;
outline: none;
background-color: #888;
color: white;
cursor: pointer;
padding: 6px;
border-radius: 4px;
opacity: 0.4;
filter: alpha(opacity=40); /* For IE8 and earlier */
}
#myAlert:hover {
background-color: #555;
opacity: 1.0;
filter: alpha(opacity=100); /* For IE8 and earlier */
}
</style>
</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.SHOWLOGOUT == 1:
<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>
<button onclick="topFunction()" id="myBtn" title="Go to top"><i class="fa fa-arrow-up"></i></button>
</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><div class="pull-right"><a href="#" class="btn btn-xs btn-primary" data-toggle="tooltip" title="Ignore the message for 24 hours" id="ignoreUpdate">Ignore</a>&nbsp;<a href="update" class="btn btn-xs btn-primary" data-toggle="tooltip" title="Update to the latest release">Update</a></div>'
% elif (lazylibrarian.CONFIG['INSTALL_TYPE'] == 'source' and lazylibrarian.CONFIG['CURRENT_VERSION'] == 'No Version File' ):
msg = '<div class="input-group">You are running an unknown version via source install</div><div class="pull-right"><a href="#" class="btn btn-xs btn-primary" data-toggle="tooltip" title="Ignore the message for 24 hours" id="ignoreUpdate">Ignore</a>&nbsp;<a href="update" class="btn btn-xs btn-primary" data-toggle="tooltip" title="Update to the latest release">Update</a></div>'
% 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><div class="pull-right"><a href="#" class="btn btn-xs btn-primary" data-toggle="tooltip" title="Ignore the warning for 24 hours" id="ignoreUpdate">Ignore</a></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><div class="pull-right"><a href="#" class="btn btn-xs btn-primary" data-toggle="tooltip" title="Ignore the warning for 24 hours" id="ignoreUpdate">Ignore</a></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>&nbsp;<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>&nbsp;<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()
})
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("myBtn").style.display = "block";
} else {
document.getElementById("myBtn").style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
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>