comfortable_mexican_sofa 1.0.29 → 1.0.30

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.29
1
+ 1.0.30
@@ -9,7 +9,7 @@
9
9
  <%= form.text_field :slug, :id => 'slug' %>
10
10
  <% end %>
11
11
  <% if (options = CmsLayout.options_for_select(@cms_site)).present? %>
12
- <%= form.select :cms_layout_id, options, {}, 'data-page-id' => @cms_page.id.to_i, 'data-path-prefix' => ComfortableMexicanSofa.config.admin_route_prefix, :label => 'Layout' %>
12
+ <%= form.select :cms_layout_id, options, {}, 'data-page-id' => @cms_page.id.to_i, :label => 'Layout' %>
13
13
  <% end %>
14
14
  <% if (options = CmsPage.options_for_select(@cms_site, @cms_page)).present? %>
15
15
  <%= form.select :parent_id, options %>
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{comfortable_mexican_sofa}
8
- s.version = "1.0.29"
8
+ s.version = "1.0.30"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Oleg Khabarov", "The Working Group Inc"]
@@ -6,7 +6,15 @@ class CmsGenerator < Rails::Generators::Base
6
6
  source_root File.expand_path('../../..', __FILE__)
7
7
 
8
8
  def generate_migration
9
- migration_template 'db/migrate/01_create_cms.rb', 'db/migrate/create_cms.rb'
9
+ destination = File.expand_path('db/migrate/01_create_cms.rb', self.destination_root)
10
+ migration_dir = File.dirname(destination)
11
+ destination = self.class.migration_exists?(migration_dir, 'create_cms')
12
+
13
+ if destination
14
+ puts "\e[0m\e[31mFound existing cms_create.rb migration. Remove it if you want to regenerate.\e[0m"
15
+ else
16
+ migration_template 'db/migrate/01_create_cms.rb', 'db/migrate/create_cms.rb'
17
+ end
10
18
  end
11
19
 
12
20
  def generate_initialization
@@ -1,5 +1,6 @@
1
1
  $.CMS = function(){
2
2
  var current_path = window.location.pathname;
3
+ var admin_path_prefix = current_path.split('/')[1]
3
4
 
4
5
  $(document).ready(function(){
5
6
 
@@ -35,7 +36,7 @@ $.CMS = function(){
35
36
  load_page_blocks: function(){
36
37
  $('select#cms_page_cms_layout_id').bind('change.cms', function() {
37
38
  $.ajax({
38
- url: ['/' + $(this).attr('data-path-prefix'), 'pages', $(this).attr('data-page-id'), 'form_blocks'].join('/'),
39
+ url: ['/' + admin_path_prefix, 'pages', $(this).attr('data-page-id'), 'form_blocks'].join('/'),
39
40
  data: ({
40
41
  layout_id: $(this).val()
41
42
  }),
@@ -93,7 +94,7 @@ $.CMS = function(){
93
94
  unique_names: true,
94
95
  multipart: true,
95
96
  multipart_params: { authenticity_token: auth_token, format: 'js' },
96
- url: '/cms-admin/uploads'
97
+ url: '/' + admin_path_prefix + '/uploads'
97
98
  });
98
99
  uploader.init();
99
100
  uploader.bind('FilesAdded', function(up, files) {
@@ -24,7 +24,6 @@ class CmsAdmin::PagesControllerTest < ActionController::TestCase
24
24
 
25
25
  assert_template :new
26
26
  assert_select 'form[action=/cms-admin/pages]'
27
- assert_select 'select[data-path-prefix=cms-admin]'
28
27
  end
29
28
 
30
29
  def test_get_new_with_field_datetime
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfortable_mexican_sofa
3
3
  version: !ruby/object:Gem::Version
4
- hash: 45
4
+ hash: 43
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 29
10
- version: 1.0.29
9
+ - 30
10
+ version: 1.0.30
11
11
  platform: ruby
12
12
  authors:
13
13
  - Oleg Khabarov