tb_cms 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71c7f1ff25083a54d690e16a3ddd75126bc67cbc
4
- data.tar.gz: f6c6451194dbd039b601e24676951249c08530a0
3
+ metadata.gz: 9c7c821abf433b7551fd0945474f55285c337bc4
4
+ data.tar.gz: 945f3a55ef2288ca26ef6fa3090573c153d5d6ea
5
5
  SHA512:
6
- metadata.gz: 586998011f575c2f7943e91df9c37372db0e4c8cf499104a1b0d5088cd4ec22ed45607b5403d2cb014609cfdb464109f19e3469320aac350877b6b602272b3c0
7
- data.tar.gz: 8e837878a843444b59001314982a60f046f984961675629f1af7ea4dd414c898317cc00038636a8ec60029178b6224065cefda0f8035b3af9d94c34e4a9ed8fd
6
+ metadata.gz: 5da1e47e8ad75547832558aa1b4ece99367437ef577189daf24c0f569189a256a7f67320ff61e13bfab42774edd24279c489447294e95cc09ef3bdbc124111b4
7
+ data.tar.gz: fd87881e33441d399c6ab0ae5e435e3f8d383119844e628fc3734f50e5d9f904c79d77f78d410123c16e12653478f76803d4cb992e942154ed8ff8abce72551c
@@ -24,6 +24,9 @@ var clickedPreviewButton = function(e){
24
24
  form.target = '';
25
25
  form.onSubmit = null;
26
26
  previewInput.val(0);
27
+ form.querySelectorAll('.btn').forEach(function(btn) {
28
+ btn.disabled = false;
29
+ });
27
30
  }, 200);
28
31
  };
29
32
 
@@ -1,7 +1,7 @@
1
1
  class SpudMenuItem < ActiveRecord::Base
2
- belongs_to :parent, polymorphic: true
3
- belongs_to :spud_menu, touch: true
4
- belongs_to :spud_page
2
+ belongs_to :parent, polymorphic: true, required: false
3
+ belongs_to :spud_menu, touch: true, required: false
4
+ belongs_to :spud_page, required: false
5
5
  has_many :spud_menu_items, as: :parent, dependent: :destroy
6
6
 
7
7
  validates :name, presence: true
@@ -3,12 +3,19 @@ class SpudPage < ActiveRecord::Base
3
3
  include TbRedirects::HasRedirects
4
4
 
5
5
  spud_searchable
6
- belongs_to :spud_page
6
+ belongs_to :spud_page,
7
+ required: false
7
8
  has_many :spud_page_partial_revisions
8
9
  has_many :spud_pages, dependent: :nullify
9
10
  has_many :spud_page_partials, dependent: :destroy
10
- belongs_to :created_by_user, class_name: 'SpudUser', foreign_key: :created_by
11
- belongs_to :updated_by_user, class_name: 'SpudUser', foreign_key: :updated_by
11
+ belongs_to :created_by_user,
12
+ class_name: 'SpudUser',
13
+ foreign_key: :created_by,
14
+ required: false
15
+ belongs_to :updated_by_user,
16
+ class_name: 'SpudUser',
17
+ foreign_key: :updated_by,
18
+ required: false
12
19
 
13
20
  before_validation :generate_url_name
14
21
  validates :name, presence: true, uniqueness: { scope: :spud_page_id }
@@ -66,13 +73,13 @@ class SpudPage < ActiveRecord::Base
66
73
  end
67
74
 
68
75
  def create_redirect_if_necessary
69
- if url_name_changed?
70
- TbRedirect.create_smart(source: "/#{url_name_was}",
76
+ if saved_change_to_attribute?(:url_name)
77
+ TbRedirect.create_smart(source: "/#{attribute_before_last_save(:url_name)}",
71
78
  destination: "/#{url_name}",
72
79
  created_by: 'cms',
73
80
  owner: self)
74
81
  end
75
- return true
82
+ true
76
83
  end
77
84
 
78
85
  end
@@ -1,20 +1,17 @@
1
-
2
1
  <%=content_for :head do%>
3
- <meta name="description" content="<%=@page.meta_description%>" />
4
-
5
- <meta name="keywords" content="<%=@page.meta_keywords%>" />
2
+ <meta name="description" content="<%=@page.meta_description%>" />
3
+ <meta name="keywords" content="<%=@page.meta_keywords%>" />
6
4
  <% end %>
7
5
 
8
- <%if !@inline.blank?%>
9
- <%=render :inline => @inline%>
6
+ <% if !@inline.blank? %>
7
+ <%= render :inline => @inline %>
10
8
  <% end %>
11
- <%@page.spud_page_partials.each do |page_partial|%>
12
-
13
- <%if(page_partial.name.downcase == 'body' && Spud::Cms.yield_body_as_content_block == false)%>
14
- <%=page_partial.postprocess_content.html_safe%>
15
- <%else%>
16
- <%=content_for page_partial.name.parameterize.underscore.to_sym do%>
17
- <%=page_partial.postprocess_content.html_safe%>
18
- <% end %>
19
- <% end %>
9
+ <% @page.spud_page_partials.each do |page_partial| %>
10
+ <% if page_partial.name.downcase == 'body' && Spud::Cms.yield_body_as_content_block == false %>
11
+ <%= page_partial.content.html_safe %>
12
+ <% else %>
13
+ <%= content_for page_partial.name.parameterize.underscore.to_sym do %>
14
+ <%= page_partial.content.html_safe %>
15
+ <% end %>
16
+ <% end %>
20
17
  <% end %>
@@ -1,5 +1,5 @@
1
1
  module Spud
2
2
  module Cms
3
- VERSION = '1.3.1'.freeze
3
+ VERSION = '1.3.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tb_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moser Consulting
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-06 00:00:00.000000000 Z
11
+ date: 2017-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0.1
19
+ version: 5.1.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.0.1
26
+ version: 5.1.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: tb_core
29
29
  requirement: !ruby/object:Gem::Requirement