<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>VERSION</filename>
    </added>
    <added>
      <filename>bin/drsetup</filename>
    </added>
    <added>
      <filename>dynamic_reports-0.0.2.gem</filename>
    </added>
    <added>
      <filename>dynamic_reports-0.0.3.gem</filename>
    </added>
    <added>
      <filename>dynamic_reports.gemspec</filename>
    </added>
    <added>
      <filename>lib/dynamic_reports/resources/dynamic_reports.css</filename>
    </added>
    <added>
      <filename>lib/dynamic_reports/resources/dynamic_reports.js</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,7 +1,7 @@
 = Dynamic Reports
 
   A dynamic reporting engine for Ruby / Rails
-
+  
 == Reports
   
   The dynamic reports gem was created to fill a HUGE hole that we felt existed in the 
@@ -114,32 +114,90 @@
         label_column &quot;created_at&quot;
     end
 
-== Stylizing
-
-  The reports are, by default, stylized with an inline style sheet.  The styles produce a nicely formatted grid with
-  a white on black header row and black on white columns with a gray border througout.
+== External Links
 
-  You can create your own styles by simply adding a class_name object to the report definition as such:
-
-    class OrdersReport &lt; DynamicReports::Report
-      title &quot;Orders Report&quot;
-      subtitle &quot;All orders recorded in database&quot;
-      columns :total, :created_at
+  Dynamic Reports supports linking from any column within your table.  To add a link to a column, add the following 
+  to a report definition:
+  
+  link :column, url
+  
+  For example:
+  
+  class OrdersReport &lt; DynamicReports::Report
+    title &quot;Orders Report&quot;
+    subtitle &quot;All orders recorded in database&quot;
+    columns :total, :created_at
+    
+    link :total, '/report/daily_sales'
+  end
+  
+  You can also pass parameters to the URL based on values from the underlying model.  To pass a parameter, surround the 
+  field name with {}.  The parameter does NOT need to be a displayed, column.  For example, you might want to pass 
+  an external link an ID column but not display this column on the table.  
+  
+  For example:
+  
+  class OrdersReport &lt; DynamicReports::Report
+    title &quot;Orders Report&quot;
+    subtitle &quot;All orders recorded in database&quot;
+    columns :total, :created_at
+    
+    link :total, '/report/item_sales?id={id}'   # =&gt;  Will substitute ID for the value of ID associated with that record
+  end
+  
+  
+== Subreports
 
-      class_name &quot;my_class_name&quot;
-    end
+  Dynamic Reports supports the display of a sub-report within any report.  This is accomplished using the jQuery library 
+  available at http://www.jquery.com.  
+  
+  Sub-reports are created using the same definition format that you would use to create a standard report.  The only 
+  difference is that it is displayed INLINE when an associated link is clicked.  
+  
+  A sub-report is defined using the same format as a LINK above, but is labeled as:
+  
+  subreport :column, url
+  
+  For example, if you wanted to show all sales and allow a user to click on a specific item to see all historic sales 
+  inline for just that item, you would do the following:
+  
+  IN CONTROLLER:
+  
+  def orders
+    @orders = Order.find(:all, :limit =&gt; 25)
+    render :text =&gt; OrdersReport.on(@orders).to_html, :layout =&gt; &quot;application&quot;
+  end
+  
+  def item_sales
+    @item_orders = Order.find_by_id(params[:id])
+    render :text =&gt; ItemSales.on(@orders).to_html, :layout =&gt; &quot;application&quot;
+  end
+  
+  REPORT DEFINITIONS
+  
+  class OrdersReport &lt; DynamicReports::Report
+    title &quot;Orders Report&quot;
+    subtitle &quot;All orders recorded in database&quot;
+    columns :total, :created_at
+    
+    subreport :total, '/report/item_sales?id={id}'   # =&gt;  Will substitute ID for the value of ID associated with that record
+  end
+  
+  class ItemSales &lt; DynamicReports::Report
+    columns :item, :price, :created_at
+  end
+  
+  Subreports can also be nested.
+  
+== Rails Usage
 
-  This will cause DR to simply not include the inline style.  From there you can customer the styles using the
-  following sub-classes for your class name, for example:
+  The gem includes a stylesheet and javascript based on jQuery.  To add both to your Rails project, 
+  simply type &quot;drsetup&quot; from the project root.  This will add:
 
-    .my_class_name .report_title {}
-    .my_class_name .report_subtitle {}
-    .my_class_name table tr th {}
-    .my_class_name table tr td {}
-    .my_class_name .report_charts {}        // all charts are displayed within this div
-    .my_class_name .report_chart {}         // represents an individual chart
+  public/stylesheets/dynamic_reports.css  (controls style of dynamic reports)
+  public/javascripts/dynamic_reports.js   (controls display of subreports)
 
-== Rails Usage
+  You can then modify these files as you see fit.
   
   Inside the initializer block in config/environment.rb 
 </diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>dynamic_reports-0.0.0.gem</filename>
    </modified>
    <modified>
      <diff>@@ -183,6 +183,12 @@ module DynamicReports
       def link(column, url, link_options=nil)
         links({:column =&gt; column, :url =&gt; url, :link_options =&gt; link_options})
       end
+      
+      def subreport(column, url, link_options=nil)
+        link_options ||= {}
+        link_options.merge!({:class =&gt; 'sub_report_link'}) 
+        links({:column =&gt; column, :url =&gt; url, :link_options =&gt; link_options})
+      end
 
       # Method for instanciating a report instance on a set of given records.
       #
@@ -200,14 +206,6 @@ module DynamicReports
       def on(records)
         new(records, @options)
       end
-
-      #--
-      # Methods for definining a sub report
-      #def link_column
-      #end
-      #def link_rows
-      #end
-
     end
 
     # Instantiate the report on a set of records.</diff>
      <filename>lib/dynamic_reports/reports.rb</filename>
    </modified>
    <modified>
      <diff>@@ -47,7 +47,11 @@ module DynamicReports
       val = ''
 
       if column_object.is_a?(Hash)
-        column = column_object[:column]
+        if column_object.keys.include?(:column)
+          column = column_object[:column] 
+        else
+          column = column_object.keys.first # =&gt; Josh shortcut :)
+        end
       else
         column = column_object
       end
@@ -73,15 +77,6 @@ module DynamicReports
       val.blank? ? get_record_value(record,column) : val
     end
 
-    def get_record_value(record, column)
-      if record.is_a?(Hash)
-        record[column]
-      elsif record.respond_to?(column.to_sym)
-        record.send(column.to_sym)
-      else
-        column
-      end
-    end
 
     def chart_url(chart,report)
       columns = chart.columns ? chart.columns : report.columns
@@ -212,7 +207,15 @@ module DynamicReports
       require engine.downcase
     end
 
-
+     def get_record_value(record, column)
+        if record.is_a?(Hash)
+          record[column]
+        elsif record.respond_to?(column.to_sym)
+          record.send(column.to_sym)
+        else
+          column
+        end
+      end
 
   end
 end</diff>
      <filename>lib/dynamic_reports/templates.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,51 +1,3 @@
-&lt;% if report.class_name.nil? %&gt;
-&lt;style type=&quot;text/css&quot;&gt;
-.dynamic_report .report_title {
-  font-size:16pt;
-  font-weight:bold;
-  margin:10px 0px;
-}
-.dynamic_report .report_subtitle {
-  font-size:14pt;
-  color:black;
-  margin:10px 0px;
-}
-.dynamic_report table tr th {
-  color: white;
-  background: gray;
-  padding:5px;
-}
-.dynamic_report table tr td {
-  border: 1px solid black;
-  padding:3px 15px;
-}
-.dynamic_report .report_charts {
-  width: 100%;
-}
-
-.dynamic_report .report_chart {
-  margin:15px;
-}
-
-.dynamic_report .subreport_row td {
-  padding: 10px 10px 10px 20px;
-  background-color: #FFFFCC;
-  font-size: 95%;
-}
-.dynamic_report .subreport table tr td {
-  border: 1px dotted #CCCC99;
-  padding:3px 5px;
-  background-color: white;
-}
-.dynamic_report .subreport table tr th {
-  color: black;
-  background: #CCCCCC;
-  padding:3px;
-}
-
-&lt;/style&gt;
-&lt;% end %&gt;
-
 &lt;div id=&quot;&lt;%= report.class_name %&gt;&quot; class=&quot;dynamic_report&quot;&gt;
 &lt;%= &quot;&lt;div class='report_title'&gt;#{report.title}&lt;/div&gt;&quot; if report.title %&gt;
 &lt;%= &quot;&lt;div class='report_subtitle'&gt;#{report.sub_title}&lt;/div&gt;&quot; if report.sub_title %&gt;
@@ -58,7 +10,7 @@
   &lt;% if column.keys.include?(:heading) %&gt;
   &lt;%= options[:titleize] ? titleize(column[:heading]) : column[:heading] %&gt;
   &lt;% else %&gt;
-  &lt;%= options[:titleize] ? titleize(column[:column]) : column[:column] %&gt;
+  &lt;%= options[:titleize] ? titleize(column.values.first) : column.values.first  %&gt;
   &lt;% end %&gt;
   &lt;% else %&gt;
   &lt;%= options[:titleize] ? titleize(column) : column %&gt;
@@ -87,5 +39,4 @@
         &lt;/span&gt;
         &lt;% end %&gt;
         &lt;/div&gt;
-
         &lt;/div&gt;</diff>
      <filename>lib/dynamic_reports/views/default_report.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,46 +1,3 @@
-- if report.class_name.nil?
-  %style{type =&gt; &quot;text/css&quot;}
-    \.dynamic_report .report_title {
-    font-size:16pt;
-    font-weight:bold;
-    margin:10px 0px;
-    }
-    \.dynamic_report .report_subtitle {
-    font-size:14pt;
-    color:black;
-    margin:10px 0px;
-    }
-    \.dynamic_report table tr th {
-    color: white;
-    background: #666666;
-    padding:5px;
-    }
-    \.dynamic_report table tr td {
-    border: 1px solid #333333;
-    padding:3px 15px;
-    }
-    \.dynamic_report .report_charts {
-    width:100%;
-    }
-    \.dynamic_report .report_chart {
-    margin:15px;
-    }
-    \.dynamic_report .subreport_row td {
-    padding: 10px 10px 10px 20px;
-    background-color: #FFFFCC;
-    font-size: 95%;
-    }
-    \.dynamic_report .subreport table tr td {
-    border: 1px dotted #CCCC99;
-    padding:3px 5px;
-    background-color: white;
-    }    
-    \.dynamic_report .subreport table tr th {
-    color: black;
-    background: #CCCCCC;
-    padding:3px;
-    }
-
 .dynamic_report{ :id =&gt; report.class_name }
   - if report.title
     %h2.report_title
@@ -59,7 +16,7 @@
               - if column.keys.include?(:heading)            
                 = options[:titleize] ? titleize(column[:heading]) : column[:heading]
               -else
-                = options[:titleize] ? titleize(column[:column]) : column[:column]                
+                = options[:titleize] ? titleize(column.values.first) : column.values.first              
             -else
               = options[:titleize] ? titleize(column) : column
     %tbody.report_body</diff>
      <filename>lib/dynamic_reports/views/default_report.html.haml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e5c369457c621911c717f12fdc4d984ca174b9a8</id>
    </parent>
  </parents>
  <author>
    <name>Joshua Lippiner</name>
    <email>jlippiner@joshua-lippiners-macbook-pro.local</email>
  </author>
  <url>http://github.com/wayneeseguin/dynamic_reports/commit/35a07ccca4ecd56f42f1de223dabea1a684ce7d6</url>
  <id>35a07ccca4ecd56f42f1de223dabea1a684ce7d6</id>
  <committed-date>2009-07-16T06:53:41-07:00</committed-date>
  <authored-date>2009-07-16T06:53:41-07:00</authored-date>
  <message>Made styles and js resources.  Created drsetup executable.  Added heading shortcut</message>
  <tree>af10cbdbbb6025c84c2b019886f1329033569bbd</tree>
  <committer>
    <name>Joshua Lippiner</name>
    <email>jlippiner@joshua-lippiners-macbook-pro.local</email>
  </committer>
</commit>
