<%@ page import="java.util.List" %>
<%@ page import="ro.emid.common.types.AppProperty" %>
<%@ page import="ro.emid.common.constants.AppConstants" %>
<%@ page import="ro.emid.common.types.AppPropertyConstants" %>
<%@ page import="ro.emid.Application" %>



<%
    /**
     * @see ro.emid.administrare.action.properties.LoadPropertiesAction
     */
    final List properties = (List) request.getAttribute( "properties");
%>

<form name="zaforma" action="<%=AppConstants.APP_NAME%>?action=save-properties" method="post">
<table width="600px">
    <tr>
        <td align="left">
            <span>Proprietăţi</span>
        </td>
        <td align="right">
            <%
                if(!Application.runAsAparatCentral()){
            %>
            <input type="submit" value="Salvează">
            <%
                }
            %>

        </td>
    </tr>
    <tr><td colspan="2">
        <table cellPadding=2 cellSpacing=1 width="100%" class="table">
            <thead>
                <tr>
                    <td height=25>&nbsp;Descriere&nbsp;</td>
                    <td width="10">&nbsp;Valoare&nbsp;</td>
                </tr>
            </thead>
            <tbody>
                <% if( properties == null || properties.size() == 0){%>

                    <tr>
                        <td class="no-data">
                            Nu există date ...
                        </td>
                    </tr>

                <% }else for (Object property : properties) {
                    final AppProperty appProperty = (AppProperty) property; %>

                    <tr>
                        <td nowrap>
                            <input type="hidden" size="50" name="<%=AppPropertyConstants.JSP.KEY%>"
                                   value="<%=appProperty.getKey()%>">
                            <%=AppConstants.format(appProperty.getNiceText())%>
                        </td>
                        <td>
                            <%
                                if (!Application.runAsAparatCentral()) {
                            %>
                            <input type="text" size="20" name="<%=appProperty.getKey()%>"
                                   value="<%=AppConstants.format( appProperty.getValue())%>">
                            <%
                            } else {
                            %>
                            <input type="text" size="20" disabled="disabled" name="<%=appProperty.getKey()%>"
                                   value="<%=AppConstants.format( appProperty.getValue())%>">
                            <%
                                }
                            %>
                        </td>
                    </tr>
                <% } %>
            </tbody>
        </table>
    </td></tr>
</table>
</form>
