add table/graph nav pills
authorTom Clegg <tom@clinicalfuture.com>
Fri, 1 Feb 2013 07:13:08 +0000 (23:13 -0800)
committerTom Clegg <tom@clinicalfuture.com>
Fri, 1 Feb 2013 07:13:08 +0000 (23:13 -0800)
app/views/collections/_nav.html.erb [new file with mode: 0644]
app/views/collections/graph.html.erb
app/views/collections/index.html.erb
app/views/layouts/application.html.erb

diff --git a/app/views/collections/_nav.html.erb b/app/views/collections/_nav.html.erb
new file mode 100644 (file)
index 0000000..5d57083
--- /dev/null
@@ -0,0 +1,6 @@
+<ul class="nav nav-pills">
+  <% [['Table', collections_path],
+     ['Graph', collections_graph_path]].each do |name, path| %>
+  <li class="<%= 'active' if request.fullpath == path %>"><%= link_to name, path %></li>
+  <% end %>
+</ul>
index 87f07eae1840ace6cf91e5c8e71712325332ae96..c6a256532bbabee0fd8ba473b2e2fe4905d3acb8 100644 (file)
@@ -1,3 +1,13 @@
+<%= render :partial => 'nav' %>
+<table class="table table-bordered">
+  <tbody>
+    <tr>
+      <td class="d3">
+      </td>
+    </tr>
+  </tbody>
+</table>
+
 <% content_for :head do %>
 <%= javascript_include_tag '/d3.v3.min.js' %>
 
@@ -92,7 +102,7 @@ jQuery(function($){
        .on("tick", tick)
        .start();
 
-    var svg = d3.select("body").append("svg:svg")
+    var svg = d3.select("td.d3").append("svg:svg")
        .attr("width", w)
        .attr("height", h);
 
index 13a0eb1a3ba869b5be3df612f294d498c53a6315..cb5db8a9e0de5f521106fc457eae169c47609d02 100644 (file)
@@ -13,7 +13,9 @@
 </style>
 <% end %>
 
-<table class="topalign">
+<%= render :partial => 'nav' %>
+
+<table class="topalign table table-bordered table-striped">
   <thead>
     <tr class="contain-align-left">
       <th>
index 92f8e3ee2d6722320b75ad9927d6375e455fbe6e..0eab6760c703ac673068f27e851245297346e9c3 100644 (file)
@@ -2,7 +2,7 @@
 <html>
 <head>
   <meta charset="utf-8">
-  <title>Vcffarm</title>
+  <title><%= Rails.configuration.site_name rescue Rails.application.class.parent_name %></title>
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta name="description" content="">
   <meta name="author" content="">
@@ -33,8 +33,8 @@
         <div class="nav-collapse collapse">
           <ul class="nav">
            <% [
-              [true, 'FactoryJobs', '/factory_jobs'],
-              [true, 'Data', '/collections/graph'],
+              [true, 'FactoryJobs', factory_jobs_path],
+              [true, 'Data', collections_path],
               [false, 'Log out', logout_path]
               ].each do |admin_only, name, path| %>
            <% if !admin_only or (current_user and current_user.is_admin) %>