

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Show Asset</title>
        <nav:resources override="true"/>
    </head>
    <body>
        <div class="nav">
            <nav:renderSubItems group="nav"/>
        </div>
        <div class="body">
            <g:render template="/shared/messages" />
            <div class="dialog">
                <table>
                    <tbody>

                        <tr class="prop">
                            <td valign="top" class="groupHeader">
                                <label for="name">Asset</label>
                            </td>
                            <td valign="top" class="value">
                            </td>
                        </tr>

                        <tr class="prop">
                            <td valign="top" class="groupName">Id:</td>

                            <td valign="top" class="value">${fieldValue(bean:assetInstance, field:'id')}</td>

                        </tr>

                        <tr class="prop">
                            <td valign="top" class="groupName">Name:</td>

                            <td  valign="top" style="text-align:left;" class="value">
                                ${assetInstance.name.encodeAsHTML()}
                            </td>

                        </tr>

                            <tr class="prop">
                                <td valign="top" class="groupName">Description:</td>
                                
                                <td valign="top" class="value">${fieldValue(bean:assetInstance, field:'description')}</td>
                                
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="groupName">Comment:</td>
                                
                                <td valign="top" class="value">${fieldValue(bean:assetInstance, field:'comment')}</td>
                                
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="groupName">Is Active:</td>
                                
                                <td valign="top" class="value">${fieldValue(bean:assetInstance, field:'isActive')}</td>
                                
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="groupName">Section:</td>
                                
                                <td valign="top" class="value"><g:link controller="sectionDetailed" action="show" id="${assetInstance?.section?.id}">${assetInstance?.section?.encodeAsHTML()}</g:link></td>
                                
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="groupHeader">Extended Attributes</td>
                                
                                <td  valign="top" style="text-align:left;" class="value">
                                </td>
                                
                            </tr>
                        
                            <g:each var="a" in="${assetInstance.assetExtendedAttributes.sort { p1, p2 -> p1.extendedAttributeType.name.compareToIgnoreCase(p2.extendedAttributeType.name) }}">
                                <tr class="prop">
                                    <td valign="top" class="groupName">
                                        ${a.extendedAttributeType.name.encodeAsHTML()}:
                                    </td>
                                    
                                    <td  valign="top" style="text-align:left;" class="value">
                                        <g:link controller="assetExtendedAttributeDetailed" action="edit" id="${a.id}">
                                            ${a.value.encodeAsHTML()}
                                        </g:link>
                                    </td>
                                
                                </tr>
                            </g:each>
                        
                            <tr class="prop">
                                <td valign="top" class="groupHeader">
                                    <label for="assetSubItems">Asset Tree</label>
                                </td>
                                <td valign="top" class="value">
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                </td>
                                <td valign="top" class="value">
                                    <g:render template="/shared/assetTree" />
                                </td>
                            </tr> 
                            
                            <tr class="prop">
                                <td valign="top" class="groupHeader">Life Plan</td>
                                
                                <td  valign="top" style="text-align:left;" class="value">
                                </td>
                                
                            </tr>

                            <g:each var="t" in="${parentPMs}">
                                <tr class="prop">
                                    <td valign="top" class="name"></td>
                                    
                                    <td  valign="top" style="text-align:left;" class="value">
                                        <g:link controller="taskDetailed" action="show" id="${t.id}">
                                            Task #${t.id}
                                        </g:link>
                                        <g:if test="${t.approved}" >
                                            <img  src="${resource(dir:'images/skin',file:'cog.png')}" alt="Approved" title="Approved" />
                                        </g:if>
                                        <g:if test="${t.taskRecurringSchedule?.enabled}" >
                                            <img  src="${resource(dir:'images/skin',file:'arrow_refresh.png')}" alt="Recurrence Enabled" title="Recurrence Enabled" />
                                        </g:if>
                                        <g:if test="${t.taskStatus.id == 2}" >
                                            <img  src="${resource(dir:'images/skin',file:'arrow_right.png')}" alt="In Progress" title="In Progress" />
                                        </g:if>
                                        <g:if test="${t.attentionFlag}" >
                                            <img  src="${resource(dir:'images/skin',file:'flag_red.png')}" alt="Attention Flag" title="Attention Flag" />
                                        </g:if>
                                        <g:if test="${t.taskStatus.id == 3}" >
                                            <img  src="${resource(dir:'images/skin',file:'tick.png')}" alt="Complete" title="Complete" />
                                        </g:if>
                                        <br />
                                        ${fieldValue(bean:t, field:'description')}
                                        <br />
                                        <g:if test="${t.safetyRequirement}" >
                                            <img  src="${resource(dir:'images/skin',file:'lightning.png')}" alt="Safety Requirement" title="Safety Requirement" />
                                            Safety
                                        </g:if>
                                        <g:if test="${t.regulatoryRequirement}" >
                                            <img  src="${resource(dir:'images/skin',file:'script_lightning.png')}" alt="Regulatory Requirement" title="Regulatory Requirement" />
                                            Regulatory
                                        </g:if>
                                        <g:if test="${t.mandatoryRequirement}" >
                                            <img  src="${resource(dir:'images/skin',file:'script.png')}" alt="Mandatory Requirement" title="Mandatory Requirement" />
                                            Mandatory
                                        </g:if>
                                    </td>
                                    
                                </tr>
                            </g:each>
                        
                    </tbody>
                </table>
            </div>
            <div class="buttons">
                <g:form>
                    <input type="hidden" name="id" value="${assetInstance?.id}" />
                    <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
                </g:form>
            </div>
        </div>
    </body>
</html>
