refinerycms-core 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -419,9 +419,9 @@ var link_dialog = {
419
419
  });
420
420
  }
421
421
  }
422
- });
423
422
 
424
- $('.form-actions-dialog #cancel_button').trigger('click');
423
+ $('.form-actions-dialog #cancel_button').trigger('click');
424
+ });
425
425
  },
426
426
 
427
427
  init_close: function(){
@@ -7,4 +7,5 @@
7
7
  <script> DD_belatedPNG.fix('img, .png_bg'); //fix any <img> or .png_bg background-images </script>
8
8
  <![endif]-->
9
9
  <% end %>
10
+ <%= javascript_include_tag 'application' %>
10
11
  <%= yield :javascripts -%>
@@ -1,4 +1,4 @@
1
- Refinery::Core::Engine.routes.draw do
1
+ Refinery::Core::Engine.routes.append do
2
2
  <% unless skip_frontend? %>
3
3
  # Frontend routes
4
4
  namespace :<%= namespacing.underscore %> do
@@ -6,13 +6,10 @@ module Refinery
6
6
 
7
7
  engine_name :refinery_<%= extension_plural_name %>
8
8
 
9
- initializer "register refinerycms_<%= plural_name %> plugin" do |app|
9
+ initializer "register refinerycms_<%= plural_name %> plugin" do
10
10
  Refinery::Plugin.register do |plugin|
11
11
  plugin.name = "<%= plural_name %>"
12
- plugin.url = {
13
- :controller => 'refinery/<%= namespacing.underscore %>/admin/<%= plural_name %>',
14
- :action => 'index'
15
- }
12
+ plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.<%= namespacing.underscore %>_admin_<%= plural_name %>_path }
16
13
  plugin.pathname = root
17
14
  plugin.activity = {
18
15
  :class_name => :'refinery/<%= namespacing.underscore %>/<%= singular_name %>'<% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? and title.name != 'title' %>,
@@ -22,15 +22,15 @@ module Refinery
22
22
  if @<%= singular_name %>.save
23
23
  begin
24
24
  Mailer.notification(@<%= singular_name %>, request).deliver
25
- rescue
26
- logger.warn "There was an error delivering an <%= singular_name %> notification.\n#{$!}\n"
25
+ rescue => e
26
+ logger.warn "There was an error delivering the <%= singular_name %> notification.\n#{e.message}\n"
27
27
  end<% if @includes_spam %> if @<%= singular_name %>.ham?<% end %>
28
28
 
29
29
  if <%= class_name %>.column_names.map(&:to_s).include?('email')
30
30
  begin
31
31
  Mailer.confirmation(@<%= singular_name %>, request).deliver
32
- rescue
33
- logger.warn "There was an error delivering an foo confirmation:\n#{$!}\n"
32
+ rescue => e
33
+ logger.warn "There was an error delivering the <%= singular_name %> confirmation:\n#{e.message}\n"
34
34
  end<% if @includes_spam %> if @<%= singular_name %>.ham?<% end %>
35
35
  else
36
36
  logger.warn "Please add an 'email' field to <%= class_name %> if you wish to send confirmation emails when forms are submitted."
@@ -1,4 +1,4 @@
1
- Refinery::Core::Engine.routes.draw do
1
+ Refinery::Core::Engine.routes.append do
2
2
  # Frontend routes
3
3
  namespace :<%= namespacing.underscore %> do
4
4
  resources :<%= plural_name %><%= ", :path => ''" if namespacing.underscore == plural_name %>, :only => [:new, :create] do
@@ -6,13 +6,10 @@ module Refinery
6
6
 
7
7
  engine_name :refinery_<%= extension_plural_name %>
8
8
 
9
- initializer "register refinerycms_<%= plural_name %> plugin" do |app|
9
+ initializer "register refinerycms_<%= plural_name %> plugin" do
10
10
  Refinery::Plugin.register do |plugin|
11
11
  plugin.name = "<%= plural_name %>"
12
- plugin.url = {
13
- :controller => 'refinery/<%= namespacing.underscore %>/admin/<%= plural_name %>',
14
- :action => 'index'
15
- }
12
+ plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.<%= namespacing.underscore %>_admin_<%= plural_name %>_path }
16
13
  plugin.pathname = root
17
14
  plugin.activity = {
18
15
  :class_name => :'refinery/<%= namespacing.underscore %>/<%= singular_name %>'<% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? and title.name != 'title' %>,
@@ -138,6 +138,16 @@ module Refinery
138
138
  config.after_initialize do
139
139
  Refinery.register_extension(Refinery::Core)
140
140
  end
141
+
142
+ # We need to reload the routes here due to how Refinery sets them up
143
+ # The different facets of Refinery (dashboard, pages, etc.) append/prepend routes to Core
144
+ # *after* Core has been loaded.
145
+ #
146
+ # So we wait until after initialization is complete to do one final reload
147
+ # This then makes the appended/prepended routes available to the application.
148
+ config.after_initialize do
149
+ Rails.application.routes_reloader.reload!
150
+ end
141
151
  end
142
152
  end
143
153
  end
@@ -66,7 +66,14 @@ module Refinery
66
66
  else
67
67
  { :controller => "refinery/admin/#{name}" }
68
68
  end
69
- @url.is_a?(Hash) ? {:only_path => true}.merge(@url) : @url
69
+
70
+ if @url.is_a?(Hash)
71
+ {:only_path => true}.merge(@url)
72
+ elsif @url.respond_to?(:call)
73
+ @url.call
74
+ else
75
+ @url
76
+ end
70
77
  end
71
78
 
72
79
  # Make this protected, so that only Plugin.register can use it.
@@ -2,7 +2,7 @@ module Refinery
2
2
  class Version
3
3
  @major = 2
4
4
  @minor = 0
5
- @tiny = 0
5
+ @tiny = 1
6
6
  @build = nil
7
7
 
8
8
  class << self
data/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright (c) 2005-2011 [Resolve Digital](http://www.resolvedigital.com)
3
+ Copyright (c) 2005-2012 [Resolve Digital](http://www.resolvedigital.com)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-core
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 0
10
- version: 2.0.0
9
+ - 1
10
+ version: 2.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Philip Arndt
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2012-03-01 00:00:00 Z
21
+ date: 2012-03-06 00:00:00 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
24
  prerelease: false