<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -26,3 +26,6 @@
       %span= status_diff(version)
   %div{:style =&gt; &quot;clear:both&quot;}
   %p= updated_stamp(version.instance)
+  - form_tag(edit_admin_layout_path(:id =&gt; version.versionable_id), :method =&gt; :get) do
+    = hidden_field_tag(:version, version.number)
+    = submit_tag(&quot;Revert to Version #{version.number}&quot;, :name =&gt; nil)
\ No newline at end of file</diff>
      <filename>app/views/admin/layouts/_diff.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -32,4 +32,18 @@ Feature: revert
     Given I have a snippet with more than one version
     When I edit a previous snippet version
     And I press &quot;Save&quot;
-    Then I should see &quot;Snippet saved below&quot;
\ No newline at end of file
+    Then I should see &quot;Snippet saved below&quot;
+  
+  Scenario: load previous layout version for editing
+    Given I have a layout with more than one version
+    When I view a previous version
+    And I click the revert button
+    Then I should be taken to the edit page
+    And the older layout content should be loaded
+    And I should see &quot;Loaded version 1. Click save to revert to this content.&quot;
+
+  Scenario: revert layout to previous version
+    Given I have a layout with more than one version
+    When I edit a previous layout version
+    And I press &quot;Save&quot;
+    Then I should see &quot;Layout saved below&quot;
\ No newline at end of file</diff>
      <filename>features/revert.feature</filename>
    </modified>
    <modified>
      <diff>@@ -43,6 +43,14 @@ Given /^I have a snippet with more than one version$/ do
   @snippet.save # version 2
 end
 
+Given /^I have a layout with more than one version$/ do
+  @layout = layouts(:main)
+  @layout.save # version 1
+  @layout.status = Status[:published]
+  @layout.name = @layout.name += &quot; Version 2&quot;
+  @layout.save # version 2
+end
+
 When /^I edit the page$/ do
   visit admin_pages_path
   click_link @page.title
@@ -66,6 +74,10 @@ When /^I edit a previous snippet version$/ do
   visit edit_admin_snippet_path(:id =&gt; @snippet.id, :version =&gt; 1)
 end
 
+When /^I edit a previous layout version$/ do
+  visit edit_admin_layout_path(:id =&gt; @layout.id, :version =&gt; 1)
+end
+
 Then /^I should be taken to the edit page$/ do
   request.params[&quot;version&quot;].should == &quot;1&quot;
   request.params[&quot;action&quot;].should == &quot;edit&quot;
@@ -77,6 +89,8 @@ Then /^the older (.+) content should be loaded$/ do |model|
     field_labeled(&quot;Page Title&quot;).value.should_not == @page.current.title
   when &quot;snippet&quot;
     field_labeled(&quot;Name&quot;).value.should_not == @snippet.current.name
+  when &quot;layout&quot;
+    field_labeled(&quot;Name&quot;).value.should_not == @layout.current.name
   end
 end
 </diff>
      <filename>features/step_definitions/versioning_steps.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d64888f93f00828548e1b413224096193c824c34</id>
    </parent>
  </parents>
  <author>
    <name>Jason Garber</name>
    <email>jg@jasongarber.com</email>
  </author>
  <url>http://github.com/jgarber/radiant-chronicle-extension/commit/5428a18eee6c1ed9048e297ff23eb22537bcabd1</url>
  <id>5428a18eee6c1ed9048e297ff23eb22537bcabd1</id>
  <committed-date>2009-09-07T13:23:44-07:00</committed-date>
  <authored-date>2009-09-07T13:23:44-07:00</authored-date>
  <message>Add ability to revert layouts.</message>
  <tree>7a0b9cda9c4b70e197b33298f60779f6a3ba7e20</tree>
  <committer>
    <name>Jason Garber</name>
    <email>jg@jasongarber.com</email>
  </committer>
</commit>
