Sha256: 4c09595698ad6f4691239184441af4cd0d943a8b58035a21708b0c583e9c926d

Contents?: true

Size: 1.91 KB

Versions: 9

Compression:

Stored size: 1.91 KB

Contents

<%= search_form_for @record.search, :url => url_for, :html => {:method => :get, :class => 'form-inline'} do |f| %>
    <% @record.filters.each do |filter| %>
        <% if filter.class.supported_types.include?(filter.type) %>
            <% filter.comparators.each do |key, hint| %>
                <% search_key = "#{filter.column}_#{key}" %>
                <% if filter.date? %>
                    <%= f.date_field search_key, :placeholder => hint %>
                <% elsif filter.text? %>
                    <%= f.text_field search_key, placeholder: hint %>
                <% end %>
            <% end %>
        <% else %>
            <%= render :partial => "query_report/custom_filters", locals: {f: f, filter: filter} %>
        <% end %>
    <% end %>

    <%= f.submit 'Search', :class => 'btn' %>
<% end %>

<br/>
<%= link_to_download_report_pdf %>
<%= link_to_download_report_csv %>
<br/>
<br/>

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<div id='chart' style="margin-left:auto;margin-right:auto;width:600px;"></div>
<%= render_chart(@record.chart.prepare, 'chart') if @record.chart %>

<br/>
<% if @record.scopes.size > 0 %>
    <%= link_to_with_scope('all', @record.current_scope) %>
    <% @record.scopes.each do |scope| %>
        <%= link_to_with_scope(scope, @record.current_scope) %>
    <% end %>
<% end %>
<br/>
<br/>

<% if @record.column_names %>
    <table class="table table-bordered table-striped">
      <thead>
      <% @record.column_names.each do |column| %>
          <th><%= column.humanize %></th>
      <% end %>
      </thead>

      <tbody>
      <% @record.records.each do |record| %>
          <tr>
            <% @record.column_names.each do |column| %>
                <td><%= record[column] %></td>
            <% end %>
          </tr>
      <% end %>
      </tbody>
    </table>
<% else %>
    <p>No record found</p>
<% end %>

<%= paginate @report.query if @report.paginate? %>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
query_report-0.1.2 app/views/query_report/list.html.erb
query_report-0.1.1 app/views/query_report/list.html.erb
query_report-0.1.0 app/views/query_report/list.html.erb
query_report-0.0.9 app/views/query_report/list.html.erb
query_report-0.0.8 app/views/query_report/list.html.erb
query_report-0.0.7 app/views/query_report/list.html.erb
query_report-0.0.6 app/views/query_report/list.html.erb
query_report-0.0.5 app/views/query_report/list.html.erb
query_report-0.0.4 app/views/query_report/list.html.erb