Sha256: 5b06fea69f0297a9b19cb8add55048de9ba12fa7fadf7f622af2c46aa21434ed

Contents?: true

Size: 1.96 KB

Versions: 4

Compression:

Stored size: 1.96 KB

Contents

- blazer_title @query.name
%nav.navbar.navbar-default.navbar-fixed-top
  .container
    = render layout: "layouts/bnb_blazer/navbar" do
      %li= link_to "Edit", edit_query_path(@query, variable_params(@query)), class: "text-muted font-weight-bold px-1", disabled: !@query.editable?(blazer_user)
      %li= link_to "Fork", new_query_path(variable_params(@query).merge(fork_query_id: @query.id, data_source: @query.data_source, name: @query.name)), class: "text-muted font-weight-bold px-1"
      - if !@error && @success
        %li= link_to "Download", run_queries_path(query_id: @query.id, format: "csv", forecast: params[:forecast], cohort_period: params[:cohort_period]), params: {statement: @statement}, class: "text-muted font-weight-bold px-1"

#blazer-content
  %div{:style => "margin-bottom: 70px;"}
  - if @sql_errors.any?
    .alert.alert-danger
      %ul
        - @sql_errors.each do |message|
          %li= message
  %h3.text-center=@query.name
  - if @query.description.present?
    %p= @query.description
  = render partial: "bnb_blazer/variables", locals: {action: query_path(@query)}
  %pre#code
    %code= @statement
  - if @success
    #results
      %p.text-muted.text-uppercase Loading...
    :javascript
      function showRun(data) {
        $("#results").html(data)
        $("#results table").stupidtable(stupidtableCustomSettings).stickyTableHeaders({fixedOffset: 60})
      }

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

      #{blazer_js_var "data", variable_params(@query).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

4 entries across 4 versions & 1 rubygems

Version Path
bnb_blazer-0.9.0 app/views/bnb_blazer/queries/show.html.haml
bnb_blazer-0.8.0 app/views/bnb_blazer/queries/show.html.haml
bnb_blazer-0.7.0 app/views/bnb_blazer/queries/show.html.haml
bnb_blazer-0.6.0 app/views/bnb_blazer/queries/show.html.haml