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:
- 1315 Bytes
1 | require 'base64' |
2 | |
3 | class Admin::PagesController < Admin::BaseController |
4 | def index |
5 | list |
6 | render_action 'list' |
7 | end |
8 | |
9 | def list |
10 | @pages = Page.find(:all, :order => "id DESC") |
11 | @page = Page.new(params[:page]) |
12 | @page.text_filter ||= this_blog.text_filter |
13 | end |
14 | |
15 | def show |
16 | @page = Page.find(params[:id]) |
17 | end |
18 | |
19 | def new |
20 | @page = Page.new(params[:page]) |
21 | @page.user_id = session[:user].id |
22 | @page.text_filter ||= this_blog.text_filter |
23 | if request.post? and @page.save |
24 | flash[:notice] = 'Page was successfully created.' |
25 | redirect_to :action => 'show', :id => @page.id |
26 | end |
27 | end |
28 | |
29 | def edit |
30 | @page = Page.find(params[:id]) |
31 | @page.attributes = params[:page] |
32 | if request.post? and @page.save |
33 | flash[:notice] = 'Page was successfully updated.' |
34 | redirect_to :action => 'show', :id => @page.id |
35 | end |
36 | end |
37 | |
38 | def destroy |
39 | @page = Page.find(params[:id]) |
40 | if request.post? |
41 | @page.destroy |
42 | redirect_to :action => 'list' |
43 | end |
44 | end |
45 | |
46 | def preview |
47 | headers["Content-Type"] = "text/html; charset=utf-8" |
48 | @page = this_blog.pages.build(params[:page]) |
49 | data = render_to_string(:layout => "minimal") |
50 | data = Base64.encode64(data).gsub("\n", '') |
51 | data = "data:text/html;charset=utf-8;base64,#{data}" |
52 | render :text => data |
53 | end |
54 | end |