{{define "upload_result_card"}}

Job #{{.JobID}}

{{if .Success}}✓ Success{{else}}✗ Failed{{end}}

Files Found: {{.FilesFound}}

Files Uploaded: {{.FilesUploaded}}

{{if .Success}}

Successfully processed

{{else}}

{{.ErrorMsg}}

{{end}}
{{if .Success}}
Upload Complete
{{else}}
Upload Failed
{{end}}
{{if .Files}}
{{with index .Files 0}}
{{.Name}} ({{printf "%.2f MB" (div .FileSize 1048576.0)}}) {{if .Success}} {{else}} {{.Error}} {{end}}
{{end}}
File {{.FilePage}} of {{.TotalFiles}}
{{if gt .FilePage 1}} {{end}} {{if lt .FilePage .TotalFiles}} {{end}}
{{end}}
{{end}} {{define "upload_results_pagination"}}

Upload Results

{{.TotalJobs}} Total Jobs
{{.TotalSuccess}} Successful
{{.TotalFailure}} Failed
{{printf "%.1f" (div .TotalBytesUploaded 1048576.0)}} MB Uploaded
{{.TotalTime}} Total Time
{{if gt .TotalSuccess 0}}

Successfully uploaded {{.TotalSuccess}} document(s) to ServiceTrade in {{.TotalTime}}!

{{end}} {{if gt .TotalFailure 0}}

Failed to upload {{.TotalFailure}} document(s). See details below.

{{end}}
{{range .Results}} {{template "upload_result_card" .}} {{end}}
{{if gt .TotalPages 1}}
Showing {{.StartIndex}}-{{.EndIndex}} of {{.TotalResults}} results
{{if gt .CurrentPage 1}} {{end}} {{range $i := sequence .StartPage .EndPage}} {{end}} {{if lt .CurrentPage .TotalPages}} {{end}}
{{end}}
{{end}}