Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 193
- Log:
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Author:
- rool
- Date:
- Wed Apr 04 18:51:02 +0100 2007
- Size:
- 1248 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.mark_as_ham! |
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 |