[82854] branches/gsoc11-statistics/stats-server/app/views

derek at macports.org derek at macports.org
Sat Aug 20 20:09:55 PDT 2011


Revision: 82854
          http://trac.macports.org/changeset/82854
Author:   derek at macports.org
Date:     2011-08-20 20:09:55 -0700 (Sat, 20 Aug 2011)
Log Message:
-----------
Chart drawing code was moved to partial _chart_draw.html.erb. Render the partial

Modified Paths:
--------------
    branches/gsoc11-statistics/stats-server/app/views/os_statistics/index.html.erb
    branches/gsoc11-statistics/stats-server/app/views/ports/show.html.erb

Modified: branches/gsoc11-statistics/stats-server/app/views/os_statistics/index.html.erb
===================================================================
--- branches/gsoc11-statistics/stats-server/app/views/os_statistics/index.html.erb	2011-08-21 03:09:32 UTC (rev 82853)
+++ branches/gsoc11-statistics/stats-server/app/views/os_statistics/index.html.erb	2011-08-21 03:09:55 UTC (rev 82854)
@@ -34,41 +34,8 @@
 
 <br />
 
-<% ordered_charts.each do |chart| %>
-  <% title = controller.chart_title chart %>
-  <%# Set visualization options %>
-  <% vis_options = {:width => 600, :height => 400, :html => {:class => "graph_chart"}} %>
-  <% vis_options[:title] = title %>
-  
-  <%# Set table options %>
-  <% table_options = {:width => 600, :html => {:class => "graph_chart"}} %>
-  <% table_options[:title] = title %>
-  
-  <% type = controller.chart_type chart %>
-  
-  <%# Anchor %>
-  <a name=<%= chart %>> </a>
-  <%# Title %>
-  <h2> <%= title %> </h2>
-  
-  
-  <% if not controller.dataset_empty? chart %>
-    <%# Draw visualization %>
-    <% visualization chart, type, vis_options do |visualization| %>
-      <% controller.populate_chart chart, visualization %>
-    <% end %>
-    
-    <%# Draw table %>
-    <% table = chart.to_s + "_table" %>
-    <% visualization table, "Table", table_options do |visualization| %>
-      <% controller.populate_chart chart, visualization %>
-    <% end %>
-  <% else %>
-    No data to display
-  <% end %>
-  
-  
-<% end %>
+<%# Draw charts %>
+<%= render :partial => '/partials/chart_draw', :locals => {:charts => ordered_charts} %>   %>
 
 <br />
 

Modified: branches/gsoc11-statistics/stats-server/app/views/ports/show.html.erb
===================================================================
--- branches/gsoc11-statistics/stats-server/app/views/ports/show.html.erb	2011-08-21 03:09:32 UTC (rev 82853)
+++ branches/gsoc11-statistics/stats-server/app/views/ports/show.html.erb	2011-08-21 03:09:55 UTC (rev 82854)
@@ -64,41 +64,8 @@
   <br />
 
   <%# Draw charts %>
-  <% ordered_charts.each do |chart| %>
-    <% title = controller.chart_title chart %>
-    <%# Set visualization options %>
-    <% vis_options = {:width => 600, :height => 400, :html => {:class => "graph_chart"}} %>
-    <% vis_options[:title] = title %>
+  <%= render :partial => '/partials/chart_draw', :locals => {:charts => ordered_charts} %>   %>
 
-    <%# Set table options %>
-    <% table_options = {:width => 600, :html => {:class => "graph_chart"}} %>
-    <% table_options[:title] = title %>
-    
-    <% type = controller.chart_type chart %>
-
-    <%# Anchor %>
-    <a name=<%= chart %>> </a>
-    <%# Title %>
-    <h2> <%= title %> </h2>
-   
-  
-    <% if not controller.dataset_empty? chart %>
-      <%# Draw visualization %>
-      <% visualization chart, type, vis_options do |visualization| %>
-        <% controller.populate_chart chart, visualization %>
-      <% end %>
-      
-      <%# Draw table %>
-      <% table = chart.to_s + "_table" %>
-      <% visualization table, "Table", table_options do |visualization| %>
-        <% controller.populate_chart chart, visualization %>
-      <% end %>
-      
-    <% else %>
-      No data to display
-    <% end %>  
-  <% end %>
-
   <table border=1>
     <tr>
       <th> ID </th>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110820/ebe36a0b/attachment.html>


More information about the macports-changes mailing list