1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| {% import ( "{{{ .Package }}}/app" "{{{ .Package }}}/app/controller/cutil" "{{{ .Package }}}/app/lib/audit" "{{{ .Package }}}/views/components" "{{{ .Package }}}/views/layout" ) %}
{% code type RecordDetail struct { layout.Basic Model *audit.Record Audit *audit.Audit } %}
{% func (p *RecordDetail) Body(as *app.State, ps *cutil.PageState) %} <div class="card"> <div class="right"> <a href="#modal-record"><button type="button">JSON</button></a> <a href="{%s p.Model.WebPath() %}/edit"><button>Edit</button></a> </div> <h3>{%= components.SVGRefIcon(`cog`, ps) %} Audit Record [{%s p.Model.String() %}]</h3> <div class="overflow full-width"> <table class="mt"> <tbody> <tr> <th class="shrink" title="UUID in format (00000000-0000-0000-0000-000000000000)">ID</th> <td>{%= components.DisplayUUID(&p.Model.ID) %}</td> </tr> <tr> <th class="shrink" title="UUID in format (00000000-0000-0000-0000-000000000000)">Audit ID</th> <td> <div class="icon">{%= components.DisplayUUID(&p.Model.AuditID) %}</div> <a title="Audit" href="{%s `/admin/audit`+`/`+p.Model.AuditID.String() %}">{%= components.SVGRefIcon("cog", ps) %}</a> </td> </tr> <tr> <th class="shrink" title="String text">T</th> <td>{%s p.Model.T %}</td> </tr> <tr> <th class="shrink" title="String text">Pk</th> <td>{%s p.Model.PK %}</td> </tr> <tr> <th class="shrink" title="JSON object">Changes</th> <td>{%= components.DisplayDiffs(p.Model.Changes) %}</td> </tr> <tr> <th class="shrink" title="JSON object">Metadata</th> <td>{%= components.JSON(p.Model.Metadata) %}</td> </tr> <tr> <th class="shrink" title="Date and time, in almost any format">Occurred</th> <td>{%= components.DisplayTimestamp(&p.Model.Occurred) %}</td> </tr> </tbody> </table> </div> </div> {%- comment %}$PF_SECTION_START(extra)${% endcomment -%} {%- comment %}$PF_SECTION_END(extra)${% endcomment -%} {%= components.JSONModal("record", "Audit Record JSON", p.Model, 1) %} {% endfunc %}
|