_form.html.erb 3.13 KB
  <%= render :partial => 'shared/form_errors', :locals => {:object => @kalibro_range} %>

  <div class="row margin-left-none">
    <div class="form-table col-md-9">

      <div class="form-row">
        <% if @readings.size == 0 %>
        <%= render partial: 'no_readings' %>
        <% else %>
        <div class="field-container">
          <%= f.label :reading_id, t('reading'), class: 'control-label' %>
          <%= f.select( :reading_id, readings_options(@readings), {class: 'form-control'} ) %>
        </div>
        <div class="help-container">
          <p>
            <%= t_hint('reading', 'kalibro_range',
                  reading_href: link_to(t('reading'), "http://mezuro.github.io/tutorial/2016/04/04/tutorial-keywords.html#reading", target: "_blank"),
                  range_href: link_to(KalibroRange.model_name.human, "http://mezuro.github.io/tutorial/2016/04/04/tutorial-keywords.html#range", target: "_blank")
                 ).html_safe
            %>
          </p>
        </div>
        <% end %>
      </div>

      <div class="form-row">
        <div class="field-container" >
           <%= f.label :beginning, class: 'control-label' %>
           <div class="input-group">
              <%= f.text_field :beginning, :required => true, class: 'diminished-text-field form-control' %>
              <span class="input-group-btn">
                <%= link_to '-&#8734'.html_safe, 'javascript:void(0)', :onClick => "jQuery( '#kalibro_range_beginning' ).val('-INF');", class: 'btn btn-default' %>
              </span>
          </div>
        </div>

        <div class="help-container">
          <p>
            <%= t_hint('beginning', 'kalibro_range') %>
          </p>
        </div>
      </div>

      <div class="form-row">
        <div class="field-container">
          <%= f.label :end, class: 'control-label' %>
          <div class="input-group">
            <%= f.text_field :end, :required => true, class: 'diminished-text-field form-control' %>
             <span class="input-group-btn">
                <%= link_to '&#8734'.html_safe, 'javascript:void(0)', :onClick => "jQuery( '#kalibro_range_end' ).val('INF');", class: 'btn btn-default align-button' %>
              </span>
          </div>
        </div>
        <div class="help-container">
          <p>
            <%= t_hint('end', 'kalibro_range') %>
          </p>
        </div>
      </div>

      <div class="form-row">
        <div class="field-container">
          <%= f.label :comments, class: 'control-label' %>
          <%= f.text_area :comments, class: 'text-area form-control' %>
        </div>
        <div class="help-container">
          <p>
            <%= t_hint('comments', 'kalibro_range', metric_href: link_to(t('metric'), "http://mezuro.github.io/tutorial/2016/04/04/tutorial-keywords.html#metric", target: "_blank")).html_safe %>
          </p>
        </div>
      </div>
    </div>
  </div>

  <div class="row margin-left-none" style="margin-top: 20px">
    <%= f.submit t('save'), class: 'btn btn-primary' %>
    <%= link_to t('back'), kalibro_configuration_metric_configuration_path(@kalibro_configuration_id, @metric_configuration_id), class: 'btn btn-default' %>
  </div>