spud_cms 0.3.7 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,15 +8,16 @@
8
8
  // All this logic will automatically be available in application.js.
9
9
 
10
10
  $(function() {
11
- initWysiwym();
12
-
11
+ // initWysiwym();
12
+ initTinyMCE();
13
13
  $("#spud_page_template_id").bind('change', function() {
14
14
  var $this = $(this);
15
15
  $.get($this.attr("data-source"), { template: $this.val() }, function(data) {
16
16
  $('.formtabs').tabs('destroy');
17
17
  $("#page_partials_form").replaceWith(data)
18
18
  initFormTabs();
19
- initWysiwym();
19
+ initTinyMCE();
20
+ // initWysiwym();
20
21
  }, 'text').error(function(jqXHR) {
21
22
  $('<p> Error: ' + jqXHR.responseText + '</p>').dialog();
22
23
  });
@@ -1,4 +1,5 @@
1
1
  class PagesController < ApplicationController
2
+ caches_page :show,:expires_in => Spud::Cms.page_cache_expires_in, :if => Proc.new { |c| Spud::Cms.enable_full_page_caching }
2
3
  def show
3
4
  url_name = !params[:id].blank? ? params[:id] : Spud::Cms.root_page_name
4
5
  @page = SpudPage.published_pages.where(:url_name => url_name).includes([:spud_template,:spud_page_partials]).first
@@ -40,7 +40,7 @@ class Spud::Admin::MenuItemsController < Spud::Admin::ApplicationController
40
40
  end
41
41
  end
42
42
  flash[:notice] = "Menu Created successfully!" if @menu_item.save
43
-
43
+
44
44
  respond_with @menu_item,:location => spud_admin_menu_menu_items_url
45
45
  end
46
46
 
@@ -72,6 +72,7 @@ class Spud::Admin::MenuItemsController < Spud::Admin::ApplicationController
72
72
  def destroy
73
73
 
74
74
  flash[:notice] = "Menu Item removed!" if @menu_item.destroy
75
+
75
76
  respond_with @menu_item,:location => spud_admin_menu_menu_items_url
76
77
  end
77
78
  private
@@ -30,6 +30,7 @@ class Spud::Admin::MenusController < Spud::Admin::ApplicationController
30
30
 
31
31
  def update
32
32
  add_breadcrumb "Edit #{@menu.name}", :edit_spud_admin_menu_path
33
+
33
34
  flash[:notice] = "Menu saved successfully" if @menu.update_attributes(params[:spud_menu])
34
35
  respond_with @menu,:location => spud_admin_menu_menu_items_url(:menu_id => @menu.id)
35
36
  end
@@ -72,6 +72,7 @@ class Spud::Admin::PagesController < Spud::Admin::ApplicationController
72
72
  end
73
73
 
74
74
  def update
75
+ expire_page page_path(:id => @page.url_name)
75
76
  if @page.update_attributes(params[:spud_page])
76
77
  flash[:notice] = "Page updated successfully!"
77
78
  redirect_to spud_admin_pages_url() and return
@@ -84,6 +85,8 @@ class Spud::Admin::PagesController < Spud::Admin::ApplicationController
84
85
 
85
86
  def destroy
86
87
  status = 500
88
+ expire_page page_path(:id => @page.url_name)
89
+
87
90
  if @page.destroy
88
91
  flash[:notice] = "Page removed successfully!"
89
92
  status = 200
@@ -35,12 +35,14 @@ class Spud::Admin::TemplatesController < Spud::Admin::ApplicationController
35
35
  def update
36
36
  add_breadcrumb "Edit #{@template.name}", :edit_spud_admin_template_path
37
37
  flash[:notice] = "Template updated successfully" if @template.update_attributes(params[:spud_template])
38
+
38
39
  respond_with @template, :location => spud_admin_templates_url
39
40
  end
40
41
 
41
42
 
42
43
  def destroy
43
44
  flash[:notice] = "Template removed" if @template.destroy
45
+
44
46
  respond_with @template, :location => spud_admin_templates_url
45
47
  end
46
48
 
@@ -12,7 +12,7 @@
12
12
  <%=f.fields_for :spud_page_partials do |b|%>
13
13
  <div class="formtab">
14
14
  <%=b.hidden_field :name,:class => "tab_name"%>
15
- <%=b.text_area :content,:class => "wysiwym"%>
15
+ <%=b.text_area :content,:class => "wysiwym tinymce"%>
16
16
  </div>
17
17
  <%end%>
18
18
  </div>
@@ -5,7 +5,7 @@
5
5
  <% spud_page_partials.each_with_index do |spud_page_partial, index| %>
6
6
  <div class="formtab">
7
7
  <input type="hidden" class="tab_name" name="spud_page[spud_page_partials_attributes][<%= index %>][name]" value="<%= spud_page_partial.name %>" />
8
- <textarea class="wysiwym" name="spud_page[spud_page_partials_attributes][<%= index %>][content]">
8
+ <textarea class="wysiwym tinymce" name="spud_page[spud_page_partials_attributes][<%= index %>][content]">
9
9
  <%= spud_page_partial.content %>
10
10
  </textarea>
11
11
  </div>
@@ -2,7 +2,7 @@ module Spud
2
2
  module Cms
3
3
  include ActiveSupport::Configurable
4
4
 
5
- config_accessor :menus_enabled,:templates_enabled,:root_page_name,:default_page_parts,:yield_body_as_content_block,:default_page_layout,:enable_sitemap
5
+ config_accessor :menus_enabled,:templates_enabled,:root_page_name,:default_page_parts,:yield_body_as_content_block,:default_page_layout,:enable_sitemap,:enable_full_page_caching,:page_cache_expires_in
6
6
 
7
7
  self.root_page_name = "home"
8
8
  self.menus_enabled = true
@@ -10,6 +10,8 @@ module Spud
10
10
  self.default_page_layout = 'application'
11
11
  self.default_page_parts = ["Body"]
12
12
  self.yield_body_as_content_block = false
13
+ self.enable_full_page_caching = false
14
+ self.page_cache_expires_in = 10.minutes
13
15
  self.enable_sitemap = true
14
16
  end
15
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spud_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-23 00:00:00.000000000 Z
12
+ date: 2012-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spud_core
16
- requirement: &70335492794560 !ruby/object:Gem::Requirement
16
+ requirement: &70189195378020 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.5.3
21
+ version: 0.6.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70335492794560
24
+ version_requirements: *70189195378020
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: codemirror-rails
27
- requirement: &70335492794080 !ruby/object:Gem::Requirement
27
+ requirement: &70189195377540 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70335492794080
35
+ version_requirements: *70189195377540
36
36
  description:
37
37
  email: destes@redwindsw.com
38
38
  executables: []