You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.6 KiB
48 lines
1.6 KiB
{{define "job_attachments"}}
|
|
<div class="job-attachments" id="job-{{.JobID}}-attachments">
|
|
<h4>Job #{{.JobID}}</h4>
|
|
|
|
{{if .Error}}
|
|
<div class="error-message">Error: {{.Error}}</div>
|
|
{{else}}
|
|
{{if len .Attachments}}
|
|
<form hx-post="/documents/remove/job/{{.JobID}}" hx-target="#removal-results" hx-indicator=".upload-overlay">
|
|
<div class="attachments-list">
|
|
{{range .Attachments}}
|
|
<div class="attachment-item">
|
|
<label>
|
|
<input type="checkbox" name="attachment_ids" value="{{.id}}">
|
|
<span class="attachment-name">{{.description}}</span>
|
|
<span class="attachment-info">
|
|
<span class="attachment-type">{{template "document_type" .purposeId}}</span>
|
|
<span class="attachment-date">{{.lastModified}}</span>
|
|
</span>
|
|
</label>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-danger">Delete Selected Documents</button>
|
|
</form>
|
|
{{else}}
|
|
<div class="info-message">No attachments found for this job.</div>
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
|
|
{{define "document_type"}}
|
|
{{if eq . 0}}Job Paperwork
|
|
{{else if eq . 1}}Job Vendor Bill
|
|
{{else if eq . 2}}Job Picture
|
|
{{else if eq . 3}}Deficiency Repair Proposal
|
|
{{else if eq . 4}}Generic Attachment
|
|
{{else if eq . 5}}Avatar Image
|
|
{{else if eq . 6}}Import
|
|
{{else if eq . 7}}Blank Paperwork
|
|
{{else if eq . 8}}Work Acknowledgement
|
|
{{else if eq . 9}}Logo
|
|
{{else if eq . 10}}Job Invoice
|
|
{{else}}Unknown ({{.}})
|
|
{{end}}
|
|
{{end}}
|