Adding versioning

This commit is contained in:
2013-10-09 03:34:27 -07:00
parent 5a94d69b3d
commit ebc696814e
11 changed files with 101 additions and 46 deletions

View File

@@ -16,8 +16,8 @@
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :type %><br>
<%= f.text_field :type %>
<%= f.label :category %><br>
<%= f.text_field :category %>
</div>
<div class="field">
<%= f.label :address %><br>

View File

@@ -0,0 +1,40 @@
<p>
<strong>Name:</strong>
<%= space.name %>
</p>
<p>
<strong>Category:</strong>
<%= space.category %>
</p>
<p>
<strong>Address:</strong>
<%= space.address %>
</p>
<p>
<strong>Hours:</strong>
<%= space.hours %>
</p>
<p>
<strong>Phone:</strong>
<%= space.phone %>
</p>
<p>
<strong>Email:</strong>
<%= space.email %>
</p>
<p>
<strong>Website:</strong>
<%= space.website %>
</p>
<p>
<strong>Description:</strong>
<%= space.description %>
</p>

View File

@@ -4,7 +4,7 @@
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Category</th>
<th>Address</th>
<th>Hours</th>
<th>Phone</th>
@@ -21,7 +21,7 @@
<% @spaces.each do |space| %>
<tr>
<td><%= space.name %></td>
<td><%= space.type %></td>
<td><%= space.category %></td>
<td><%= space.address %></td>
<td><%= space.hours %></td>
<td><%= space.phone %></td>

View File

@@ -1,44 +1,18 @@
<p id="notice"><%= notice %></p>
<p>
<strong>Name:</strong>
<%= @space.name %>
</p>
<p>
<strong>Type:</strong>
<%= @space.type %>
</p>
<p>
<strong>Address:</strong>
<%= @space.address %>
</p>
<p>
<strong>Hours:</strong>
<%= @space.hours %>
</p>
<p>
<strong>Phone:</strong>
<%= @space.phone %>
</p>
<p>
<strong>Email:</strong>
<%= @space.email %>
</p>
<p>
<strong>Website:</strong>
<%= @space.website %>
</p>
<p>
<strong>Description:</strong>
<%= @space.description %>
</p>
<%= render partial: "space", locals: {space: @space} %>
<%= link_to 'Edit', edit_space_path(@space) %> |
<%= link_to 'Back', spaces_path %>
<h3>Revision history</h3>
<dl>
<% @space.versions.each do |v| %>
<dt><b><%= v.event.capitalize %> <%= v.created_at %> <%= v.whodunnit if v.whodunnit %></b></dt>
<dd>
<% if v.reify %>
<%= render partial: "space", locals: {space: v.reify} %>
<% end %>
</dd>
<% end %>
</dl>