add.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {% extends "core/base.html" %}
  2. {% load static %}
  3. {% load i18n %}
  4. {% block breadcrumbs %}
  5. <div class="breadcrumbs">
  6. <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
  7. {% if title %} &rsaquo; {{ title }}{% endif %}
  8. </div>
  9. {% endblock %}
  10. {% block extra_head %}
  11. <link rel="stylesheet" href="{% static 'add.css' %}" />
  12. {% endblock %}
  13. {% block body %}
  14. <div style="max-width: 550px; margin: auto; float: none">
  15. <br/><br/>
  16. {% if stdout %}
  17. <h1>Add new URLs to your archive: results</h1>
  18. <pre id="stdout">
  19. {{ stdout | safe }}
  20. <br/><br/>
  21. </pre>
  22. <br/>
  23. <center>
  24. <a href="/add" id="submit">&nbsp; Add more URLs ➕</a>
  25. </center>
  26. {% else %}
  27. <form id="add-form" method="POST" class="p-form">{% csrf_token %}
  28. <h1>Add new URLs to your archive</h1>
  29. <br/>
  30. {{ form.as_p }}
  31. <center>
  32. <button role="submit" id="submit">&nbsp; Add URLs and archive ➕</button>
  33. </center>
  34. </form>
  35. <br/><br/><br/>
  36. <center id="delay-warning" style="display: none">
  37. <b><i>This page will be unresponsive until the process is completely finished.</i></b>
  38. <br/><br/>
  39. <div>
  40. Warning: it may take several minutes to finish adding!<br/>
  41. <br/>
  42. Progress will be displayed in the <code>archivebox server</code> stdout,<br/>
  43. and on this page once the archiving process completes.<br/>
  44. <br/>
  45. <small>(it's safe to leave this page, adding will continue in the background)</small>
  46. </div>
  47. </center>
  48. {% if absolute_add_path %}
  49. <center id="bookmarklet">
  50. <p>Bookmark this link to quickly add to your archive:
  51. <a href="javascript:void(window.open('{{ absolute_add_path }}?url='+document.location.href));">Add to ArchiveBox</a></p>
  52. </center>
  53. {% endif %}
  54. <script>
  55. document.getElementById('add-form').addEventListener('submit', function(event) {
  56. setTimeout(function() {
  57. 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>'
  58. document.getElementById('delay-warning').style.display = 'block'
  59. }, 200)
  60. return true
  61. })
  62. </script>
  63. {% endif %}
  64. </div>
  65. {% endblock %}
  66. {% block footer %}{% endblock %}
  67. {% block sidebar %}{% endblock %}