Commit ffd510c

mo khan <mo@mokhan.ca>
2015-02-04 04:51:27
add foundation classes and nav.
1 parent 2e60695
app/views/agents/edit.html.erb
@@ -1,6 +1,10 @@
-<h1>Editing Agent</h1>
+<div class="row">
+  <div class="small-12 columns">
+    <h1>Editing Agent</h1>
 
-<%= render 'form' %>
+    <%= render 'form' %>
 
-<%= link_to 'Show', @agent %> |
-<%= link_to 'Back', agents_path %>
+    <%= link_to 'Show', @agent %> |
+    <%= link_to 'Back', agents_path %>
+  </div>
+</div>
app/views/agents/index.html.erb
@@ -1,28 +1,28 @@
-<p id="notice"><%= notice %></p>
+<div class="row">
+  <div class="small-12 columns">
+    <p id="notice"><%= notice %></p>
 
-<h1>Listing Agents</h1>
+    <h1>Listing Agents</h1>
+    <%= link_to 'New Agent', new_agent_path, class: 'button' %>
 
-<table>
-  <thead>
-    <tr>
-      <th>Hostname</th>
-      <th colspan="4"></th>
-    </tr>
-  </thead>
-
-  <tbody>
-    <% @agents.each do |agent| %>
-      <tr>
-        <td><%= agent.hostname %></td>
-        <td><%= link_to 'Events', agent_events_path(agent) %></td>
-        <td><%= link_to 'Show', agent %></td>
-        <td><%= link_to 'Edit', edit_agent_path(agent) %></td>
-        <td><%= link_to 'Destroy', agent, method: :delete, data: { confirm: 'Are you sure?' } %></td>
-      </tr>
-    <% end %>
-  </tbody>
-</table>
-
-<br>
-
-<%= link_to 'New Agent', new_agent_path %>
+    <table>
+      <thead>
+        <tr>
+          <th>Hostname</th>
+          <th colspan="4"></th>
+        </tr>
+      </thead>
+      <tbody>
+        <% @agents.each do |agent| %>
+          <tr>
+            <td><%= agent.hostname %></td>
+            <td><%= link_to 'Events', agent_events_path(agent) %></td>
+            <td><%= link_to 'Show', agent %></td>
+            <td><%= link_to 'Edit', edit_agent_path(agent) %></td>
+            <td><%= link_to 'Destroy', agent, method: :delete, data: { confirm: 'Are you sure?' } %></td>
+          </tr>
+        <% end %>
+      </tbody>
+    </table>
+  </div>
+</div>
app/views/agents/new.html.erb
@@ -1,5 +1,9 @@
-<h1>New Agent</h1>
+<div class="row">
+  <div class="small-12 columns">
+    <h1>New Agent</h1>
 
-<%= render 'form' %>
+    <%= render 'form' %>
 
-<%= link_to 'Back', agents_path %>
+    <%= link_to 'Back', agents_path %>
+  </div>
+</div>
app/views/agents/show.html.erb
@@ -1,9 +1,14 @@
-<p id="notice"><%= notice %></p>
+<div class="row">
+  <div class="small-12 columns">
+    <p id="notice"><%= notice %></p>
 
-<p>
-  <strong>Hostname:</strong>
-  <%= @agent.hostname %>
-</p>
+    <p>
+    <strong>Hostname:</strong>
+    <%= @agent.hostname %>
+    </p>
 
-<%= link_to 'Edit', edit_agent_path(@agent) %> |
-<%= link_to 'Back', agents_path %>
+    <%= link_to 'Edit', edit_agent_path(@agent) %> |
+    <%= link_to 'Events', agent_events_path(@agent) %> |
+    <%= link_to 'Back', agents_path %>
+  </div>
+</div>
app/views/dispositions/edit.html.erb
@@ -1,6 +1,12 @@
-<h1>Editing Disposition</h1>
+<div class="row">
+  <div class="small-12 columns">
 
-<%= render 'form' %>
+    <h1>Editing Disposition</h1>
+    
 
-<%= link_to 'Show', @disposition %> |
-<%= link_to 'Back', dispositions_path %>
+    <%= render 'form' %>
+
+    <%= link_to 'Show', @disposition %> |
+    <%= link_to 'Back', dispositions_path %>
+  </div>
+</div>
app/views/dispositions/index.html.erb
@@ -1,29 +1,34 @@
-<p id="notice"><%= notice %></p>
 
-<h1>Listing Dispositions</h1>
+<div class="row">
+  <div class="small-12 columns">
+    <p id="notice"><%= notice %></p>
 
-<table>
-  <thead>
-    <tr>
-      <th>Fingerprint</th>
-      <th>State</th>
-      <th colspan="3"></th>
-    </tr>
-  </thead>
+    <h1>Listing Dispositions</h1>
+    <ul class="button-group">
+      <li> <%= link_to 'New Disposition', new_disposition_path, class: 'button' %> </li>
+    </ul>
 
-  <tbody>
-    <% @dispositions.each do |disposition| %>
-      <tr>
-        <td><%= disposition.fingerprint %></td>
-        <td><%= disposition.state %></td>
-        <td><%= link_to 'Show', disposition %></td>
-        <td><%= link_to 'Edit', edit_disposition_path(disposition) %></td>
-        <td><%= link_to 'Destroy', disposition, method: :delete, data: { confirm: 'Are you sure?' } %></td>
-      </tr>
-    <% end %>
-  </tbody>
-</table>
+    <table>
+      <thead>
+        <tr>
+          <th>Fingerprint</th>
+          <th>State</th>
+          <th colspan="3"></th>
+        </tr>
+      </thead>
 
-<br>
+      <tbody>
+        <% @dispositions.each do |disposition| %>
+          <tr>
+            <td><%= disposition.fingerprint %></td>
+            <td><%= disposition.state %></td>
+            <td><%= link_to 'Show', disposition %></td>
+            <td><%= link_to 'Edit', edit_disposition_path(disposition) %></td>
+            <td><%= link_to 'Destroy', disposition, method: :delete, data: { confirm: 'Are you sure?' } %></td>
+          </tr>
+        <% end %>
+      </tbody>
+    </table>
 
-<%= link_to 'New Disposition', new_disposition_path %>
+  </div>
+</div>
app/views/dispositions/new.html.erb
@@ -1,5 +1,9 @@
-<h1>New Disposition</h1>
+<div class="row">
+  <div class="small-12 columns">
+    <h1>New Disposition</h1>
 
-<%= render 'form' %>
+    <%= render 'form' %>
 
-<%= link_to 'Back', dispositions_path %>
+    <%= link_to 'Back', dispositions_path %>
+  </div>
+</div>
app/views/dispositions/show.html.erb
@@ -1,14 +1,18 @@
-<p id="notice"><%= notice %></p>
+<div class="row">
+  <div class="small-12 columns">
+    <p id="notice"><%= notice %></p>
 
-<p>
-  <strong>Fingerprint:</strong>
-  <%= @disposition.fingerprint %>
-</p>
+    <p>
+    <strong>Fingerprint:</strong>
+    <%= @disposition.fingerprint %>
+    </p>
 
-<p>
-  <strong>State:</strong>
-  <%= @disposition.state %>
-</p>
+    <p>
+    <strong>State:</strong>
+    <%= @disposition.state %>
+    </p>
 
-<%= link_to 'Edit', edit_disposition_path(@disposition) %> |
-<%= link_to 'Back', dispositions_path %>
+    <%= link_to 'Edit', edit_disposition_path(@disposition) %> |
+    <%= link_to 'Back', dispositions_path %>
+  </div>
+</div>
app/views/events/index.html.erb
@@ -1,29 +1,30 @@
-<p id="notice"><%= notice %></p>
+<div class="row">
+  <div class="small-12 columns">
+    <p id="notice"><%= notice %></p>
 
-<h1>Listing Events</h1>
+    <h1>Listing Events</h1>
+    <%= link_to 'New Event', new_agent_event_path(@agent), class: 'button' %>
 
-<table>
-  <thead>
-    <tr>
-      <th>Name</th>
-      <th>Data</th>
-      <th>Created At</th>
-      <th></th>
-    </tr>
-  </thead>
+    <table>
+      <thead>
+        <tr>
+          <th>Name</th>
+          <th>Data</th>
+          <th>Created At</th>
+          <th></th>
+        </tr>
+      </thead>
 
-  <tbody>
-    <% @events.each do |event| %>
-      <tr>
-        <td><%= event.name %></td>
-        <td><%= event.data %></td>
-        <td><%= event.created_at %></td>
-        <td><%= link_to 'Destroy', [@agent, event], method: :delete, data: { confirm: 'Are you sure?' } %></td>
-      </tr>
-    <% end %>
-  </tbody>
-</table>
-
-<br>
-
-<%= link_to 'New Event', new_agent_event_path(@agent) %>
+      <tbody>
+        <% @events.each do |event| %>
+          <tr>
+            <td><%= event.name %></td>
+            <td><%= event.data %></td>
+            <td><%= event.created_at %></td>
+            <td><%= link_to 'Destroy', [@agent, event], method: :delete, data: { confirm: 'Are you sure?' } %></td>
+          </tr>
+        <% end %>
+      </tbody>
+    </table>
+  </div>
+</div>
app/views/events/new.html.erb
@@ -1,5 +1,9 @@
-<h1>New Event</h1>
+<div class="row">
+  <div class="small-12 columns">
+    <h1>New Event</h1>
 
-<%= render 'form' %>
+    <%= render 'form' %>
 
-<%= link_to 'Back', agent_events_path(@agent) %>
+    <%= link_to 'Back', agent_events_path(@agent) %>
+  </div>
+</div>
app/views/layouts/application.html.erb
@@ -13,6 +13,24 @@
   </head>
 
   <body>
+    <div class="contain-to-grid sticky">
+      <nav class="top-bar" data-topbar role="navigation" data-options="sticky_on: large">
+        <ul class="title-area">
+          <li class="name">
+            <h1><a href="#">malwer</a></h1>
+          </li>
+          <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
+          <li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
+        </ul>
+
+        <section class="top-bar-section">
+          <ul class="left">
+            <li><%= link_to "Agents", agents_path %></li>
+            <li><%= link_to "Dispositions", dispositions_path %></li>
+          </ul>
+        </section>
+      </nav>
+    </div>
 
     <%= yield %>