<!doctype html>
<html lang="en-US">
{{> control/partials/head-includes }}
<head><title>Message Queue | New Message</title></head>
<body>
{{> control/partials/nav}}

<nav aria-label="breadcrumb">
    <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="/message-queue">Message Queue</a></li>
        <li class="breadcrumb-item active" aria-current="page">{{message.id}}</li>
    </ol>
</nav>

<div class="container">
<h1>View Message {{id}}</h1>
    {{#with message}}
    <table class="table">
        <tr><th>Field</th><th>Value</th><th>Action</th></tr>
        <tr><td>id</td><td>{{id}}</td><td><a href="new?id={{id}}">[Copy&nbsp;Message]</a></td></tr>
        <tr><td>recipientInbox</td><td><a href="/message-queue?inbox={{recipientInbox}}">{{recipientInbox}}</a></td><td></td></tr>
        <tr><td>state</td><td>{{state}}</td><td><a href="{{id}}/edit">[Edit&nbsp;State]</a></td></tr>
        <tr><td>senderInbox</td><td><a href="/message-queue?inbox={{senderInbox}}">{{senderInbox}}</a></td><td>{{#if senderInbox}}<a href="{{id}}/reply">[Reply]</a>{{/if}}</td></tr>
        <tr><td>relatedId</td><td>
            {{#if hasRelatedMessage}} <a href="{{relatedId}}">{{relatedId}}</a> {{else}} {{relatedId}} {{/if}}
        </td><td></td></tr>
        <tr><td>auditRelatedId</td><td>
            {{#if hasAuditRelation}}<a href="/message-queue/{{auditRelatedId}}">{{auditRelatedId}}</a>{{else}}{{auditRelatedId}}{{/if}}
        </td><td></td></tr>
        <tr><td>function</td><td>{{function}}</td><td></td></tr>
        <tr><td>payload</td><td>
            <textarea disabled rows="6" cols="40" id="payload" name="payload">{{payload}}</textarea>
        </td><td></td></tr>
        <tr><td>Created</td><td title="{{createdTime}}">{{shortTimestamp createdTime}}</td></td><td></td></tr>
        <tr><td>Updated</td><td title="{{updatedTime}}">{{shortTimestamp updatedTime}}</td></td><td></td></tr>
        </tr>
    </table>
    {{/with}}

    {{#if relatedMessages}}
    <h2>Related Messages</h2>
    <table class="table">
        <tr>
            <th>ID/RelatedID</th>
            <th>Recipient Inbox</th>
            <th>Function</th>
            <th>State</th>
        </tr>
        <tr>
            <th colspan="4">Payload</th>
        </tr>
        {{#each relatedMessages}}
        <tr>
            <td>
                <a {{#eq id message.id}}style="font-weight: bold"{{/eq}} href="{{id}}">{{id}}</a>
                {{#if hasRelatedMessage}}/ <a href="{{relatedId}}" {{#eq relatedId message.id}}style="font-weight: bold"{{/eq}}>{{relatedId}}</a>{{/if}}
            </td>
            <td><a href="/message-queue?inbox={{recipientInbox}}">{{recipientInbox}}</a></td>
            <td>{{function}}</td>
            <td>{{state}}</td>
        </tr>
        <tr><td colspan="4" style="word-break: break-all; font-family: monospace;">{{payload}}</td> </tr>
        {{/each}}
    </table>
    {{/if}}
</div>

</body>
{{> control/partials/foot-includes }}
</html>