Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 178
- Log:
Hub integration of Beast forum. Completed styling for RISC OS Open site.
Removed reliance on JavaScript. Added Textile hints to various views.
Added bespoke utility code used to port over RForum data for posterity;
note the rather large bug that it ignores the deleted flag on RForum
data.Some amount of testing carried out on Firefox, Opera and Netsurf. Looks
OK so far, but there are definitely some aesthetic kinks to work out
still and doubtless some operational bugs will surface once it goes
live and is subjected to more intensive real world use.
- Author:
- rool
- Date:
- Mon Mar 12 00:19:40 +0000 2007
- Size:
- 2064 Bytes
1 | class ForumsController < ApplicationController |
2 | before_filter :find_or_initialize_forum, :except => :index |
3 | |
4 | @@hubssolib_permissions = HubSsoLib::Permissions.new({ |
5 | :new => [ :admin, :webmaster ], |
6 | :create => [ :admin, :webmaster ], |
7 | :edit => [ :admin, :webmaster ], |
8 | :update => [ :admin, :webmaster ], |
9 | :destroy => [ :admin, :webmaster ], |
10 | }) |
11 | |
12 | def ForumsController.hubssolib_permissions |
13 | @@hubssolib_permissions |
14 | end |
15 | |
16 | def index |
17 | @forums = Forum.find(:all, :order => "position") |
18 | respond_to do |format| |
19 | format.html |
20 | format.xml { render :xml => @forums.to_xml } |
21 | end |
22 | end |
23 | |
24 | def show |
25 | respond_to do |format| |
26 | format.html do |
27 | # keep track of when we last viewed this forum for activity indicators |
28 | (session[:forums] ||= {})[@forum.id] = Time.now.utc if logged_in? |
29 | @topic_pages, @topics = paginate(:topics, :per_page => 25, :conditions => ['forum_id = ?', params[:id]], :include => :replied_by_user, :order => 'sticky desc, replied_at desc') |
30 | end |
31 | |
32 | format.xml do |
33 | render :xml => @forum.to_xml |
34 | end |
35 | end |
36 | end |
37 | |
38 | # new renders new.rhtml |
39 | |
40 | def create |
41 | @forum.attributes = params[:forum] |
42 | @forum.save! |
43 | respond_to do |format| |
44 | format.html { redirect_to forums_path } |
45 | format.xml { head :created, :location => formatted_forum_url(:id => @forum, :format => :xml) } |
46 | end |
47 | end |
48 | |
49 | def update |
50 | @forum.attributes = params[:forum] |
51 | @forum.save! |
52 | respond_to do |format| |
53 | format.html { redirect_to forums_path } |
54 | format.xml { head 200 } |
55 | end |
56 | end |
57 | |
58 | def destroy |
59 | @forum.destroy |
60 | respond_to do |format| |
61 | format.html { redirect_to forums_path } |
62 | format.xml { head 200 } |
63 | end |
64 | end |
65 | |
66 | protected |
67 | def find_or_initialize_forum |
68 | @forum = params[:id] ? Forum.find(params[:id]) : Forum.new |
69 | end |
70 | |
71 | alias authorized? admin? |
72 | end |