locomotive_cms 0.0.2.2 → 0.0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/admin/base_controller.rb +6 -1
- data/app/controllers/admin/passwords_controller.rb +2 -0
- data/app/controllers/admin/sessions_controller.rb +2 -0
- data/app/helpers/admin/base_helper.rb +1 -3
- data/app/helpers/admin/sites_helper.rb +2 -2
- data/lib/locomotive/engine.rb +2 -11
- metadata +3 -3
@@ -4,7 +4,7 @@ module Admin
|
|
4
4
|
include Locomotive::Routing::SiteDispatcher
|
5
5
|
|
6
6
|
layout 'admin/application'
|
7
|
-
|
7
|
+
|
8
8
|
before_filter :authenticate_admin!
|
9
9
|
|
10
10
|
before_filter :require_site
|
@@ -15,6 +15,11 @@ module Admin
|
|
15
15
|
|
16
16
|
helper_method :sections
|
17
17
|
|
18
|
+
# https://rails.lighthouseapp.com/projects/8994/tickets/1905-apphelpers-within-plugin-not-being-mixed-in
|
19
|
+
Dir[File.dirname(__FILE__) + "/../../helpers/**/*_helper.rb"].each do |file|
|
20
|
+
helper "admin/#{File.basename(file, '.rb').gsub(/_helper$/, '')}"
|
21
|
+
end
|
22
|
+
|
18
23
|
protected
|
19
24
|
|
20
25
|
def flash_success!(options = {})
|
@@ -1,5 +1,3 @@
|
|
1
|
-
puts "base helper loaded...."
|
2
|
-
|
3
1
|
module Admin::BaseHelper
|
4
2
|
|
5
3
|
def title(title = nil)
|
@@ -9,7 +7,7 @@ module Admin::BaseHelper
|
|
9
7
|
@content_for_title = title
|
10
8
|
''
|
11
9
|
end
|
12
|
-
end
|
10
|
+
end
|
13
11
|
|
14
12
|
def admin_menu_item(name, url)
|
15
13
|
label = content_tag(:em) + escape_once(' ') + t("admin.shared.menu.#{name}")
|
@@ -8,11 +8,11 @@ module Admin::SitesHelper
|
|
8
8
|
|
9
9
|
def main_site_url(site = current_site, options = {})
|
10
10
|
url = "http://#{site.subdomain}.#{Locomotive.config.default_domain}"
|
11
|
-
url += ":#{request.port}" if request.port != 80
|
11
|
+
url += ":#{request.port}" if request.port != 80
|
12
12
|
url = File.join(url, controller.request.fullpath) if options.has_key?(:uri) && options[:uri]
|
13
13
|
url
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
def error_on_domain(site, name)
|
17
17
|
if (error = (site.errors[:domains] || []).detect { |n| n.include?(name) })
|
18
18
|
content_tag(:span, error, :class => 'inline-errors')
|
data/lib/locomotive/engine.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
puts "...Locomotive engine loaded"
|
2
2
|
|
3
|
+
require 'mimetype_fu'
|
3
4
|
require 'liquid'
|
4
5
|
require 'devise'
|
5
6
|
require 'carrierwave'
|
@@ -7,21 +8,11 @@ require 'formtastic'
|
|
7
8
|
require 'mongoid'
|
8
9
|
require 'mongoid_acts_as_tree'
|
9
10
|
|
11
|
+
# FIXME: get rid of it once custom_fields is a gem
|
10
12
|
require File.dirname(__FILE__) + '/../../vendor/plugins/custom_fields/init.rb'
|
11
13
|
|
12
|
-
ActiveSupport.on_load(:action_view) {
|
13
|
-
Rails.logger.info "ActiveSupport.on_load(:action_view) / #{ActionController::Base.helpers_path.inspect}"
|
14
|
-
}
|
15
|
-
|
16
14
|
module Locomotive
|
17
15
|
class Engine < Rails::Engine
|
18
16
|
|
19
|
-
initializer "locomotive.add_helpers" do |app|
|
20
|
-
puts "locomotive.add_helpers"
|
21
|
-
path = [*ActionController::Base.helpers_path] << File.dirname(__FILE__) + "/../../app/helpers"
|
22
|
-
ActionController::Base.helpers_path = path
|
23
|
-
Rails.logger.info "locomotive.add_helpers / #{ActionController::Base.helpers_path.inspect}"
|
24
|
-
end
|
25
|
-
|
26
17
|
end
|
27
18
|
end
|
metadata
CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Didier Lafforgue
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-12 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|