Sha256: 60a34f09ed19361e3ce21211a4124fa6812bc6337b14d58b486d411ade198770

Contents?: true

Size: 784 Bytes

Versions: 1

Compression:

Stored size: 784 Bytes

Contents

Ruport::Formatter::HTML.class_eval do
  # Renders individual rows for the table.
  def build_row(data = self.data)
    @odd = !@odd
    klass = @odd ? "odd" : "even"
    output <<
    "\t\t<tr class=\"#{klass}\">\n\t\t\t<td>" +
      data.to_a.join("</td>\n\t\t\t<td>") +
      "</td>\n\t\t</tr>\n"
  end

  def html_table
    @odd = false
    "<table class=\"tablesorter\">\n" << yield << "</table>\n"
  end

  def build_table_header
    output << "\t<table class=\"tablesorter\">\n"
    unless data.column_names.empty? || !options.show_table_headers
      output << "\t\t<thead><tr>\n\t\t\t<th>" + 
        data.column_names.join("</th>\n\t\t\t<th>") + 
        "</th>\n\t\t</tr></thead>\n"
    end
  end

  def build_group_header
    output << "\t<h1>#{data.name}</h1>\n"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree_advanced_reporting-2.1.0 app/models/ruport/formatter/html_decorator.rb