Sha256: 2d1c376607ecb61515e47e626dd3545aacccd3651f4410883fbc95254ec84ebd

Contents?: true

Size: 1.98 KB

Versions: 2

Compression:

Stored size: 1.98 KB

Contents

- blazer_title @query.name
.topbar
  .container
    .row{:style => "padding-top: 13px;"}
      .col-sm-8
        = render partial: "blazer/nav"
        %h3{:style => "line-height: 34px; display: inline; margin-left: 5px;"}
          = @query.name
      .col-sm-4.text-right
        = link_to "Edit", edit_query_path(@query, variable_params), class: "btn btn-default", disabled: !@query.editable?(blazer_user)
        = link_to "Fork", new_query_path(variable_params.merge(fork_query_id: @query.id, data_source: @query.data_source, name: @query.name)), class: "btn btn-info"
        - if !@error && @success
          = button_to "⤓ .csv", run_queries_path(query_id: @query.id, format: "csv", forecast: params[:forecast]), params: {statement: @statement}, class: "btn btn-primary"
          = button_to "⤓ .xlsx", run_queries_path(query_id: @query.id, format: "xlsx"), params: {statement: @statement}, class: "btn btn-primary"
%div{:style => "margin-bottom: 60px;"}
- if @sql_errors.any?
  .alert.alert-danger
    %ul
      - @sql_errors.each do |message|
        %li= message
- if @query.description.present?
  %p= @query.description
= render partial: "blazer/variables", locals: {action: query_path(@query)}
%pre#code
  %code= @statement
- if @success
  #results
    %p.text-muted Loading...
  :javascript
    function showRun(data) {
      $("#results").html(data);
      $("#results table").stupidtable().stickyTableHeaders({
        fixedOffset: 60,
      });
    }

    function showError(message) {
      $("#results").addClass("query-error").html(message);
    }

    #{blazer_js_var "data", variable_params.merge(statement: @statement, query_id: @query.id, data_source: @query.data_source)}

    runQuery(data, showRun, showError)
- unless %w(mongodb).include?(Blazer.data_sources[@query.data_source].adapter)
  :javascript
    // do not highlight really long queries
    // this can lead to performance issues
    if ($("code").text().length < 10000) {
      hljs.highlightBlock(document.getElementById("code"));
    }

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sql-jarvis-2.1.1 app/views/blazer/queries/show.html.haml
sql-jarvis-2.1 app/views/blazer/queries/show.html.haml