<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[116825] branches/gsoc11-statistics/stats-server</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/116825">116825</a></dd>
<dt>Author</dt> <dd>cal@macports.org</dd>
<dt>Date</dt> <dd>2014-02-07 17:57:57 -0800 (Fri, 07 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>macports stat: use macports colors and css</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchesgsoc11statisticsstatsserverappviewscategoriesindexhtmlerb">branches/gsoc11-statistics/stats-server/app/views/categories/index.html.erb</a></li>
<li><a href="#branchesgsoc11statisticsstatsserverappviewshomeindexhtmlerb">branches/gsoc11-statistics/stats-server/app/views/home/index.html.erb</a></li>
<li><a href="#branchesgsoc11statisticsstatsserverappviewsinstalled_portsindexhtmlerb">branches/gsoc11-statistics/stats-server/app/views/installed_ports/index.html.erb</a></li>
<li><a href="#branchesgsoc11statisticsstatsserverappviewslayoutsapplicationhtmlerb">branches/gsoc11-statistics/stats-server/app/views/layouts/application.html.erb</a></li>
<li><a href="#branchesgsoc11statisticsstatsserverappviewsos_statisticsindexhtmlerb">branches/gsoc11-statistics/stats-server/app/views/os_statistics/index.html.erb</a></li>
<li><a href="#branchesgsoc11statisticsstatsserverappviewspartials_chart_drawhtmlerb">branches/gsoc11-statistics/stats-server/app/views/partials/_chart_draw.html.erb</a></li>
<li><a href="#branchesgsoc11statisticsstatsserverappviewspartials_port_searchhtmlerb">branches/gsoc11-statistics/stats-server/app/views/partials/_port_search.html.erb</a></li>
<li><a href="#branchesgsoc11statisticsstatsserverappviewsportsindexhtmlerb">branches/gsoc11-statistics/stats-server/app/views/ports/index.html.erb</a></li>
<li><a href="#branchesgsoc11statisticsstatsserverappviewsportsshowhtmlerb">branches/gsoc11-statistics/stats-server/app/views/ports/show.html.erb</a></li>
<li><a href="#branchesgsoc11statisticsstatsserverpublicstylesheetsscaffoldcss">branches/gsoc11-statistics/stats-server/public/stylesheets/scaffold.css</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchesgsoc11statisticsstatsserverappviewscategoriesindexhtmlerb"></a>
<div class="modfile"><h4>Modified: branches/gsoc11-statistics/stats-server/app/views/categories/index.html.erb (116824 => 116825)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc11-statistics/stats-server/app/views/categories/index.html.erb        2014-02-07 23:55:45 UTC (rev 116824)
+++ branches/gsoc11-statistics/stats-server/app/views/categories/index.html.erb        2014-02-08 01:57:57 UTC (rev 116825)
</span><span class="lines">@@ -1,19 +1,14 @@
</span><del>-<div id="content">
</del><ins>+<%= render :partial => '/partials/port_search' %>
</ins><span class="cx">
</span><del>- <%= render :partial => '/partials/port_search' %>
-
- <h3>Port Categories</h3>
-
- <div id="categories">
-
- <% unless @categories.empty? %>
- <ul>
- <% @categories.each do |category| %>
- <li><%= link_to category.name, category_ports_path(category.id) %></li>
- <% end %>
- </ul>
- <% else %>
- <p>No Categories found.</p>
- <% end %>
- </div>
-</div>
</del><span class="cx">\ No newline at end of file
</span><ins>+<h2>Port Categories</h2>
+<div id="categories">
+        <% unless @categories.empty? %>
+                <ul>
+                        <% @categories.each do |category| %>
+                                <li><%= link_to category.name, category_ports_path(category.id) %></li>
+                        <% end %>
+                </ul>
+        <% else %>
+                <p>No categories found.</p>
+        <% end %>
+</div>
</ins></span></pre></div>
<a id="branchesgsoc11statisticsstatsserverappviewshomeindexhtmlerb"></a>
<div class="modfile"><h4>Modified: branches/gsoc11-statistics/stats-server/app/views/home/index.html.erb (116824 => 116825)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc11-statistics/stats-server/app/views/home/index.html.erb        2014-02-07 23:55:45 UTC (rev 116824)
+++ branches/gsoc11-statistics/stats-server/app/views/home/index.html.erb        2014-02-08 01:57:57 UTC (rev 116825)
</span><span class="lines">@@ -1,25 +1,11 @@
</span><del>-<% controller.set_chart_title :participating_users, 'Number of Participating Users' %>
-<% controller.set_chart_type :participating_users, "LineChart" %>
-<h1>MacPorts Statistics</h1>
-
-<ul>
-        <li> <%= link_to "User System Information", os_statistics_path %> </li>
-        <li> <%= link_to "User Installed Ports", installed_ports_path %> </li>
-</ul>
-
-Total number of participating users: <%= User.count %> <br />
-Number of users last month (<%= @last_month %>): <%= @users_last_month %> <br />
-
-
</del><span class="cx"> <%= render :partial => '/partials/port_search' %>
</span><del>-<%= link_to "Browse By Category", categories_path %> </li>
</del><span class="cx">
</span><del>-<br />
</del><ins>+<div id="metastatistics">
+        <h2>Participating Users</h2>
</ins><span class="cx">
</span><del>-<%# Draw charts - no tables %>
-<%= render :partial => '/partials/chart_draw',
- :locals => {:charts => [:participating_users], :drawtables => false}
-%>
-
-
-
</del><ins>+        <p>Our statistics know about <strong><%= User.count %></strong> users in total. Last month (<%= @last_month %>), <strong><%= @users_last_month %></strong> users have submitted statistics.</p>
+        
+        <% controller.set_chart_title :participating_users, 'Participating Users' %>
+        <% controller.set_chart_type :participating_users, "LineChart" %>
+        <%= render :partial => '/partials/chart_draw', :locals => {:charts => [:participating_users], :drawtables => false, :headers => false} %>
+</div>
</ins></span></pre></div>
<a id="branchesgsoc11statisticsstatsserverappviewsinstalled_portsindexhtmlerb"></a>
<div class="modfile"><h4>Modified: branches/gsoc11-statistics/stats-server/app/views/installed_ports/index.html.erb (116824 => 116825)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc11-statistics/stats-server/app/views/installed_ports/index.html.erb        2014-02-07 23:55:45 UTC (rev 116824)
+++ branches/gsoc11-statistics/stats-server/app/views/installed_ports/index.html.erb        2014-02-08 01:57:57 UTC (rev 116825)
</span><span class="lines">@@ -1,33 +1,22 @@
</span><del>-<% controller.set_chart_title :top25, 'Most popular ports this month' %>
-<% controller.set_chart_type :top25, "BarChart" %>
</del><ins>+<h2>Port Statistics</h2>
+<p>The statistics server currently knows about <%= Port.count %> ports. On average, each participating user has <strong><%= @average_ports %></strong> of them installed.</p>
</ins><span class="cx">
</span><del>-<h1>Port Statistics</h1>
-
-Participating users: <%= User.count %> <br />
-Number of ports: <%= Port.count %> <br />
-Average number of ports installed per user: <%= @average_ports %><br />
-
-<br />
</del><ins>+<% unless @popular_port_month.nil? && @popular_port_year.nil? %>
+<h3>Popular Ports</h3>
+<% end %>
</ins><span class="cx"> <%# Most popular port this month %>
</span><span class="cx"> <% unless @popular_port_month.nil? %>
</span><del>- <% port = @popular_port_month %>
- Most popular port this month (<%= @month %>) is <%= link_to port.name, category_port_path(port.category, port) %>
- with <%= @popular_port_month_count %> installs. <br />
</del><ins>+        <% port = @popular_port_month %>
+        <p>Most popular port this month (<%= @month %>) is <strong><%= link_to port.name, category_port_path(port.category, port) %></strong> with <strong><%= @popular_port_month_count %></strong> installs.</p>
</ins><span class="cx"> <% end %>
</span><span class="cx">
</span><span class="cx"> <%# Most popular port this year %>
</span><span class="cx"> <% unless @popular_port_year.nil? %>
</span><del>- <% port = @popular_port_year %>
- Most popular port this year (<%= @year %>) is <%= link_to port.name, category_port_path(port.category, port) %>
- with <%= @popular_port_year_count %> installs. <br />
</del><ins>+        <% port = @popular_port_year %>
+        <p>Most popular port this year (<%= @year %>) is <strong><%= link_to port.name, category_port_path(port.category, port) %></strong> with <strong><%= @popular_port_year_count %></strong> installs.</p>
</ins><span class="cx"> <% end %>
</span><span class="cx">
</span><del>-<br />
-
</del><span class="cx"> <%# Draw chart %>
</span><del>-<%= render :partial => '/partials/chart_draw',
- :locals => {:charts => [:top25],
- :chart_width => 1000,
- :chart_height => 1000}
-%>
-
</del><ins>+<% controller.set_chart_title :top25, '25 top ports this month' %>
+<% controller.set_chart_type :top25, "BarChart" %>
+<%= render :partial => '/partials/chart_draw', :locals => {:charts => [:top25], :chart_height => 850, :headers => true} %>
</ins></span></pre></div>
<a id="branchesgsoc11statisticsstatsserverappviewslayoutsapplicationhtmlerb"></a>
<div class="modfile"><h4>Modified: branches/gsoc11-statistics/stats-server/app/views/layouts/application.html.erb (116824 => 116825)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc11-statistics/stats-server/app/views/layouts/application.html.erb        2014-02-07 23:55:45 UTC (rev 116824)
+++ branches/gsoc11-statistics/stats-server/app/views/layouts/application.html.erb        2014-02-08 01:57:57 UTC (rev 116825)
</span><span class="lines">@@ -9,6 +9,40 @@
</span><span class="cx">                 <%= render_visualizations %>
</span><span class="cx">         </head>
</span><span class="cx">         <body>
</span><del>-                <%= yield %>
</del><ins>+                <h1>
+                        <a href="//www.macports.org/" title="The MacPorts Project" class="title">
+                                <span class="accessibility">The MacPorts Project</span>
+                        </a>
+                        <a href="/" title="MacPorts Project Statistics" class="subtitle">Statistics</a>
+                </h1>
+                <p class="accessibility">
+                        <a href="#content">Skip to Content</a>
+                </p>
+                <div id="header">
+                </div>
+                <div id="navigation">
+                        <dl>
+                                <dt>Statistics</dt>
+                                <dd>
+                                        <ul>
+                                                <li><%= link_to "Home", root_path %></li>
+                                                <li><%= link_to "System", os_statistics_path %></li>
+                                                <li><%= link_to "Installed Ports", installed_ports_path %></li>
+                                        </ul>
+                                </dd>
+                                <dt>Browse Ports</dt>
+                                <dd>
+                                        <ul>
+                                                <li><%= link_to "By Category", categories_path %></li>
+                                                <li><%= link_to "Complete List", ports_path %></li>
+                                        </ul>
+                                </dd>
+                        </dl>
+                </div>
+                <div id="content">
+                        <%= yield %>
+                </div>
+                <div id="footer">
+                </div>
</ins><span class="cx">         </body>
</span><span class="cx"> </html>
</span></span></pre></div>
<a id="branchesgsoc11statisticsstatsserverappviewsos_statisticsindexhtmlerb"></a>
<div class="modfile"><h4>Modified: branches/gsoc11-statistics/stats-server/app/views/os_statistics/index.html.erb (116824 => 116825)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc11-statistics/stats-server/app/views/os_statistics/index.html.erb        2014-02-07 23:55:45 UTC (rev 116824)
+++ branches/gsoc11-statistics/stats-server/app/views/os_statistics/index.html.erb        2014-02-08 01:57:57 UTC (rev 116825)
</span><span class="lines">@@ -9,11 +9,9 @@
</span><span class="cx">
</span><span class="cx"> <%# All these charts are pie charts - set :type to PieChart %>
</span><span class="cx"> <% @charts.each do |chart_name, chartdata| %>
</span><del>- <% controller.set_chart_type chart_name, "PieChart" %>
</del><ins>+        <% controller.set_chart_type chart_name, "PieChart" %>
</ins><span class="cx"> <% end %>
</span><span class="cx">
</span><del>-<br />
-
</del><span class="cx"> <%# Order the charts %>
</span><span class="cx"> <% ordered_charts = [:macports_version,
</span><span class="cx"> :osx_version,
</span><span class="lines">@@ -23,16 +21,13 @@
</span><span class="cx"> :gcc_version,
</span><span class="cx"> :xcode_version] %>
</span><span class="cx">
</span><del>-<h1> Operating System Statistics </h1>
-
</del><ins>+<h2>System Statistics</h2>
</ins><span class="cx"> <%# Generate links %>
</span><del>-<ul>
-<% ordered_charts.each do |chart| %>
-<li> <%= link_to controller.chart_title(chart), :anchor => chart %> </li>
-<% end %>
-</ul>
</del><ins>+        <ul>
+                <% ordered_charts.each do |chart| %>
+                        <li><%= link_to controller.chart_title(chart), :anchor => chart %></li>
+                <% end %>
+        </ul>
</ins><span class="cx">
</span><del>-<br />
-
</del><span class="cx"> <%# Draw charts %>
</span><del>-<%= render :partial => '/partials/chart_draw', :locals => {:charts => ordered_charts} %>
</del><ins>+<%= render :partial => '/partials/chart_draw', :locals => {:charts => ordered_charts, :headers => true} %>
</ins></span></pre></div>
<a id="branchesgsoc11statisticsstatsserverappviewspartials_chart_drawhtmlerb"></a>
<div class="modfile"><h4>Modified: branches/gsoc11-statistics/stats-server/app/views/partials/_chart_draw.html.erb (116824 => 116825)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc11-statistics/stats-server/app/views/partials/_chart_draw.html.erb        2014-02-07 23:55:45 UTC (rev 116824)
+++ branches/gsoc11-statistics/stats-server/app/views/partials/_chart_draw.html.erb        2014-02-08 01:57:57 UTC (rev 116825)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> <%# Set Defaults %>
</span><span class="cx"> <% drawtables_default = true %>
</span><del>-<% chart_width_default = 600 %>
</del><ins>+<% headers_default = true %>
+<% chart_width_default = 700 %>
</ins><span class="cx"> <% chart_height_default = 400 %>
</span><span class="cx">
</span><span class="cx"> <%# Check if locals have been passed to this partial %>
</span><span class="lines">@@ -8,67 +9,65 @@
</span><span class="cx">
</span><span class="cx"> <%# Avoid nil objects %>
</span><span class="cx"> <% if (defined? charts).nil? %>
</span><del>- <% charts = Hash.new %>
</del><ins>+        <% charts = Hash.new %>
</ins><span class="cx"> <% end %>
</span><span class="cx">
</span><span class="cx"> <%# Draw tables as well as visualizations? %>
</span><span class="cx"> <% if (defined? drawtables).nil? %>
</span><del>- <% drawtables = drawtables_default %>
</del><ins>+        <% drawtables = drawtables_default %>
</ins><span class="cx"> <% end %>
</span><span class="cx">
</span><ins>+<%# Write headers? %>
+<% if (defined? headers).nil? %>
+        <% headers = headers_default %>
+<% end %>
+
</ins><span class="cx"> <%# Get chart width %>
</span><span class="cx"> <% if (defined? chart_width).nil? %>
</span><del>- <% chart_width = chart_width_default %>
</del><ins>+        <% chart_width = chart_width_default %>
</ins><span class="cx"> <% end %>
</span><span class="cx">
</span><span class="cx"> <%# Get chart height %>
</span><span class="cx"> <% if (defined? chart_height).nil? %>
</span><del>- <% chart_height = chart_height_default %>
</del><ins>+        <% chart_height = chart_height_default %>
</ins><span class="cx"> <% end %>
</span><span class="cx">
</span><span class="cx"> <%# Set visualization options %>
</span><del>-<% vis_options = {:width => chart_width,
- :height => chart_height,
- :html => {:class => "graph_chart"}}
-%>
-
</del><ins>+<% vis_options = {:width => chart_width, :height => chart_height, :backgroundColor => '#ededed', :fontName => 'Helvetica', :html => {:class => "graph_chart"}} %>
</ins><span class="cx"> <%# Set table options %>
</span><del>-<% tbl_options = {:width => 600,
- :html => {:class => "graph_chart"}}
-%>
</del><ins>+<% tbl_options = {:width => 700, :html => {:class => "graph_chart"}} %>
</ins><span class="cx">
</span><del>-
</del><span class="cx"> <%# Draw charts %>
</span><span class="cx"> <% charts.each do |chart| %>
</span><del>- <% title = controller.chart_title chart %>
- <% type = controller.chart_type chart %>
</del><ins>+        <% title = controller.chart_title chart %>
+        <% type = controller.chart_type chart %>
</ins><span class="cx">
</span><del>- <%# Set titles %>
- <!-- Chart title: <%= title %> -->
- <% local_vis_options = vis_options.merge({ :title => title }) %>
- <% local_tbl_options = tbl_options.merge({ :title => title }) %>
</del><ins>+        <%# Set titles %>
+        <!-- Chart title: <%= title %> -->
+        <% local_vis_options = vis_options.merge({ :title => title }) %>
+        <% local_tbl_options = tbl_options.merge({ :title => title }) %>
</ins><span class="cx">
</span><del>- <%# Anchor %>
- <a name=<%= chart %>> </a>
- <%# Title %>
- <h2> <%= title %> </h2>
-
</del><ins>+        <%# Anchor %>
+        <a name=<%= chart %>> </a>
+        <%# Title %>
+        <% if headers %>
+                <h3><%= title %></h3>
+        <% end %>
</ins><span class="cx">
</span><del>- <% if not controller.dataset_empty? chart %>
- <%# Draw visualization %>
- <% visualization chart.to_s, type, local_vis_options do |viz| %>
- <% controller.populate_chart chart, viz %>
- <% end %>
-
- <% if drawtables %>
- <%# Draw table %>
- <% table = chart.to_s + "_table" %>
- <% visualization table, "Table", local_tbl_options do |viz| %>
- <% controller.populate_chart chart, viz %>
- <% end %>
- <% end %>
-
- <% else %>
- No data to display
- <% end %>
</del><ins>+        <% if not controller.dataset_empty? chart %>
+                <%# Draw visualization %>
+                <% visualization chart.to_s, type, local_vis_options do |viz| %>
+                        <% controller.populate_chart chart, viz %>
+                <% end %>
+
+                <% if drawtables %>
+                        <%# Draw table %>
+                        <% table = chart.to_s + "_table" %>
+                        <% visualization table, "Table", local_tbl_options do |viz| %>
+                                <% controller.populate_chart chart, viz %>
+                        <% end %>
+                <% end %>
+        <% else %>
+                <p class="no-data">No data to display.</p>
+        <% end %>
</ins><span class="cx"> <% end %>
</span></span></pre></div>
<a id="branchesgsoc11statisticsstatsserverappviewspartials_port_searchhtmlerb"></a>
<div class="modfile"><h4>Modified: branches/gsoc11-statistics/stats-server/app/views/partials/_port_search.html.erb (116824 => 116825)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc11-statistics/stats-server/app/views/partials/_port_search.html.erb        2014-02-07 23:55:45 UTC (rev 116824)
+++ branches/gsoc11-statistics/stats-server/app/views/partials/_port_search.html.erb        2014-02-08 01:57:57 UTC (rev 116825)
</span><span class="lines">@@ -1,16 +1,11 @@
</span><del>-<h2 class="hdr">MacPorts Portfiles</h2>
-
-
-
-<br />
-
-<p>
- <%= form_tag(search_generate_path, {:method => :get}) do %>
- <%= select_tag :criteria, options_for_select({"Software Title" => "name", "Category" => "categories", "Maintainer" => "maintainers", "variant" => "variants", "Platform" => "platforms"}) %>
- <%= text_field_tag :val, "", {:size => 40} %>
- <%= submit_tag "Search" %>
- <% end %>
-</p>
-
-<p>Or view the complete <%= link_to "ports list (#{Port.count} ports)", ports_path %>.</p>
-<br />
</del><span class="cx">\ No newline at end of file
</span><ins>+<div class="port-search">
+        <h2>Search for Port Statistics</h2>
+        <p>
+                <%= form_tag(search_generate_path, {:method => :get}) do %>
+                        <%= select_tag :criteria, options_for_select({"Software Title" => "name", "Category" => "categories", "Maintainer" => "maintainers", "variant" => "variants", "Platform" => "platforms"}) %>
+                        <%= text_field_tag :val, "", {:size => 40} %>
+                        <%= submit_tag "Search" %>
+                <% end %>
+        </p>
+        <p>Or view the complete <%= link_to "port list (#{Port.count} ports)", ports_path %>. You can also <%= link_to "browse by category", categories_path %>.</p>
+</div>
</ins></span></pre></div>
<a id="branchesgsoc11statisticsstatsserverappviewsportsindexhtmlerb"></a>
<div class="modfile"><h4>Modified: branches/gsoc11-statistics/stats-server/app/views/ports/index.html.erb (116824 => 116825)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc11-statistics/stats-server/app/views/ports/index.html.erb        2014-02-07 23:55:45 UTC (rev 116824)
+++ branches/gsoc11-statistics/stats-server/app/views/ports/index.html.erb        2014-02-08 01:57:57 UTC (rev 116825)
</span><span class="lines">@@ -1,47 +1,33 @@
</span><del>-<div id="content">
- <%= render :partial => '/partials/port_search' %>
</del><ins>+<%= render :partial => '/partials/port_search' %>
</ins><span class="cx">
</span><del>- <h3>Query Results</h3>
-
</del><ins>+<h2>Query Results</h2>
</ins><span class="cx"> <% unless @ports.empty? %>
</span><del>- <p>
- <%= ((@page.to_i - 1) * 50) + 1 %> - <%= @page.to_i * 50 %> of <%= Port.count %> Portfiles Selected
- </p>
- <p>
- <%= will_paginate @ports %>
- </p>
</del><ins>+        <p><strong><%= ((@page.to_i - 1) * 50) + 1 %></strong> - <strong><%= @page.to_i * 50 %></strong> of <%= Port.count %> Portfiles selected</p>
+        <p><%= will_paginate @ports %></p>
</ins><span class="cx">
</span><del>- <% @ports.each do |port| %>
- <dl>
- <dt><b><%= link_to port.name, category_port_path(port.category, port) %></b> <%= port.version %></dt>
- <dd>
- <% unless port.description.nil? %>
- <%= port.description %><br />
- <% end %>
-
- <% unless port.maintainers.nil? %>
- <i>Maintained by:</i> <b><span class="email"><%= port.maintainers %></span></b><br>
- <% end %>
-
- <% unless port.categories.nil? %>
- <i>Categories:</i> <%= print_search_links(port, "categories") %><br />
- <% end %>
-
- <% unless port.platforms.nil? %>
- <i>Platforms:</i> <%= print_search_links(port, "platforms") %><br />
- <% end %>
-
- <% unless port.variants.nil? %>
- <i>Variants:</i> <%= print_search_links(port, "variants") %>
- <% end %>
- </dd>
- </dl>
- <% end %>
</del><ins>+        <% @ports.each do |port| %>
+                <dl>
+                        <dt><strong><%= link_to port.name, category_port_path(port.category, port) %></strong> <%= port.version %></dt>
+                        <dd>
+                                <% unless port.description.nil? %>
+                                        <p><%= port.description %></p>
+                                <% end %>
+                                <% unless port.maintainers.nil? %>
+                                        <i>Maintained by:</i> <span class="email"><%= port.maintainers %></span><br />
+                                <% end %>
+                                <% unless port.categories.nil? %>
+                                        <i>Categories:</i> <%= print_search_links(port, "categories") %><br />
+                                <% end %>
+                                <% unless port.platforms.nil? %>
+                                        <i>Platforms:</i> <%= print_search_links(port, "platforms") %><br />
+                                <% end %>
+                                <% unless port.variants.nil? %>
+                                        <i>Variants:</i> <%= print_search_links(port, "variants") %>
+                                <% end %>
+                        </dd>
+                </dl>
+        <% end %>
+        <p><%= will_paginate @ports %></p>
</ins><span class="cx"> <% else %>
</span><del>- <p>No ports found.</p>
</del><ins>+        <p class="no-data">No ports matched your query.</p>
</ins><span class="cx"> <% end %>
</span><del>-
- <p>
- <%= will_paginate @ports %>
- </p>
-</div>
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="branchesgsoc11statisticsstatsserverappviewsportsshowhtmlerb"></a>
<div class="modfile"><h4>Modified: branches/gsoc11-statistics/stats-server/app/views/ports/show.html.erb (116824 => 116825)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc11-statistics/stats-server/app/views/ports/show.html.erb        2014-02-07 23:55:45 UTC (rev 116824)
+++ branches/gsoc11-statistics/stats-server/app/views/ports/show.html.erb        2014-02-08 01:57:57 UTC (rev 116825)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> <% controller.set_chart_title :variant_count, 'All Variants' %>
</span><span class="cx"> <% controller.set_chart_type :variant_count, 'PieChart' %>
</span><span class="cx">
</span><del>-<% controller.set_chart_title :versions_over_time, 'Top Versions in use Over Last 12 Months' %>
</del><ins>+<% controller.set_chart_title :versions_over_time, 'Top Versions Over Last 12 Months' %>
</ins><span class="cx"> <% controller.set_chart_type :versions_over_time, 'LineChart' %>
</span><span class="cx">
</span><span class="cx"> <% controller.set_chart_title :installs_over_time, 'Installations Over Last 12 Months' %>
</span><span class="lines">@@ -16,75 +16,36 @@
</span><span class="cx"> :version_count,
</span><span class="cx"> :variant_count] %>
</span><span class="cx">
</span><del>-<h1> <%= @port.name %> </h1>
</del><ins>+<h2><%= @port.name %> Metadata</h2>
+<dl>
+        <dt>Current Version</dt>
+        <dd><%= @port.version %></dd>
+        <% unless @port.description.nil? %>
+                <dt>Description</dt>
+                <dd><%= @port.description %></dd>
+        <% end %>
+        <% unless @port.licenses.nil? %>
+                <dt>Licenses</dt>
+                <dd><%= @port.licenses %></dd>
+        <% end %>
+        <% unless @port.categories.nil? %>
+                <dt>Categories</dt>
+                <dd><%= @port.categories %></dd>
+        <% end %>
+        <% unless @port.variants.nil? %>
+                <dt>Variants</dt>
+                <dd><%= @port.variants %></dd>
+        <% end %>
+</dl>
</ins><span class="cx">
</span><del>-<br />
</del><ins>+<h2><%= @port.name %> Statistics</h2>
+<%# Generate links %>
+<ul>
+        <% ordered_charts.each do |chart| %>
+                <li><%= link_to controller.chart_title(chart), :anchor => chart %></li>
+        <% end %>
+</ul>
</ins><span class="cx">
</span><del>-<div id="content">
- <p>
- <strong>Current Version:</strong> <%= @port.version %>
- </p>
</del><ins>+<%# Draw charts %>
</ins><span class="cx">
</span><del>- <% unless @port.description.nil? %>
- <p>
- <strong>Description:</strong> <%= @port.description %>
- </p>
- <% end %>
-
- <% unless @port.licenses.nil? %>
- <p>
- <strong>Licenses:</strong> <%= @port.licenses %>
- </p>
- <% end %>
-
- <p>
- <strong>Categories</strong>
- <%=h @port.categories %>
- </p>
-
- <% unless @port.variants.nil? %>
- <p>
- <strong>Variants:</strong> <%=h @port.variants %>
- </p>
- <% end %>
-
- </div>
-
- <br />
-
- <h2> Stats </h2>
-
- <%# Generate links %>
- <ul>
- <% ordered_charts.each do |chart| %>
- <li> <%= link_to controller.chart_title(chart), :anchor => chart %> </li>
- <% end %>
- </ul>
-
- <br />
-
- <%# Draw charts %>
-
- <%= render :partial => '/partials/chart_draw', :locals => {:charts => ordered_charts} %>
-
- <table border=1>
- <tr>
- <th> ID </th>
- <th> port_id </th>
- <th> version </th>
- <th> variants </th>
- <th> modified_date </th>
- </tr>
-
- <% @installed.each do |row| %>
- <tr>
- <td> <%= row.id %> </td>
- <td> <%= row.port_id %> </td>
- <td> <%= row.version %></td>
- <td> <%= row.variants %> </td>
- <td> <%= row.updated_at %> </td>
- </tr>
- <% end %>
- </table>
-
-</div>
</del><ins>+<%= render :partial => '/partials/chart_draw', :locals => {:charts => ordered_charts, :headers => true} %>
</ins></span></pre></div>
<a id="branchesgsoc11statisticsstatsserverpublicstylesheetsscaffoldcss"></a>
<div class="modfile"><h4>Modified: branches/gsoc11-statistics/stats-server/public/stylesheets/scaffold.css (116824 => 116825)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc11-statistics/stats-server/public/stylesheets/scaffold.css        2014-02-07 23:55:45 UTC (rev 116824)
+++ branches/gsoc11-statistics/stats-server/public/stylesheets/scaffold.css        2014-02-08 01:57:57 UTC (rev 116825)
</span><span class="lines">@@ -1,56 +1,196 @@
</span><del>-body { background-color: #fff; color: #333; }
</del><ins>+body {
+        margin: 0;
+        padding: 30px 40px;
</ins><span class="cx">
</span><del>-body, p, ol, ul, td {
- font-family: verdana, arial, helvetica, sans-serif;
- font-size: 13px;
- line-height: 18px;
</del><ins>+        background: url("//macports.org/img/top-backdrop.png") repeat-x #ededed;
+        color: #000;
+
+        font: 12px/1.2em Helvetica, Arial, sans-serif;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-pre {
- background-color: #eee;
- padding: 10px;
- font-size: 11px;
</del><ins>+.accessibility {
+        margin: 0;
+        display: block;
+        overflow: hidden;
+        width: 0;
+        height: 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-a { color: #000; }
-a:visited { color: #666; }
-a:hover { color: #fff; background-color:#000; }
</del><ins>+a:link {
+        color: #0155CD;
+        text-decoration: underline;
+}
</ins><span class="cx">
</span><del>-div.field, div.actions {
- margin-bottom: 10px;
</del><ins>+a:visited {
+        color: #012567;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-#notice {
- color: green;
</del><ins>+a:hover {
+        color: #3591ED;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.field_with_errors {
- padding: 2px;
- background-color: red;
- display: table;
</del><ins>+h1, h2, h3 {
+        margin: 0;
+        color: white;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-#error_explanation {
- width: 450px;
- border: 2px solid red;
- padding: 7px;
- padding-bottom: 0;
- margin-bottom: 20px;
- background-color: #f0f0f0;
</del><ins>+h1 {
+        float: left;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-#error_explanation h2 {
- text-align: left;
- font-weight: bold;
- padding: 5px 5px 5px 15px;
- font-size: 12px;
- margin: -7px;
- margin-bottom: 0px;
- background-color: #c00;
- color: #fff;
</del><ins>+h1 a.title {
+        display: block;
+        float: left;
+        width: 183px;
+        height: 70px;
+        background: url("//macports.org/img/macports-logo-top.png");
+        background-size: 183px 73px;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-#error_explanation ul li {
- font-size: 12px;
- list-style: square;
</del><ins>+h1 a.subtitle {
+        float: left;
+        font-size: 32px;
+        padding-top: 18px;
+        color: #0155cd;
+        text-decoration: none;
</ins><span class="cx"> }
</span><ins>+
+h2, h3 {
+        background: #8695B3;
+        padding: 0.2em;
+}
+
+h2 {
+        font: bold 24px "Lucida Grande", Helvetica, Arial, sans-serif;
+}
+
+#header {
+        height: 51px;
+        margin: 21px 0 17px 191px;
+        min-width: 250px;
+        max-width: 700px;
+}
+
+#header div, #header span {
+        float: right;
+}
+
+#navigation {
+        width: 183px;
+        float: left;
+        clear: left;
+        background: url("//macports.org/img/nav-header.png") top no-repeat #B1BACC;
+        line-height: 1.4em;
+}
+
+#navigation dl {
+        padding: 16px 0;
+        margin: 0;
+        background: url("//macports.org/img/nav-footer.png") bottom no-repeat;
+}
+
+#navigation dt {
+        margin: 0;
+        padding: 0 16px;
+        color: white;
+        font: bold 125% "Lucida Grande", Helvetica, Arial, sans-serif;
+}
+
+#navigation dd {
+        margin: 0;
+        padding: 0;
+}
+
+#navigation ul {
+        margin: 0 0 1em 0;
+        padding: 0;
+}
+
+#navigation li {
+        display: block;
+        margin-bottom: 1px;
+        padding: 0 16px 0 28px;
+}
+
+#navigation a {
+        text-decoration: none;
+        color: #242933;
+}
+
+#navigation a:hover {
+        text-decoration: underline;
+}
+
+.selected {
+        background: #8898ab;
+        font-weight: bold;
+}
+
+.warnings {
+        background: #FCC;
+        border: 2px solid #F66;
+        padding: 6px;
+        margin: 7px 7px 7px 198px;
+        min-width: 320px;
+        max-width: 670px;
+}
+
+.warnings p {
+        margin: 1em 0 0 0;
+        font-size: 1.2em;
+        font-weight: bold;
+}
+
+.warnings p:first-child {
+        margin: 0;
+}
+
+#content {
+        padding: 1px 0 40px 191px;
+        min-width: 350px;
+        max-width: 700px;
+}
+
+#content li {
+        margin-bottom: 0.7em;
+}
+
+#content li p {
+        margin: 0.6em 0 1.4em 0;
+        padding-left: 1.6em;
+}
+
+#content li ul {
+        margin-top: 0.7em;
+}
+
+
+#footer {
+        font-size: 90%;
+        clear: both;
+        text-align: center;
+}
+
+#footer img {
+        border: 0;
+        height: 31px;
+        width: 88px;
+}
+
+.graph_chart {
+        margin-bottom: 20px;
+}
+
+#content dl dt {
+        font-weight: bold;
+}
+
+#content .no-data {
+        margin: 10px auto;
+        text-align: center;
+        color: #8898ab;
+}
+
+.port-search form, .port-search p {
+        text-align: center;
+}
</ins></span></pre>
</div>
</div>
</body>
</html>