archive_ui.gohtml 867 B

12345678910111213141516171819
  1. {{define "archive_ui.html"}}
  2. <div id="archive-ui" hx-target="this" hx-swap="outerHTML">
  3. {% if archiver.status() == "Waiting" %}
  4. <button hx-post="/contacts/archive">
  5. Download Contact Archive
  6. </button>
  7. {% elif archiver.status() == "Running" %}
  8. <div hx-get="/contacts/archive" hx-trigger="load delay:500ms">
  9. Creating Archive...
  10. <div class="progress" >
  11. <div id="archive-progress" class="progress-bar" style="width:{{ mul .archiver.progress 100 }}%"></div>
  12. </div>
  13. </div>
  14. {% elif archiver.status() == "Complete" %}
  15. <a hx-boost="false" href="/contacts/archive/file" _="on load click() me">Archive Downloading! Click here if the download does not start.</a>
  16. <button hx-delete="/contacts/archive">Clear Download</button>
  17. {% endif %}
  18. </div>
  19. {{end}}