add status column and tweak index css

This commit is contained in:
Nick Sweeting 2018-04-17 07:01:09 -04:00
parent f7015d2594
commit 4a2e74a3ac
4 changed files with 99 additions and 40 deletions

View file

@ -6,7 +6,7 @@
html, body {
width: 100%;
height: 100%;
font-size: 20px;
font-size: 18px;
font-weight: 200;
text-align: center;
margin: 0px;
@ -17,16 +17,22 @@
background-color: #aa1e55;
color: white;
padding: 10px;
padding-top: 0px;
padding-bottom: 15px;
height: 100px;
}
header h1 {
font-size: 36px;
font-weight: 300;
color: black;
margin-top: 10px;
margin-bottom: 12px;
margin-top: 2px;
line-height: 1.4;
}
header h1 small {
color: white;
font-size:0.5em;
font-size:0.45em;
margin-left: 10px;
display: block;
}
header h1 small a {
text-decoration: none;
@ -37,6 +43,13 @@
header h1 small a:hover {
opacity: 1;
}
.header-right {
float: right;
width: 50px;
height: 60px;
text-align: center;
padding: 20px;
}
table {
padding: 6px;
width: 100%;
@ -54,30 +67,48 @@
padding-top: 0.4em;
padding-left: 2px;
}
table tr td img {
table tr td img, table tr td object {
display: inline-block;
margin: auto;
height: 24px;
width: 24px;
padding: 0px;
padding-right: 5px;
text-indent: -10000px;
vertical-align: middle;
margin-left: 4px;
}
</style>
</head>
<body>
<header>
<h1 title="Last modified $time_updated">
<img src="https://nicksweeting.com/images/archive.png" height="36px">
Archived Sites <img src="https://getpocket.com/favicon.ico" height="36px"> <br/>
<small>
<a href="https://github.com/pirate/bookmark-archiver">Bookmark Archiver</a>
</small>
</h1>
<div class="header-right">
<a href="?">
<img src="static/archive.png" style="height: 100%;"/>
</a>
<br/>
<a href="https://pirate.github.io/bookmark-archiver">
Docs
</a>
</div>
<div style="float:left; height: 50px">
<h1 title="Last modified 2017-10-30 05:19" style="text-align:left">
Archived Sites
<br/>
<small>
$num_links links, last updated $time_updated<br/>
Using <a href="https://github.com/pirate/bookmark-archiver" target="_blank" rel="noopener">Bookmark Archiver</a>.
</small>
</h1>
</div>
</header>
<table style="width:100%;height: 90%; overflow-y: scroll;table-layout: fixed">
<thead>
<tr>
<th style="width: 120px;"><img src="https://getpocket.com/favicon.ico" height="12px"> Bookmarked</th>
<th style="width: 45vw;">Saved Articles ($num_links)</th>
<th style="width: 50px">Files</th>
<th style="width: 120px;">Bookmarked On</th>
<th style="width: 2vw;">Status</th>
<th style="width: 43vw;">Saved Articles ($num_links)</th>
<th style="width: 50px">Index</th>
<th style="width: 50px">PDF</th>
<th style="width: 60px;font-size:0.8em;">Screenshot</th>
<th style="width: 50px">A.org</th>

View file

@ -1,7 +1,9 @@
<tr>
<td title="Bookmarked timestamp: $timestamp">$date</td>
<td>
<img src="$favicon_url" onerror="this.src='static/spinner.gif'" class="link-favicon">
</td>
<td><a href="$archive_url" style="font-size:1.4em;text-decoration:none;color:black;" title="$title">
<img src="$favicon_url">
$title <small style="background-color: #eee;border-radius:4px; float:right">$tags</small>
</td>
<td style="text-align:center"><a href="$files_url" title="Files">📂</a></td>

View file

@ -12,6 +12,7 @@
}
header {
width: 100%;
height: 90px;
background-color: #aa1e55;
margin: 0px;
text-align: center;
@ -25,18 +26,18 @@
font-family: "Gill Sans", Helvetica, sans-serif;
}
.collapse-icon {
float: right;
float: left;
color: black;
width: 126px;
font-size: 0.7em;
margin-top: 20px;
margin-right: -30px;
margin-left: -150px;
margin-right: 0px;
margin-left: -35px;
}
.nav-icon img {
display: inline-block;
margin-right: -200px;
float: left;
float: right;
display: block;
margin-right: 13px;
color: black;
height: 53px;
margin-top: 7px;
@ -52,6 +53,9 @@
margin-top: 5px;
margin-bottom: 5px;
}
.archive-page-header .alert {
margin-bottom: 0px;
}
h1 small {
opacity: 0.4;
font-size: 0.6em;
@ -67,10 +71,11 @@
}
.card-body {
font-size: 1vw;
padding-top: 2vw;
padding-top: 1.2vw;
padding-left: 1vw;
padding-right: 1vw;
padding-bottom: 5vw;
padding-bottom: 1vw;
line-height: 1.1;
word-wrap: break-word;
max-height: 102px;
overflow: hidden;
@ -84,7 +89,7 @@
border-top: 1px solid gray;
border-radius: 3px;
border-bottom: 1px solid #ddd;
height: 425px;
height: 430px;
width: 400%;
margin-bottom: -330px;
@ -107,6 +112,17 @@
height: 93%;
margin-top: -10px;
}
img.external {
height: 30px;
margin-right: -10px;
padding: 3px;
border-radius: 4px;
vertical-align: middle;
border: 4px solid rgba(0,0,0,0);
}
img.external:hover {
border: 4px solid green;
}
@media(max-width: 1092px) {
iframe {
@ -140,11 +156,11 @@
<body>
<header>
<h1 class="page-title">
<a href="#" class="collapse-icon" title="Collapse Navbar">
[-]
<a href="../../index.html" class="nav-icon" title="Go to Main Index...">
<img src="../../static/archive.png" alt="Archive Icon">
</a>
<a href="./../../index.html" class="nav-icon" title="Archived Sites">
<img src="https://nicksweeting.com/images/archive.png" alt="Archive Icon">
<a href="#" class="collapse-icon" title="Toggle info panel...">
[-]
</a>
$title<br/>
<a href="$url" class="title-url">
@ -172,7 +188,9 @@
<div class="card selected-card">
<iframe class="card-img-top" src="$wget" sandbox="allow-same-origin allow-scripts allow-forms"></iframe>
<div class="card-body">
<a href="$wget" style="float:right"><small>➡️</small></a>
<a href="$wget" style="float:right" title="Open in new tab..." target="_blank" rel="noopener">
<img src="../../static/external.png" class="external"/>
</a>
<a href="$wget" target="preview"><h4 class="card-title">Local Archive</h4></a>
<p class="card-text">archive/$domain</p>
</div>
@ -182,7 +200,9 @@
<div class="card">
<iframe class="card-img-top" src="$pdf"></iframe>
<div class="card-body">
<a href="$pdf" style="float:right"><small>➡️</small></a>
<a href="$pdf" style="float:right" title="Open in new tab..." target="_blank" rel="noopener">
<img src="../../static/external.png" class="external"/>
</a>
<a href="$pdf" target="preview" id="pdf-btn"><h4 class="card-title">PDF</h4></a>
<p class="card-text">archive/output.pdf</p>
</div>
@ -192,7 +212,9 @@
<div class="card">
<iframe class="card-img-top" src="$screenshot" sandbox="allow-same-origin allow-scripts allow-forms"></iframe>
<div class="card-body">
<a href="$screenshot" style="float:right"><small>➡️</small></a>
<a href="$screenshot" style="float:right" title="Open in new tab..." target="_blank" rel="noopener">
<img src="../../static/external.png" class="external"/>
</a>
<a href="$screenshot" target="preview"><h4 class="card-title">Screenshot</h4></a>
<p class="card-text">archive/screenshot.png</p>
</div>
@ -202,7 +224,9 @@
<div class="card">
<iframe class="card-img-top" src="$url" sandbox="allow-same-origin allow-scripts allow-forms"></iframe>
<div class="card-body">
<a href="$url" style="float:right"><small>➡️</small></a>
<a href="$url" style="float:right" title="Open in new tab..." target="_blank" rel="noopener">
<img src="../../static/external.png" class="external"/>
</a>
<a href="$url" target="preview"><h4 class="card-title">Original</h4></a>
<p class="card-text">$domain</p>
</div>
@ -212,7 +236,9 @@
<div class="card">
<iframe class="card-img-top" src="$archive_org" sandbox="allow-same-origin allow-scripts allow-forms"></iframe>
<div class="card-body">
<a href="$archive_org" style="float:right"><small>➡️</small></a>
<a href="$archive_org" style="float:right" title="Open in new tab..." target="_blank" rel="noopener">
<img src="../../static/external.png" class="external"/>
</a>
<a href="$archive_org" target="preview"><h4 class="card-title">Archive.Org</h4></a>
<p class="card-text">web.archive.org/web/...</p>
</div>

10
util.py
View file

@ -434,11 +434,11 @@ def derived_link_info(link):
**link,
'date': datetime.fromtimestamp(float(link['timestamp'])).strftime('%Y-%m-%d %H:%M'),
'google_favicon_url': 'https://www.google.com/s2/favicons?domain={domain}'.format(**link),
'favicon_url': './archive/{timestamp}/favicon.ico'.format(**link),
'files_url': './archive/{timestamp}/index.html'.format(**link),
'archive_url': './archive/{}/{}'.format(link['timestamp'], html_appended_url(link)),
'pdf_link': './archive/{timestamp}/output.pdf'.format(**link),
'screenshot_link': './archive/{timestamp}/screenshot.png'.format(**link),
'favicon_url': 'archive/{timestamp}/favicon.ico'.format(**link),
'files_url': 'archive/{timestamp}/index.html'.format(**link),
'archive_url': 'archive/{}/{}'.format(link['timestamp'], html_appended_url(link)),
'pdf_link': 'archive/{timestamp}/output.pdf'.format(**link),
'screenshot_link': 'archive/{timestamp}/screenshot.png'.format(**link),
'archive_org_url': 'https://web.archive.org/web/{base_url}'.format(**link),
}