Ignore:
Timestamp:
Aug 21, 2011, 1:23:55 AM (9 years ago)
Author:
derek@…
Message:

Display tweaks

  • Show name of port as a header
  • Added links to each visualization using html anchors
  • Visualizations and tables have separate options - tables shouldn't have a fixed height
File:
1 edited

Legend:

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

    r82159 r82828  
    1717                     :variant_count] %>
    1818
     19<h1> <%= @port.name %> </h1>
     20
     21<br />
     22
    1923<div id="content">
    20   <p>
    21     <strong>Name:</strong> <%= @port.name %>
    22   </p>
    23 
    2424  <p>
    2525    <strong>Current Version:</strong> <%= @port.version %>
     
    4949  <% end %>
    5050
     51  </div>
     52 
     53  <br />
     54 
     55  <h2> Stats </h2>
     56
     57  <%# Generate links %>
     58  <ul>
     59  <% ordered_charts.each do |chart|  %>
     60  <li> <%= link_to controller.chart_title(chart), :anchor => chart %> </li>
     61  <% end %>
     62  </ul>
     63
     64  <br />
     65
    5166  <%# Draw charts %>
    5267  <% ordered_charts.each do |chart| %>
    53     <% options = {:width => 600, :height => 400, :html => {:class => "graph_chart"}} %>
    54     <% options[:title] = controller.chart_title chart %>
     68    <% title = controller.chart_title chart %>
     69    <%# Set visualization options %>
     70    <% vis_options = {:width => 600, :height => 400, :html => {:class => "graph_chart"}} %>
     71    <% vis_options[:title] = title %>
     72
     73    <%# Set table options %>
     74    <% table_options = {:width => 600, :html => {:class => "graph_chart"}} %>
     75    <% table_options[:title] = title %>
     76   
    5577    <% type = controller.chart_type chart %>
    5678
    57     <% visualization chart, type, options do |visualization| %>
    58       <% controller.populate_chart chart, visualization %>
    59     <% end %>
     79    <%# Anchor %>
     80    <a name=<%= chart %>> </a>
     81    <%# Title %>
     82    <h2> <%= title %> </h2>
     83   
     84 
     85    <% if not controller.dataset_empty? chart %>
     86      <%# Draw visualization %>
     87      <% visualization chart, type, vis_options do |visualization| %>
     88        <% controller.populate_chart chart, visualization %>
     89      <% end %>
     90     
     91      <%# Draw table %>
     92      <% table = chart.to_s + "_table" %>
     93      <% visualization table, "Table", table_options do |visualization| %>
     94        <% controller.populate_chart chart, visualization %>
     95      <% end %>
     96     
     97    <% else %>
     98      No data to display
     99    <% end %> 
    60100  <% end %>
    61101
Note: See TracChangeset for help on using the changeset viewer.