add.html 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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: 1440px; 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. <div id="in-progress" style="display: none;">
  28. <center><h3>Adding URLs to index and running archive methods...</h3>
  29. <br/>
  30. <div class="loader"></div>
  31. <br/>
  32. Check the server log or the <a href="/admin/core/archiveresult/?o=-1">Log</a> page for detailed progress...
  33. </center>
  34. </div>
  35. <form id="add-form" method="POST" class="p-form">{% csrf_token %}
  36. <h1>Add new URLs to your archive</h1>
  37. <br/>
  38. {{ form.as_p }}
  39. <center>
  40. <button role="submit" id="submit">&nbsp; Add URLs and archive ➕</button>
  41. </center>
  42. </form>
  43. <br/><br/><br/>
  44. <center id="delay-warning" style="display: none">
  45. <small>(you will be redirected to your <a href="/">Snapshot list</a> momentarily, its safe to close this page at any time)</small>
  46. </center>
  47. {% if absolute_add_path %}
  48. <!-- <center id="bookmarklet">
  49. <p>Bookmark this link to quickly add to your archive:
  50. <a href="javascript:void(window.open('{{ absolute_add_path }}?url='+encodeURIComponent(document.location.href)));">Add to ArchiveBox</a></p>
  51. </center> -->
  52. {% endif %}
  53. <script>
  54. document.getElementById('add-form').addEventListener('submit', function(event) {
  55. document.getElementById('in-progress').style.display = 'block'
  56. document.getElementById('add-form').style.display = 'none'
  57. document.getElementById('delay-warning').style.display = 'block'
  58. setTimeout(function() {
  59. window.location = '/'
  60. }, 2000)
  61. return true
  62. })
  63. </script>
  64. {% endif %}
  65. </div>
  66. {% endblock %}
  67. {% block footer %}{% endblock %}
  68. {% block sidebar %}{% endblock %}