New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 82830


Ignore:
Timestamp:
08/20/11 18:26:17 (4 years ago)
Author:
derek@…
Message:

Display tweaks

  • Added "Operating System Statistics" header
  • Added links to each visualization using html anchors
  • Only display a chart that has a non-empty dataset
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gsoc11-statistics/stats-server/app/views/os_statistics/index.html.erb

    r82156 r82830  
    1313<% end %> 
    1414 
     15<br /> 
     16 
    1517<%# Order the charts %> 
    1618<% ordered_charts = [:macports_version,  
     
    2224                     :xcode_version] %> 
    2325 
     26<h1> Operating System Statistics </h1> 
     27 
     28<%# Generate links %> 
     29<ul> 
     30<% ordered_charts.each do |chart|  %> 
     31<li> <%= link_to controller.chart_title(chart), :anchor => chart %> </li> 
     32<% end %> 
     33</ul> 
     34 
     35<br /> 
     36 
    2437<% ordered_charts.each do |chart| %> 
    25   <% options = {:width => 600, :height => 400, :html => {:class => "graph_chart"}} %> 
    26   <% options[:title] = controller.chart_title chart %> 
     38  <% title = controller.chart_title chart %> 
     39  <%# Set visualization options %> 
     40  <% vis_options = {:width => 600, :height => 400, :html => {:class => "graph_chart"}} %> 
     41  <% vis_options[:title] = title %> 
     42   
     43  <%# Set table options %> 
     44  <% table_options = {:width => 600, :html => {:class => "graph_chart"}} %> 
     45  <% table_options[:title] = title %> 
     46   
    2747  <% type = controller.chart_type chart %> 
    2848   
    29   <% visualization chart, type, options do |visualization| %> 
    30     <% controller.populate_chart chart, visualization %> 
     49  <%# Anchor %> 
     50  <a name=<%= chart %>> </a> 
     51  <%# Title %> 
     52  <h2> <%= title %> </h2> 
     53   
     54   
     55  <% if not controller.dataset_empty? chart %> 
     56    <%# Draw visualization %> 
     57    <% visualization chart, type, vis_options do |visualization| %> 
     58      <% controller.populate_chart chart, visualization %> 
     59    <% end %> 
     60     
     61    <%# Draw table %> 
     62    <% table = chart.to_s + "_table" %> 
     63    <% visualization table, "Table", table_options do |visualization| %> 
     64      <% controller.populate_chart chart, visualization %> 
     65    <% end %> 
     66  <% else %> 
     67    No data to display 
    3168  <% end %> 
     69   
     70   
    3271<% end %> 
    3372 
Note: See TracChangeset for help on using the changeset viewer.