Commit 6ab6e401 authored by Coraline Ehmke's avatar Coraline Ehmke

More HTML output changes.

parent 842581c7
......@@ -18,7 +18,7 @@ module Snuffle
report(summary, summary.source)
summaries << summary
end
create_html_index(summaries)
create_html_index(summaries, path)
puts results_files.join("\n")
end
......@@ -42,9 +42,9 @@ module Snuffle
html_report(summary, source)
end
def create_html_index(summaries)
def create_html_index(summaries, start_path)
return unless options['format'] == 'html'
results_files << Snuffle::Formatters::HtmlIndex.new(summaries).export
results_files << Snuffle::Formatters::HtmlIndex.new(summaries, start_path).export
end
def cvs_report(summary)
......
......@@ -5,10 +5,11 @@ module Snuffle
include Formatters::Base
attr_accessor :summaries
attr_accessor :summaries, :start_path
def initialize(summaries)
def initialize(summaries, start_path)
self.summaries = summaries.sort{|a,b| a.cohorts.count <=> b.cohorts.count}.reverse
self.start_path = start_path
end
def header
......@@ -18,7 +19,8 @@ module Snuffle
def content
Haml::Engine.new(output_template).render(
Object.new, {
summaries: summaries,
summaries: self.summaries,
start_path: self.start_path,
date: Time.now.strftime("%Y/%m/%d"),
time: Time.now.strftime("%l:%M %P")
}
......
......@@ -2,7 +2,7 @@
%html
%head
%title
Fukuzatsu
Snuffle
%link{href: "http://cdn.datatables.net/1.10.0/css/jquery.dataTables.css", rel: "stylesheet"}
%style{media: "screen", type: "text/css"}
......@@ -26,7 +26,7 @@
h3 { color:#fff; font-size: 1.1em;margin-top: 1em; }
li { margin-bottom: 1em;}
div.file_meta { padding: 1em; border-radius: 5px; background: #444; height: 3.5em; width: 98%; border: .5em solid #000;}
div.file_listing { padding: .5em; border-radius: 5px; background: #222; width: 98%; border: 1px solid #000;}
div.file_listing { padding: .5em; border-radius: 5px; background: #222; width: 100%; border: 1px solid #000;}
= ".summary {padding: 1em; border-radius: 5px; background: #4c5d62; width: 98%; border: .5em solid #000;}"
= ".clear { clear: both; }"
= ".indented {margin-left: 1em; }"
......@@ -36,38 +36,38 @@
.file_meta
%h1
Snuffle Analysis
%h2
= start_path
%br.clear
.summary
%table{class: "output-table"}
%table{class: "output-table"}
%thead
%tr
%th
File
%th
Host Module/Class
%th
Object Candidates
%tbody
- summaries.each_with_index do |summary, i|
%tr{class: "#{i % 2 == 1 ? 'odd' : 'even'} #{summary.cohorts.count == 0 ? 'faint' : ''}"}
%td
- if summary.cohorts.count == 0
%thead
%tr
%th
File
%th
Host Module/Class
%th
Object Candidates
%tbody
- summaries.each_with_index do |summary, i|
%tr{class: "#{i % 2 == 1 ? 'odd' : 'even'} #{summary.cohorts.count == 0 ? 'faint' : ''}"}
%td
- if summary.cohorts.count == 0
= summary.path_to_file
- else
%a{href: "source/#{summary.class_filename}.htm"}
= summary.path_to_file
- else
%a{href: "source/#{summary.class_filename}.htm"}
= summary.path_to_file
%td
- if summary.class_name.size > 30
= "..."
= summary.class_name[-29..-1]
- else
= summary.class_name
%td
= summary.cohorts.count
%td
- if summary.class_name.size > 30
= "..."
= summary.class_name[-29..-1]
- else
= summary.class_name
%td
= summary.cohorts.count
%br.clear
......
......@@ -20,7 +20,7 @@
h3 { color:#fff; font-size: 1.1em;margin-top: 1em; }
li { margin-bottom: 1em;}
div.file_meta { padding: 1em; border-radius: 5px; background: #444; height: 3.5em; width: 98%; border: .5em solid #000;}
div.file_listing { padding: .5em; border-radius: 5px; background: #222; width: 98%; border: 1px solid #000;}
div.file_listing { padding: .5em; border-radius: 5px; background: #222; width: 100%; border: 1px solid #000;}
= ".summary {padding: 1em; border-radius: 5px; background: #4c5d62; width: 98%; border: .5em solid #000;}"
= ".clear { clear: both; }"
= ".indented {margin-left: 1em; }"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment