<form method="post" action="<%= ApplicationController.root_context -%>/server_id_configuration/generate">
  <table class="marginbottom10">
    <thead>
    <tr>
      <td style="padding: 10px" colspan="2">
        <p><%= message('server_id_configuration.information') -%></p>

        <% if @server_id %>
          <p>
            <br/>
            <span class="<%= @bad_id ? 'error' : 'notice' -%>" id="server_id"><big><%= @server_id -%></big></span>
          <% if @bad_id %>
            <span class="error"><%= message('server_id_configuration.bad_key') -%></span>
          <% end %>
          </p>
        <% end %>
      </td>
    </tr>
    </thead>
    <tbody>
    <tr class="property">
      <th>
        <h3><%= message('server_id_configuration.organisation.title') -%></h3>
      </th>
      <td>
        <input type="text" name="organisation" value="<%= @organisation -%>" size="50"/>
        <br/>
        <p class="marginbottom10"><%= message('server_id_configuration.organisation.desc') -%></p>
        <span class="note"><%= message('server_id_configuration.organisation.pattern') -%></span>
      </td>
    </tr>
    <tr class="property">
      <th>
        <h3><%= message('server_id_configuration.ip.title') -%></h3>
      </th>
      <td>
        <input type="text" name="address" value="<%= @address -%>"/>
        <p class="marginbottom10"><%= message('server_id_configuration.ip.desc') -%></p>
        <ul class="marginbottom10 bullet">
          <% @valid_addresses.each_with_index do |ip_address, index| %>
            <li><span id="address_<%= index -%>"><%= ip_address.getHostAddress() -%></span></li>
          <% end %>
        </ul>
      </td>
    </tr>
    </tbody>
  </table>

  <%= submit_tag message('server_id_configuration.generate_button'), :disable_with => message('server_id_configuration.generating_button'), :id => 'generate-button' -%>
</form>


