sleepepi/sleepportal

View on GitHub
app/views/reports/_edit.html.erb

Summary

Maintainability
Test Coverage
<div class="page-header">
  <h3>
    <%= @report.is_dataset? ? 'Dataset' : 'Report' %>: <%= @report.name %>
    <small>(<span id="report_concepts_num"><%= pluralize @report.report_concepts.size, 'concept' %></span>)</small>
  </h3>
</div>

<%= form_tag report_concepts_path(search_id: @search.id, report_id: @report.id), method: :post, remote: true, id: 'report_concept_search_form', class: 'form-horizontal' do %>
  <%= hidden_field_tag 'selected_report_concept_id', '', name: 'concept_id' %>

  <div class="form-group">
    <label class="control-label">With</label>
    <div class="col-md-10">
      <%= text_field_tag 'report_concept_search_term', '', name: 'concept_search_term', rel: 'tooltip', title: 'Search for Age, Gender, Body Mass Index and hit <b>[Enter]</b>', data: { object: 'report-concept-typeahead', search_id: @search.id }, style: 'width:350px'  %>
      <%= link_to 'more', search_folder_concepts_path(popup: true, search_id: @search.id, add_report_id: @report.id), method: :post, remote: true, class: 'btn btn-xs btn-default', rel: 'tooltip', title: 'Browse more concepts', data: { placement: 'right' } %>
    </div>
  </div>
<% end %>


<% unless @report.is_dataset? %>
  <div id="report_configuration">
    <%= render 'reports/configuration' %>
  </div>

  <div id="report_table">
    <%= link_to 'Reload Report', '#', data: { object: 'submit', target: '#report_table_form' } %>
  </div>
<% end %>

<div id="report_concepts">
  <%= render partial: 'report_concepts/report_concepts' %>
</div>