145 lines
6.1 KiB
HTML
145 lines
6.1 KiB
HTML
{{define "content"}}
|
|
<div class="container">
|
|
<div class="columns">
|
|
<div class="column">
|
|
<nav class="breadcrumb" aria-label="breadcrumbs">
|
|
<ul>
|
|
<li><a href="/documents">Documents</a></li>
|
|
<li class="is-active"><a href="#" aria-current="page">Document #{{.Document.ID}}</a></li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<h1 class="title">Document #{{.Document.ID}}</h1>
|
|
<h2 class="subtitle">
|
|
<span class="tag {{if eq .Document.Type "quote"}}is-info{{else if eq .Document.Type "invoice"}}is-success{{else if eq .Document.Type "purchaseOrder"}}is-warning{{else if eq .Document.Type "orderAck"}}is-link{{else}}is-light{{end}}">
|
|
{{if eq .Document.Type "quote"}}Quote
|
|
{{else if eq .Document.Type "invoice"}}Invoice
|
|
{{else if eq .Document.Type "purchaseOrder"}}Purchase Order
|
|
{{else if eq .Document.Type "orderAck"}}Order Acknowledgement
|
|
{{else if eq .Document.Type "packingList"}}Packing List
|
|
{{else}}{{.Document.Type}}{{end}}
|
|
</span>
|
|
</h2>
|
|
</div>
|
|
<div class="column is-narrow">
|
|
{{if .Document.PdfFilename}}
|
|
<a href="/pdf/{{.Document.PdfFilename}}" target="_blank" class="button is-primary">
|
|
<span class="icon">
|
|
<i class="fas fa-file-pdf"></i>
|
|
</span>
|
|
<span>View PDF</span>
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="columns">
|
|
<div class="column is-half">
|
|
<div class="box">
|
|
<h3 class="title is-5">Document Information</h3>
|
|
<table class="table is-fullwidth">
|
|
<tbody>
|
|
<tr>
|
|
<th>ID</th>
|
|
<td>{{.Document.ID}}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Type</th>
|
|
<td>{{.Document.Type}}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Created</th>
|
|
<td>{{.Document.Created.Format "2 January 2006 at 15:04"}}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Created By</th>
|
|
<td>
|
|
{{if and .Document.UserFirstName.Valid .Document.UserLastName.Valid}}
|
|
<a href="/users/{{.Document.UserID}}">
|
|
{{.Document.UserFirstName.String}} {{.Document.UserLastName.String}}
|
|
</a>
|
|
{{else if .Document.UserUsername.Valid}}
|
|
<a href="/users/{{.Document.UserID}}">
|
|
{{.Document.UserUsername.String}}
|
|
</a>
|
|
{{else}}
|
|
Unknown User
|
|
{{end}}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Page Count</th>
|
|
<td>{{.Document.DocPageCount}}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="column is-half">
|
|
{{if .Document.PdfFilename}}
|
|
<div class="box">
|
|
<h3 class="title is-5">PDF Information</h3>
|
|
<table class="table is-fullwidth">
|
|
<tbody>
|
|
<tr>
|
|
<th>Filename</th>
|
|
<td>
|
|
<a href="/pdf/{{.Document.PdfFilename}}" target="_blank">
|
|
{{.Document.PdfFilename}}
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>PDF Created</th>
|
|
<td>{{.Document.PdfCreatedAt.Format "2 January 2006 at 15:04"}}</td>
|
|
</tr>
|
|
{{if and .Document.PdfCreatorFirstName.Valid .Document.PdfCreatorLastName.Valid}}
|
|
<tr>
|
|
<th>PDF Created By</th>
|
|
<td>
|
|
<a href="/users/{{.Document.PdfCreatedByUserID}}">
|
|
{{.Document.PdfCreatorFirstName.String}} {{.Document.PdfCreatorLastName.String}}
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{end}}
|
|
|
|
{{/* TODO: Add customer and enquiry information when queries are available */}}
|
|
{{if false}}
|
|
<div class="box">
|
|
<h3 class="title is-5">Related Information</h3>
|
|
<table class="table is-fullwidth">
|
|
<tbody>
|
|
{{if .Document.CustomerName}}
|
|
<tr>
|
|
<th>Customer</th>
|
|
<td>{{.Document.CustomerName}}</td>
|
|
</tr>
|
|
{{end}}
|
|
{{if .Document.EnquiryTitle.Valid}}
|
|
<tr>
|
|
<th>Enquiry</th>
|
|
<td>{{.Document.EnquiryTitle.String}}</td>
|
|
</tr>
|
|
{{end}}
|
|
<tr>
|
|
<th>CMC Reference</th>
|
|
<td>{{.Document.CmcReference}}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Revision</th>
|
|
<td>{{.Document.Revision}}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}} |