<% if !value || value.blank? %>
  <textarea rows="5" cols="80" class="width100" name="<%= name -%>" id="<%= id -%>"></textarea>
<%
   else
     license = controller.java_facade.parseLicense(value)
%>
  <div class="width100">
    <textarea rows="6" name="<%= name -%>" id="<%= id -%>" style="float: left;width: 390px"><%= h value -%></textarea>

    <div style="margin-left: 400px">
      <table>
        <tr>
          <td class="form-key-cell">Product:</td>
          <td class="form-val-cell"><%= license.getProduct() || '-' -%></td>
        </tr>
        <tr>
          <td class="form-key-cell">Organization:</td>
          <td><%= license.getOrganization() || '-' -%></td>
        </tr>
        <tr>
          <td class="form-key-cell">Expiration:</td>
          <td>
            <% if license.getExpirationDate()
              formatted_date = l(Date.parse(license.getExpirationDateAsString()))
            %>
              <%= license.isExpired() ? "<span class='error'>#{formatted_date}</span>" : formatted_date -%>
            <% else %>
              -
            <% end %>

          </td>
        </tr>
        <tr>
          <td class="form-key-cell">Type:</td>
          <td><%= license.getType() || '-' -%></td>
        </tr>
        <tr>
          <td class="form-key-cell">Server:</td>
          <td>
            <%  if license.getServer() &&
                   license.getServer() != "*" &&
                   controller.java_facade.getConfigurationValue("sonar.server_id") != license.getServer() %>
              <span class='error'><%= license.getServer() -%></span>
            <% else %>
              <%= license.getServer() || '-' -%>
            <% end %>            
          </td>
        </tr>
        <% license.additionalProperties().each do |k,v| -%>
        <tr>
          <td class="form-key-cell"><%= k -%>:</td>
          <td><%= v || '-' -%></td>
        </tr>
        <% end %>
      </table>
    </div>
  </div>
<% end %>