<form action="<%= url_for :action => 'edit' -%>" method="POST" id="measure_edit_form">
    <fieldset>
        <div class="modal-head">
            <h2><%= message('manual_measures.edit_measure', :params => [h(@metric.short_name)]) -%></h2>
        </div>

        <div class="modal-body">
            <div class="modal-error"></div>

            <input type="hidden" name="id" value="<%= @resource.id -%>"/>

            <div class="modal-field">
              <input type="hidden" name="metric" id="metrictSelect" value="<%= @metric.key -%>" />
            </div>

            <div class="modal-field">
              <label for="measures[]"><%= message('manual_measures.col.value') -%> <em class="mandatory">*</em></label>
              <input type="text" name="val" id="valueText" value="<%= @measure ? @measure.editable_value : '' -%>"/>
              <% if @metric.value_type==Metric::VALUE_TYPE_PERCENT %>
                <span> % </span>
              <% end %>
            </div>
            <div class="modal-field">
              <label for="measures[]"><%= message('manual_measures.col.description') -%> </label>
              <textarea rows="5" cols="50" name="desc" class="width100"><%= @measure.description -%></textarea>
            </div>
        </div>

        <div class="modal-foot">
          <%= submit_tag message('save') %>
          <%= link_to message('cancel'), :action => 'index', :id => @resource.id -%>
        </div>
    </fieldset>
</form>

<script>
  $j("#measure_edit_form").modalForm();
</script>

