Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 13
- Log:
Initial import of Typo 2.6.0 sources from a downloaded Tarball.
Typo is a Ruby On Rails based blog engine.
- Author:
- adh
- Date:
- Sat Jul 22 22:25:02 +0100 2006
- Size:
- 1174 Bytes
1 | class Admin::CommentsController < Admin::BaseController |
2 | |
3 | before_filter :get_article |
4 | cache_sweeper :blog_sweeper |
5 | |
6 | def index |
7 | list |
8 | render_action 'list' |
9 | end |
10 | |
11 | def list |
12 | @comments = @article.comments.find(:all, :order => "id DESC") |
13 | end |
14 | |
15 | def show |
16 | @comment = @article.comments.find(params[:id]) |
17 | end |
18 | |
19 | def new |
20 | @comment = @article.comments.build(params[:comment]) |
21 | |
22 | if request.post? and @comment.save |
23 | flash[:notice] = 'Comment was successfully created.' |
24 | redirect_to :action => 'show', :id => @comment.id |
25 | end |
26 | end |
27 | |
28 | def edit |
29 | @comment = @article.comments.find(params[:id]) |
30 | @comment.attributes = params[:comment] |
31 | if request.post? and @comment.save |
32 | flash[:notice] = 'Comment was successfully updated.' |
33 | redirect_to :action => 'show', :id => @comment.id |
34 | end |
35 | end |
36 | |
37 | def destroy |
38 | @comment = @article.comments.find(params[:id]) |
39 | if request.post? |
40 | @comment.destroy |
41 | redirect_to :action => 'list' |
42 | end |
43 | end |
44 | |
45 | private |
46 | |
47 | def get_article |
48 | @article = Article.find(params[:article_id]) |
49 | |
50 | if @article.nil? |
51 | redirect_to '/admin' |
52 | end |
53 | end |
54 | |
55 | end |