mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 22:26:22 +00:00
71ff9e5e7b
Los nombres más comunas de columnas se pueden agregar al archivo de traducción, si la traducción no existe se convierte a un título. ```ruby "total_horas".titleize => "Total Horas" ```
51 lines
1.9 KiB
Text
51 lines
1.9 KiB
Text
- blazer_title @query.name
|
|
.container
|
|
.row
|
|
.col-12
|
|
%h1= @query.name
|
|
- if @query.description.present?
|
|
%p.lead= @query.description
|
|
- unless @result.chart_type.blank?
|
|
.col-12
|
|
- case @result.chart_type
|
|
- when 'line'
|
|
= line_chart @chart_data, **@chart_options
|
|
- when 'line2'
|
|
= line_chart @chart_data, **@chart_options
|
|
- when 'pie'
|
|
= pie_chart @chart_data, **@chart_options
|
|
- when 'bar'
|
|
= column_chart @chart_data, **@chart_options
|
|
- when 'bar2'
|
|
= column_chart @chart_data, **@chart_options
|
|
- when 'scatter'
|
|
= scatter_chart @chart_data, **@chart_options
|
|
.col-12
|
|
%table.table
|
|
%thead
|
|
%tr
|
|
- @result.columns.each do |key|
|
|
- next if key.include? 'ciphertext'
|
|
- next if key.include? 'encrypted'
|
|
%th.position-sticky.background-white{ style: 'top: 0' }= t("blazer.columns.#{key}", default: key.titleize)
|
|
%tbody
|
|
- @result.rows.each do |row|
|
|
%tr
|
|
- row.each_with_index do |v, i|
|
|
- k = @result.columns[i]
|
|
- next if k.include? 'ciphertext'
|
|
- next if k.include? 'encrypted'
|
|
%td
|
|
- if v.is_a?(Time)
|
|
- v = blazer_time_value(@data_source, k, v)
|
|
|
|
- unless v.nil?
|
|
- if v.is_a?(String) && v.empty?
|
|
%span.text-muted= t('.empty')
|
|
- elsif @data_source.linked_columns[k]
|
|
= link_to blazer_format_value(k, v), @data_source.linked_columns[k].gsub('{value}', u(v.to_s)), target: '_blank'
|
|
- else
|
|
= blazer_format_value(k, v)
|
|
|
|
- if (v2 = (@result.boom[k] || {})[v.nil? ? v : v.to_s])
|
|
%span.text-muted= v2
|