refinerycms 0.9.6.29 → 0.9.6.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. data/VERSION +1 -1
  2. data/config/application.rb +1 -1
  3. data/public/stylesheets/refinery/application.css +18 -18
  4. data/public/stylesheets/refinery/refinery.css +565 -559
  5. data/vendor/plugins/authentication/app/views/admin/users/_user.html.erb +1 -1
  6. data/vendor/plugins/authentication/app/views/admin/users/index.html.erb +1 -1
  7. data/vendor/plugins/images/app/helpers/admin/images_helper.rb +1 -1
  8. data/vendor/plugins/images/app/views/admin/images/_form.html.erb +3 -3
  9. data/vendor/plugins/images/app/views/admin/images/_grid_view.html.erb +1 -1
  10. data/vendor/plugins/images/app/views/admin/images/_list_view_image.html.erb +1 -1
  11. data/vendor/plugins/inquiries/app/controllers/inquiries_controller.rb +4 -0
  12. data/vendor/plugins/inquiries/app/views/admin/inquiries/_inquiry.html.erb +1 -1
  13. data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/index.html.erb +1 -1
  14. data/vendor/plugins/pages/app/controllers/admin/pages_controller.rb +1 -1
  15. data/vendor/plugins/pages/app/controllers/pages_controller.rb +2 -3
  16. data/vendor/plugins/pages/app/views/admin/pages/_page.html.erb +1 -1
  17. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_singular_name.html.erb +3 -3
  18. data/vendor/plugins/refinery/lib/refinery/application_controller.rb +43 -30
  19. data/vendor/plugins/refinery/rails/init.rb +1 -1
  20. data/vendor/plugins/refinery_settings/app/models/refinery_setting.rb +1 -1
  21. data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_form.html.erb +1 -1
  22. data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_refinery_setting.html.erb +1 -1
  23. data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/index.html.erb +1 -1
  24. data/vendor/plugins/resources/app/views/admin/resources/_form.html.erb +1 -1
  25. data/vendor/plugins/resources/app/views/admin/resources/_resource.html.erb +1 -1
  26. data/vendor/plugins/themes/rails/init.rb +9 -6
  27. metadata +3 -3
@@ -13,4 +13,4 @@
13
13
  :title => 'Email this user' %>
14
14
  </span>
15
15
  </span>
16
- </li>
16
+ </li>
@@ -20,4 +20,4 @@
20
20
  </strong>
21
21
  </p>
22
22
  <% end %>
23
- </div>
23
+ </div>
@@ -13,7 +13,7 @@ module Admin::ImagesHelper
13
13
  end
14
14
 
15
15
  def change_list_mode_if_specified
16
- unless params[:action] != "index" or params[:view].blank? or !image_views.include? params[:view].to_sym
16
+ unless action_name != "index" or params[:view].blank? or !image_views.include? params[:view].to_sym
17
17
  RefinerySetting[:preferred_image_view] = params[:view]
18
18
  end
19
19
  end
@@ -4,14 +4,14 @@
4
4
  :html => {:multipart => true, :style => 'float: left; width: 70%'} do |f| %>
5
5
  <div class='field'>
6
6
  <%= f.label :uploaded_data, 'Image' %>
7
- <% if params[:action] =~ /(edit)|(update)/ %>
7
+ <% if action_name =~ /(edit)|(update)/ %>
8
8
  Use current image
9
9
  <em>or</em>, replace it with this one...
10
10
  <% end %>
11
11
  <%= f.file_field :uploaded_data %>
12
12
  </div>
13
13
 
14
- <%= render :partial => "/shared/admin/form_actions", :locals => {:f => f, :continue_editing => false, :hide_cancel => (@app_dialog or params[:action] == "insert")} %>
14
+ <%= render :partial => "/shared/admin/form_actions", :locals => {:f => f, :continue_editing => false, :hide_cancel => (@app_dialog or action_name == "insert")} %>
15
15
 
16
16
  <% if @app_dialog %>
17
17
  <input type='hidden' name='app_dialog' value='<%= @app_dialog %>' />
@@ -23,7 +23,7 @@
23
23
  <% end %>
24
24
  <% end %>
25
25
 
26
- <% if params[:action] =~ /(edit)|(update)/ %>
26
+ <% if action_name =~ /(edit)|(update)/ %>
27
27
  <div style='float: right; width: 25%;'>
28
28
  <label>Current Image</label>
29
29
  <%= image_fu @image, :medium, { :class => "brown_border" } %>
@@ -14,4 +14,4 @@
14
14
  </span>
15
15
  </li>
16
16
  <% end -%>
17
- </ul>
17
+ </ul>
@@ -14,4 +14,4 @@
14
14
  </span>
15
15
  </span>
16
16
  </li>
17
- <% end %>
17
+ <% end %>
@@ -2,6 +2,10 @@ class InquiriesController < ApplicationController
2
2
 
3
3
  before_filter :find_page, :only => [:create, :new]
4
4
 
5
+ def index
6
+ redirect_to :action => "new"
7
+ end
8
+
5
9
  def thank_you
6
10
  @page = Page.find_by_menu_match("^/inquiries/thank_you$", :include => [:parts, :slugs])
7
11
  end
@@ -13,4 +13,4 @@
13
13
  :title => "Remove this inquiry forever" -%>
14
14
  </span>
15
15
  </span>
16
- </li>
16
+ </li>
@@ -28,4 +28,4 @@
28
28
  <% end -%>
29
29
  </ul>
30
30
  <% end -%>
31
- </div>
31
+ </div>
@@ -13,7 +13,7 @@ class Admin::PagesController < Admin::BaseController
13
13
 
14
14
  protected
15
15
  def expire_menu_fragment_caching
16
- expire_fragment(%r{site_menu})
16
+ expire_fragment(%r{#{RefinerySetting.find_or_set(:refinery_menu_cache_action_suffix, "site_menu")}})
17
17
  end
18
18
 
19
19
  # This finds all of the pages that could possibly be assigned as the current page's parent.
@@ -1,8 +1,7 @@
1
1
  class PagesController < ApplicationController
2
2
 
3
3
  def home
4
- @page = Page.find_by_link_url("/", :include => [:parts, :slugs])
5
- error_404 unless @page.present?
4
+ error_404 unless (@page = Page.find_by_link_url("/", :include => [:parts, :slugs])).present?
6
5
  end
7
6
 
8
7
  def show
@@ -19,4 +18,4 @@ class PagesController < ApplicationController
19
18
  end
20
19
  end
21
20
 
22
- end
21
+ end
@@ -29,4 +29,4 @@
29
29
  <%= render :partial => 'page', :collection => children %>
30
30
  </ul>
31
31
  <% end -%>
32
- </li>
32
+ </li>
@@ -1,8 +1,8 @@
1
1
  <li class='clearfix record <%%= cycle("on", "on-hover") %>' id="<%%= dom_id(<%= singular_name %>) -%>">
2
2
  <span class='title'>
3
- <%%=h <%= singular_name %>.<%= attributes.first.name %> %>
3
+ <%%=h <%= singular_name %>.<%= attributes.first.name %> %>
4
4
  <span class="preview">&nbsp;</span>
5
-
5
+
6
6
  <span class='actions'>
7
7
  <%%= link_to refinery_icon_tag("application_go.png"), <%= singular_name %>_url(<%= singular_name %>),
8
8
  :title => 'View this <%= $title_name.downcase %><br/><em>Opens in a new window</em>',
@@ -14,4 +14,4 @@
14
14
  :title => 'Remove this <%= $title_name.downcase %> forever' %>
15
15
  </span>
16
16
  </span>
17
- </li>
17
+ </li>
@@ -6,38 +6,49 @@ class Refinery::ApplicationController < ActionController::Base
6
6
  include Crud # basic create, read, update and delete methods
7
7
  include AuthenticatedSystem
8
8
 
9
- before_filter :take_down_for_maintenance?, :find_pages_for_menu, :show_welcome_page
9
+ before_filter :take_down_for_maintenance?, :find_pages_for_menu, :show_welcome_page?
10
10
 
11
- rescue_from ActiveRecord::RecordNotFound, ActionController::UnknownAction, :with => :error_404
11
+ rescue_from ActiveRecord::RecordNotFound, ActionController::UnknownAction, ActionView::MissingTemplate, :with => :error_404
12
12
 
13
- def error_404
13
+ def admin?
14
+ controller_name =~ %r{^admin/}
15
+ end
16
+
17
+ def error_404(exception=nil)
14
18
  if (@page = Page.find_by_menu_match("^/404$", :include => [:parts, :slugs])).present?
15
- # render the application's custom 404 page with layout.
16
- render :template => "/pages/show", :status => 404
19
+ if exception.present? and exception.is_a?(ActionView::MissingTemplate) and params[:format] != "html"
20
+ # Attempt to respond to all requests with the default format's 404 page
21
+ # unless a format wasn't specified. This requires finding menu pages and re-attaching any themes
22
+ # which for some unknown reason don't happen, most likely due to the format being passed in.
23
+ response.template.template_format = :html
24
+ response.headers["Content-Type"] = Mime::Type.lookup_by_extension('html').to_s
25
+ find_pages_for_menu if @menu_pages.nil? or @menu_pages.empty?
26
+ attach_theme_to_refinery if self.respond_to?(:attach_theme_to_refinery) # may not be using theme support
27
+ present(@page)
28
+ end
29
+
30
+ # render the application's custom 404 page with layout and meta.
31
+ render :template => "/pages/show", :status => 404, :format => 'html'
17
32
  else
18
33
  # fallback to the default 404.html page.
19
- render :file => Rails.root.join("public", "404.html"), :layout => false, :status => 404
34
+ render :file => Rails.root.join("public", "404.html").cleanpath.to_s, :layout => false, :status => 404
20
35
  end
21
36
  end
22
37
 
23
- def home_page?
24
- action_name == "home" and controller_name == "pages"
38
+ def from_dialog?
39
+ params[:dialog] == "true" or params[:modal] == "true"
25
40
  end
26
41
 
27
- def local_request?
28
- ENV["RAILS_ENV"] == "development" or request.remote_ip =~ /(::1)|(127.0.0.1)|((192.168).*)/
42
+ def home_page?
43
+ action_name == "home" and controller_name == "pages"
29
44
  end
30
45
 
31
46
  def just_installed?
32
47
  !User.exists?
33
48
  end
34
49
 
35
- def from_dialog?
36
- params[:dialog] == "true" or params[:modal] == "true"
37
- end
38
-
39
- def admin?
40
- controller_name =~ /^admin\//
50
+ def local_request?
51
+ ENV["RAILS_ENV"] == "development" or request.remote_ip =~ /(::1)|(127.0.0.1)|((192.168).*)/
41
52
  end
42
53
 
43
54
  def wymiframe
@@ -46,20 +57,6 @@ class Refinery::ApplicationController < ActionController::Base
46
57
 
47
58
  protected
48
59
 
49
- def take_down_for_maintenance?
50
- if RefinerySetting.find_or_set(:down_for_maintenance, false)
51
- if (@page = Page.find_by_menu_match("^/maintenance$", :include => [:parts, :slugs])).present?
52
- render :template => "/pages/show", :status => 503
53
- else
54
- render :text => "Our website is currently down for maintenance. Please try back soon."
55
- end
56
- end
57
- end
58
-
59
- def show_welcome_page
60
- render :template => "/welcome", :layout => "admin" if just_installed? and controller_name != "users"
61
- end
62
-
63
60
  # get all the pages to be displayed in the site menu.
64
61
  def find_pages_for_menu
65
62
  @menu_pages = Page.top_level(include_children=true)
@@ -77,4 +74,20 @@ protected
77
74
  super
78
75
  end
79
76
 
77
+ def show_welcome_page?
78
+ render :template => "/welcome", :layout => "admin" if just_installed? and controller_name != "users"
79
+ end
80
+ # todo: make this break in the next major version rather than aliasing.
81
+ alias_method :show_welcome_page, :show_welcome_page?
82
+
83
+ def take_down_for_maintenance?
84
+ if RefinerySetting.find_or_set(:down_for_maintenance, false)
85
+ if (@page = Page.find_by_menu_match("^/maintenance$", :include => [:parts, :slugs])).present?
86
+ render :template => "/pages/show", :status => 503
87
+ else
88
+ render :text => "Our website is currently down for maintenance. Please try back soon."
89
+ end
90
+ end
91
+ end
92
+
80
93
  end
@@ -11,7 +11,7 @@ require_dependency 'refinery/base_presenter'
11
11
 
12
12
  [ Refinery.root.join("vendor", "plugins", "*", "app", "presenters").to_s,
13
13
  Rails.root.join("vendor", "plugins", "*", "app", "presenters").to_s,
14
- Rails.root.join("app", "presenters").to_s
14
+ Rails.root.join("app", "presenters").to_s
15
15
  ].uniq.each do |path|
16
16
  Dir[path].each do |presenters_path|
17
17
  $LOAD_PATH << presenters_path
@@ -80,4 +80,4 @@ class RefinerySetting < ActiveRecord::Base
80
80
  self[:value] = new_value
81
81
  end
82
82
 
83
- end
83
+ end
@@ -1,7 +1,7 @@
1
1
  <%= error_messages_for :refinery_setting %>
2
2
  <% form_for [:admin, @refinery_setting] do |f| %>
3
3
  <div class='field'>
4
- <% if params[:action] =~ /(new)|(create)/ %>
4
+ <% if action_name =~ /(new)|(create)/ %>
5
5
  <%= f.label :name %>
6
6
  <%= f.text_field :name, :class => "larger", :size => 67 %>
7
7
  <% else %>
@@ -13,4 +13,4 @@
13
13
  :title => 'Remove this setting forever' if refinery_setting.destroyable %>
14
14
  </span>
15
15
  </span>
16
- </li>
16
+ </li>
@@ -24,4 +24,4 @@
24
24
  <% end %>
25
25
  </p>
26
26
  <% end %>
27
- </div>
27
+ </div>
@@ -4,7 +4,7 @@
4
4
  :html => {:multipart => true} do |f| -%>
5
5
  <div class='field'>
6
6
  <%= f.label :uploaded_data, 'File to upload' -%>
7
- <% if params[:action] =~ /(edit)|(update)/ -%>
7
+ <% if action_name =~ /(edit)|(update)/ -%>
8
8
  <%= link_to "Download current file", @resource.public_filename, {:title => @resource.title} -%>
9
9
  <em>or</em>, replace it with this one...
10
10
  <% end -%>
@@ -12,4 +12,4 @@
12
12
  :title => "Remove this file forever" %>
13
13
  </span>
14
14
  </span>
15
- </li>
15
+ </li>
@@ -4,26 +4,29 @@ config.middleware.use "ThemeServer"
4
4
  ::Refinery::ApplicationController.module_eval do
5
5
 
6
6
  # Add or remove theme paths to/from Refinery application
7
- before_filter do |controller|
7
+ prepend_before_filter :attach_theme_to_refinery
8
+
9
+ def attach_theme_to_refinery
8
10
  # remove any paths relating to any theme.
9
- controller.view_paths.reject! { |v| v.to_s =~ %r{^themes/} }
11
+ view_paths.reject! { |v| v.to_s =~ %r{^themes/} }
10
12
 
11
13
  # add back theme paths if there is a theme present.
12
- if (theme = Theme.current_theme(controller.request.env)).present?
14
+ if (theme = Theme.current_theme(request.env)).present?
13
15
  # Set up view path again for the current theme.
14
- controller.view_paths.unshift Rails.root.join("themes", theme, "views").to_s
16
+ view_paths.unshift Rails.root.join("themes", theme, "views").to_s
15
17
 
16
18
  # Ensure that routes within the application are top priority.
17
19
  # Here we grab all the routes that are under the application's view folder
18
20
  # and promote them ahead of any other path.
19
- controller.view_paths.select{|p| p.to_s =~ /^app\/views/}.each do |app_path|
20
- controller.view_paths.unshift app_path
21
+ view_paths.select{|p| p.to_s =~ /^app\/views/}.each do |app_path|
22
+ view_paths.unshift app_path
21
23
  end
22
24
  end
23
25
 
24
26
  # Set up menu caching for this theme or lack thereof
25
27
  RefinerySetting[:refinery_menu_cache_action_suffix] = "#{"#{theme}_" if theme.present?}site_menu" if RefinerySetting.table_exists?
26
28
  end
29
+ protected :attach_theme_to_refinery
27
30
 
28
31
  end
29
32
 
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 9
8
8
  - 6
9
- - 29
10
- version: 0.9.6.29
9
+ - 30
10
+ version: 0.9.6.30
11
11
  platform: ruby
12
12
  authors:
13
13
  - Resolve Digital
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-04-15 00:00:00 +12:00
20
+ date: 2010-04-16 00:00:00 +12:00
21
21
  default_executable:
22
22
  dependencies: []
23
23