archive_ui.gohtml 909 B

1234567891011121314151617181920
  1. {{define "archive_ui.html"}}
  2. <div id="archive-ui" hx-target="this" hx-swap="outerHTML">
  3. {{ if eq .archiver.Status "Waiting" }}
  4. <button hx-post="/contacts/archive">
  5. Download Contact Archive
  6. </button>
  7. {{ else if eq .archiver.Status "Running" }}
  8. <div hx-get="/contacts/archive" hx-trigger="load delay:500ms">
  9. Creating Archive...{{ printf "%15.5f" .archiver.Progress }}
  10. <div class="progress">
  11. <div id="archive-progress" class="progress-bar" style="width:{{ mulf .archiver.Progress 100 }}%"></div>
  12. </div>
  13. </div>
  14. {{ else if eq .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. {{ end }}
  18. </div>
  19. {{end}}