2020-07-27 23:26:45 -04:00
{% extends "admin/index.html" %}
{% load i18n %}
2019-04-22 19:07:39 -04:00
2020-07-27 23:26:45 -04:00
{% block breadcrumbs %}
< div class = "breadcrumbs" >
< a href = "{% url 'admin:index' %}" > {% trans 'Home' %}< / a >
{% if title %} › {{ title }}{% endif %}
< / div >
{% endblock %}
2020-07-01 13:23:59 -04:00
2020-07-27 23:26:45 -04:00
{% block content %}
< style >
.dashboard #content {
width: 100%;
margin-right: 0px;
margin-left: 0px;
}
#submit {
border: 1px solid rgba(0,0,0,0.2);
padding: 10px;
border-radius: 4px;
background-color: #f5dd5d;
color: #333;
font-size: 18px;
font-weight: 800;
}
#add-form button[role=submit]:hover {
background-color: #e5cd4d;
}
#add-form label {
display: block;
font-size: 16px;
}
#add-form textarea {
width: 100%;
min-height: 300px;
}
#delay-warning div {
border: 1px solid red;
border-radius: 4px;
margin: 10px;
padding: 10px;
font-size: 15px;
background-color: #F5DD5D;
}
#stdout {
background-color: #ded;
padding: 10px 10px;
border-radius: 4px;
white-space: normal;
}
.loader {
border: 16px solid #f3f3f3; /* Light grey */
border-top: 16px solid #3498db; /* Blue */
border-radius: 50%;
width: 120px;
height: 120px;
animation: spin 2s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
< / style >
< div style = "max-width: 550px; margin: auto; float: none" >
< br / > < br / >
{% if stdout %}
< h1 > Add new URLs to your archive: results< / h1 >
< pre id = "stdout" >
{{ stdout | safe }}
< br / > < br / >
< / pre >
< br / >
< center >
< a href = "/add" id = "submit" > Add more URLs ➕ < / a >
< / center >
{% else %}
< form id = "add-form" action = "?" method = "POST" class = "p-form" > {% csrf_token %}
< h1 > Add new URLs to your archive< / h1 >
< br / >
{{ form.as_p }}
< center >
< button role = "submit" id = "submit" > Add URLs and archive ➕ < / button >
< / center >
2020-07-01 13:29:56 -04:00
< / form >
2020-07-27 23:26:45 -04:00
< br / > < br / > < br / >
< center id = "delay-warning" style = "display: none" >
< b > < i > This page will be unresponsive until the process is completely finished.< / i > < / b >
< br / > < br / >
< div >
Warning: it may take several minutes to finish adding!< br / >
< br / >
Progress will be displayed in the < code > archivebox server< / code > stdout,< br / >
and on this page once the archiving process completes.< br / >
< br / >
< small > (it's safe to leave this page, adding will continue in the background)< / small >
< / div >
< / center >
< script >
document.getElementById('add-form').addEventListener('submit', function(event) {
setTimeout(function() {
document.getElementById('add-form').innerHTML = '< center > < h3 > Adding URLs to index and running archive methods...< h3 > < br / > < div class = "loader" > < / div > < br / > (see terminal for progress)< / center > '
document.getElementById('delay-warning').style.display = 'block'
}, 200)
return true
})
< / script >
{% endif %}
< / div >
{% endblock %}
2020-07-01 13:23:59 -04:00
2020-07-27 23:26:45 -04:00
{% block sidebar %}{% endblock %}