public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
add article deletion

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@1407 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Sat Jul 22 15:51:40 -0700 2006
commit  667427d359abf0affa1f1ecd8e1f67f0f80368a2
tree    624d4ea6d0287e8422619a5ccb81fb9a25641898
parent  614d0a14228a0fa0cb71511984b1e7113ff7372e
...
15
16
17
18
 
19
20
21
...
15
16
17
 
18
19
20
21
0
@@ -15,7 +15,7 @@ class ArticleSweeper < ActionController::Caching::Sweeper
0
   end
0
 
0
   def after_save(record)
0
- if record.is_a?(Article)
0
+ if @event && record.is_a?(Article)
0
       @event.update_attributes :title => record.title, :body => record.body, :article => record, :user => record.updater, :site => record.site
0
       expire_overview_feed!
0
     end
...
9
10
11
12
 
13
14
15
...
33
34
35
36
37
38
39
...
61
62
63
 
 
 
 
 
 
 
64
65
66
...
9
10
11
 
12
13
14
15
...
33
34
35
 
36
37
38
...
60
61
62
63
64
65
66
67
68
69
70
71
72
0
@@ -9,7 +9,7 @@ class Admin::ArticlesController < Admin::BaseController
0
   before_filter :check_for_new_draft, :only => [:create, :update]
0
   before_filter :convert_times_to_utc, :only => [:create, :update]
0
   
0
- before_filter :find_site_article, :only => [:update, :comments, :approve, :unapprove]
0
+ before_filter :find_site_article, :only => [:edit, :update, :comments, :approve, :unapprove, :destroy]
0
   before_filter :load_sections, :only => [:new, :edit]
0
 
0
   def index
0
@@ -33,7 +33,6 @@ class Admin::ArticlesController < Admin::BaseController
0
   end
0
 
0
   def edit
0
- @article = site.articles.find(params[:id])
0
     @version = params[:version] ? @article.find_version(params[:version]) : @article
0
     [:published_at, :expire_comments_at].each do |attr|
0
       @version.send("#{attr}=", utc_to_local(@version.send(attr) || Time.now.utc))
0
@@ -61,6 +60,13 @@ class Admin::ArticlesController < Admin::BaseController
0
     end
0
   end
0
 
0
+ def destroy
0
+ @article.destroy
0
+ render :update do |page|
0
+ page.redirect_to :action => 'index'
0
+ end
0
+ end
0
+
0
   def comments
0
     @comments =
0
       case params[:filter]
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@
0
 <% content_for :action_nav do %>
0
 <div id="page-nav">
0
   <ul id="act-nav" class="clear">
0
- <li><%= link_to 'Delete this article', {:action => 'destroy', :id => @article}, :confirm => 'Are you sure you want to delete this article?' %></li>
0
+ <li><%= link_to_remote 'Delete this article', :url => {:action => 'destroy', :id => @article}, :confirm => 'Are you sure you want to delete this article?' %></li>
0
     <li id="select">
0
       <a class="trigger" id="cog" href="#">&nbsp;</a>
0
       <div id="optgroup" style="display: none">
...
3
4
5
6
 
7
8
9
...
3
4
5
 
6
7
8
9
0
@@ -3,7 +3,7 @@
0
 # In the development environment your application's code is reloaded on
0
 # every request. This slows down response time but is perfect for development
0
 # since you don't have to restart the webserver when you make code changes.
0
-config.cache_classes = true
0
+config.cache_classes = false
0
 
0
 # Log error messages when you accidentally call methods on nil.
0
 config.whiny_nils = true

Comments

    No one has commented yet.