Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 2112 Bytes
1 | require_dependency 'radiant' |
2 | |
3 | class ApplicationController < ActionController::Base |
4 | include LoginSystem |
5 | include Radiant::LegacyRoutes |
6 | |
7 | filter_parameter_logging :password, :password_confirmation |
8 | |
9 | protect_from_forgery |
10 | |
11 | before_filter :set_current_user |
12 | before_filter :set_timezone |
13 | before_filter :set_user_locale |
14 | before_filter :set_javascripts_and_stylesheets |
15 | before_filter :set_standard_body_style, :only => [:new, :edit, :update, :create] |
16 | |
17 | attr_accessor :config, :cache |
18 | attr_reader :pagination_parameters |
19 | helper_method :pagination_parameters |
20 | |
21 | def initialize |
22 | super |
23 | @config = Radiant::Config |
24 | end |
25 | |
26 | # helpers to include additional assets from actions or views |
27 | helper_method :include_stylesheet, :include_javascript |
28 | |
29 | def include_stylesheet(sheet) |
30 | @stylesheets << sheet |
31 | end |
32 | |
33 | def include_javascript(script) |
34 | @javascripts << script |
35 | end |
36 | |
37 | def template_name |
38 | case self.action_name |
39 | when 'index' |
40 | 'index' |
41 | when 'new','create' |
42 | 'new' |
43 | when 'show' |
44 | 'show' |
45 | when 'edit', 'update' |
46 | 'edit' |
47 | when 'remove', 'destroy' |
48 | 'remove' |
49 | else |
50 | self.action_name |
51 | end |
52 | end |
53 | |
54 | def rescue_action_in_public(exception) |
55 | case exception |
56 | when ActiveRecord::RecordNotFound, ActionController::UnknownController, ActionController::UnknownAction, ActionController::RoutingError |
57 | render :template => "site/not_found", :status => 404 |
58 | else |
59 | super |
60 | end |
61 | end |
62 | |
63 | private |
64 | |
65 | def set_current_user |
66 | UserActionObserver.current_user = current_user |
67 | end |
68 | |
69 | def set_user_locale |
70 | I18n.locale = current_user && !current_user.locale.blank? ? current_user.locale : Radiant::Config['default_locale'] |
71 | end |
72 | |
73 | def set_timezone |
74 | Time.zone = Radiant::Config['local.timezone'] || Time.zone_default |
75 | end |
76 | |
77 | def set_javascripts_and_stylesheets |
78 | @stylesheets ||= [] |
79 | @stylesheets.concat %w(admin/main) |
80 | @javascripts ||= [] |
81 | end |
82 | |
83 | def set_standard_body_style |
84 | @body_classes ||= [] |
85 | @body_classes.concat(%w(reversed)) |
86 | end |
87 | |
88 | end |