#dashboard_popup{class: @constraint.key}
  %h2
    - if @constraint.output_element
      = t("output_elements.#{@constraint.output_element.key}").html_safe
    - else
      = t("constraints.#{@constraint.key}.title").html_safe

    - if @constraint.output_element_id
      %span.popup-actions
        %a.chart_format.tooltip.button{href: "#", title: t('output_elements.tooltips.chart')}
          Chart view
        %a.table_format.tooltip.button{href: "#", title: t('output_elements.tooltips.table')}
          Table view

  - if @constraint.description
    .description= @constraint.description.try :short_content

  - if @constraint.output_element_id
    #charts
      .chart{:'data-chart_id' => @constraint.output_element_id }

  = render partial: @constraint.key rescue nil

  = render 'output_elements/chart_template'
  :javascript
    #{render 'js_init.js'}


#dashboard_popup{class: @constraint.key}
  %h2
    - if @constraint.output_element
      = t("output_elements.#{@constraint.output_element.key}").html_safe
    - else
      = t("constraints.#{@constraint.key}.title").html_safe

    - if @constraint.output_element_id
      %span.popup-actions
        %a.chart_format.tooltip.button{href: "#", title: t('output_elements.tooltips.chart')}
          %span.fa.fa-bar-chart-o
          Chart View
        %a.table_format.tooltip.button{href: "#", title: t('output_elements.tooltips.table')}
          %span.fa.fa-table
          Table View

  - if @constraint.description
    .description= @constraint.description.try :short_content

  - if @constraint.output_element_id
    #charts
      .chart{:'data-chart_id' => @constraint.output_element_id }

  = render partial: @constraint.key rescue nil

  = render 'output_elements/chart_template'
  :javascript
    #{render 'js_init.js'}


Update table and chart view button
Update table and chart view button
