Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 1252 Bytes
1 | class Admin::CommentsController < Admin::BaseController |
2 | |
3 | before_filter :get_article |
4 | |
5 | def index |
6 | list |
7 | render_action 'list' |
8 | end |
9 | |
10 | def list |
11 | @comments = @article.comments.find(:all, :order => "id DESC") |
12 | end |
13 | |
14 | def show |
15 | @comment = @article.comments.find(params[:id]) |
16 | end |
17 | |
18 | def new |
19 | @comment = @article.comments.build(params[:comment]) |
20 | |
21 | if request.post? and @comment.save |
22 | # We should probably wave a spam filter over this, but for now, just mark it as published. |
23 | @comment.published = true |
24 | flash[:notice] = 'Comment was successfully created.' |
25 | redirect_to :action => 'show', :id => @comment.id |
26 | end |
27 | end |
28 | |
29 | def edit |
30 | @comment = @article.comments.find(params[:id]) |
31 | @comment.attributes = params[:comment] |
32 | |
33 | if request.post? and @comment.save |
34 | flash[:notice] = 'Comment was successfully updated.' |
35 | redirect_to :action => 'show', :id => @comment.id |
36 | end |
37 | end |
38 | |
39 | def destroy |
40 | @comment = @article.comments.find(params[:id]) |
41 | if request.post? |
42 | @comment.destroy |
43 | redirect_to :action => 'list' |
44 | end |
45 | end |
46 | |
47 | private |
48 | |
49 | def get_article |
50 | @article = Article.find(params[:article_id]) |
51 | |
52 | if @article.nil? |
53 | redirect_to '/admin' |
54 | end |
55 | end |
56 | |
57 | end |