<%= query.description %>

<%= raw query.query_with_highlight %>

Create report

<%= form_for [query, query.executions.build], html: {role: 'form'} do |f| %>
<%= f.label :report_format %> <%= f.select :report_format, f.object.supported_formats, {}, class: 'form-control' %> <% if query.parameters.present? %>

Query parameters

<% query.parameters.each do |param_name| %>
<%= label_tag "parameters_#{param_name}", "#{param_name}" %> <%= query_parameter_field(param_name) %>
<% end %>
<% end %>
<%= f.submit 'Create report', class: 'btn btn-default' %>
<% end %>

Reports

<% query.executions.recent_first.preload(:report).each do |exec| %> <% next if exec.report.try(:on_the_fly?) %> <%= render 'execution', query: query, exec: exec %> <% end %>
  <%= human(Adhoq::Execution, :created_at) %> <%= human(Adhoq::Execution, :status) %>