<div class="audit-form-details-dialog">
    <h2>{{ngDialogData.auditForm.title}}</h2>

    <table class="audit-form-details-details">
        <tbody>
        <tr>
            <td class="audit-form-details-details-description" translate>Assigned to: </td>
            <td class="audit-form-details-details-data">{{ngDialogData.auditFormData.assigned_to | userIdToName}}</td>
        </tr>
        <tr>
            <td class="audit-form-details-details-description" translate>Created at: </td>
            <td class="audit-form-details-details-data">{{ngDialogData.auditFormData.created_at | date:'yyyy-MM-dd HH:mm:ss'}}</td>
        </tr>
        <tr>
            <td class="audit-form-details-details-description" translate>Last modified at: </td>
            <td class="audit-form-details-details-data">{{ngDialogData.auditFormData.last_modified_at | date:'yyyy-MM-dd HH:mm:ss'}}</td>
        </tr>
        <tr>
            <td class="audit-form-details-details-description" translate>Last modified by: </td>
            <td class="audit-form-details-details-data">{{ngDialogData.auditFormData.last_modified_by | userIdToName}}</td>
        </tr>

        </tbody>
    </table>

    <div class="audit-form-details-update-status" ng-if="ngDialogData.auditFormData.id">
        <p translate>Update workflow status to:</p>

        <ul>
            <li><a class="link-as-button" ng-click="ngDialogData.changeWorkflowStatus('New')" translate>New</a></li>
            <li><a class="link-as-button" ng-click="ngDialogData.changeWorkflowStatus('Open')" translate>Open</a></li>
            <li><a class="link-as-button" ng-click="ngDialogData.changeWorkflowStatus('Done')" translate>Done</a></li>
            <li><a class="link-as-button" ng-click="ngDialogData.changeWorkflowStatus('Reviewed')" translate>Reviewed</a></li>
        </ul>
    </div>


    <table class="audit-form-details-workflow-changes">
        <thead>
        <tr>
            <th translate>Date</th>
            <th translate>New Status</th>
            <th translate>Set by...</th>
        </tr>
        </thead>

        <tbody>
        <tr ng-repeat="workflow in ngDialogData.auditFormData.workflowChanges track by workflow.change_at">
            <td>{{workflow.change_at | date:'yyyy-MM-dd HH:mm:ss'}}</td>
            <td>{{workflow.status}}</td>
            <td>{{workflow.change_by | userIdToName}}</td>
        </tr>
        </tbody>
    </table>
</div>
