<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,9 +1,9 @@
 class Admin::SettingsController &lt; ApplicationController
   
-  only_allow_access_to :new, :create, :destroy
+  only_allow_access_to :new, :create, :destroy,
     :when =&gt; :admin,
     :denied_url =&gt; {:action =&gt; 'index'},
-    :denied_message =&gt; &quot;See your administrator if you'd like to create a new setting.&quot;
+    :denied_message =&gt; &quot;See your administrator if you'd like to create a new setting or delete an existing one.&quot;
   
   def index
     @settings = Radiant::Config.find_all_as_tree
@@ -13,7 +13,9 @@ class Admin::SettingsController &lt; ApplicationController
   end
   
   def create
-    Radiant::Config.find_or_create_by_key(params[:setting]['key']).update_attributes(params[:setting])
+    @setting = Radiant::Config.find_or_create_by_key(params[:setting]['key'])
+    @setting.update_attributes(params[:setting])
+    flash[:notice] = &quot;The setting \&quot;#{@setting.key}\&quot; was created.&quot;
     redirect_to admin_settings_url
   end
   
@@ -26,4 +28,12 @@ class Admin::SettingsController &lt; ApplicationController
     redirect_to admin_settings_url
   end
   
+  def destroy
+    @setting = Radiant::Config.find(params[:id])
+    @key = @setting.key
+    @setting.destroy
+    flash[:notice] = &quot;The setting \&quot;#{@key}\&quot; was deleted.&quot;
+    redirect_to admin_settings_url
+  end
+  
 end</diff>
      <filename>app/controllers/admin/settings_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,14 +14,11 @@
       p
         margin: 0 0 10px
 
-%h1
-  Edit Radiant Setting
+%h1 Edit Radiant Setting
 
-  %h2.setting-name
-    = @setting.key
-  
-  .description
-    = textilize @setting.description
+%h2.setting-name= @setting.key
+
+.description= textilize @setting.description
 
 - form_for :setting, :url =&gt; admin_setting_path(@setting), :html =&gt; { :method =&gt; :put } do |f|
   .form-area
@@ -32,5 +29,9 @@
     
     %br/
     
-    %p.buttons
-      = submit_tag 'Save', :class =&gt; 'button'
\ No newline at end of file
+    %p.buttons= submit_tag 'Save', :class =&gt; 'button'
+      
+%p.buttons
+  - if admin?
+    This system relies on some of these settings to work properly. Deleting settings may cause unexpected errors. 
+    = link_to &quot;I understand. Delete this setting entirely.&quot;, admin_setting_path(@setting), :method =&gt; :delete if admin?
\ No newline at end of file</diff>
      <filename>app/views/admin/settings/edit.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 - content_for 'page_css' do
   :sass
-    table.index
+    table#settings_index
       span.label
         color: #666
         font-size: 1.2em
@@ -14,14 +14,25 @@
         td
           background: #EAEAEA
           height: 3px
-          padding: 0 !important
+          padding: 0
+    p.new
+      a
+        color: #000
+        border: 1px solid #ddf
+        padding: 6px
+        text-decoration: none
+        &amp;:hover
+          background: #efefff
+    
 
 %h1 Radiant Settings
 
-%table.index
+%table#settings_index.index
   %tr
     %th.key Setting Name
     %th.value Value
   
   - @settings.each do |key, node|
-    = render_node key, node, :reset_depth =&gt; true
\ No newline at end of file
+    = render_node key, node, :reset_depth =&gt; true
+    
+%p.new= link_to &quot;New Setting&quot;, new_admin_setting_url if admin?
\ No newline at end of file</diff>
      <filename>app/views/admin/settings/index.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -35,4 +35,4 @@
     %br/
     
     %p.buttons
-      = submit_tag 'Save', :class =&gt; 'button'
\ No newline at end of file
+      = submit_tag 'Create', :class =&gt; 'button'
\ No newline at end of file</diff>
      <filename>app/views/admin/settings/new.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -37,6 +37,14 @@ describe Admin::SettingsController do
     end
   end
   
+  describe &quot;GET /admin/settings/new&quot; do
+    it &quot;should show a new setting form&quot; do
+      login_as :admin
+      get 'new'
+      response.should be_success
+    end
+  end
+  
   describe &quot;GET /admin/settings/:id/edit&quot; do
     it &quot;should fetch the desired setting&quot; do
       Radiant::Config.should_receive(:find).with('123').and_return(@parts)
@@ -56,4 +64,15 @@ describe Admin::SettingsController do
     end
   end
   
+  describe &quot;DELETE /admin/setting/:id&quot; do
+    it &quot;should destroy the desired setting&quot; do
+      login_as :admin
+      Radiant::Config.should_receive(:find).with('123').and_return(@parts)
+      @parts.should_receive(:destroy)
+      
+      delete 'destroy', :id =&gt; '123'
+      response.should redirect_to(admin_settings_path)
+    end
+  end
+  
 end</diff>
      <filename>spec/controllers/admin/settings_controller_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,10 +2,11 @@ require File.dirname(__FILE__) + '/../../spec_helper'
 
 describe Admin::SettingsHelper do
   
-  #Delete this example and add some real ones or delete this file
-  it &quot;should include the Admin::SettingsHelper&quot; do
-    included_modules = self.metaclass.send :included_modules
-    included_modules.should include(Admin::SettingsHelper)
+  describe &quot;render_node&quot; do
+    it &quot;should set the depth to 0 if it is not explicitly set&quot;
+    
+    it &quot;should render the 'setting' partial&quot;
+    
   end
   
 end</diff>
      <filename>spec/helpers/admin/settings_helper_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b3cd6effc76ecb12718ee5ca992e3d711c2d9c56</id>
    </parent>
  </parents>
  <author>
    <name>Jim Gay</name>
    <email>jim@saturnflyer.com</email>
  </author>
  <url>http://github.com/Squeegy/radiant-settings/commit/b1058dab910fa31e1bcfbaf063f4587c5c668251</url>
  <id>b1058dab910fa31e1bcfbaf063f4587c5c668251</id>
  <committed-date>2008-06-25T18:56:08-07:00</committed-date>
  <authored-date>2008-06-25T18:56:08-07:00</authored-date>
  <message>spec'd destroy and new, pending specs for helper</message>
  <tree>a189dec553cd0b77d6ee4c55460e23762f73fa85</tree>
  <committer>
    <name>Jim Gay</name>
    <email>jim@saturnflyer.com</email>
  </committer>
</commit>
