comfortable_mexican_sofa 1.2.8 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/Gemfile +1 -1
  2. data/README.md +1 -1
  3. data/VERSION +1 -1
  4. data/app/assets/javascripts/comfortable_mexican_sofa/application.js +3 -3
  5. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/jquery.wymeditor.cms.js +1 -1
  6. data/app/assets/stylesheets/comfortable_mexican_sofa/structure.css +1 -1
  7. data/app/controllers/cms_admin/base_controller.rb +22 -25
  8. data/app/controllers/cms_admin/layouts_controller.rb +21 -21
  9. data/app/controllers/cms_admin/pages_controller.rb +29 -29
  10. data/app/controllers/cms_admin/revisions_controller.rb +6 -6
  11. data/app/controllers/cms_admin/sites_controller.rb +21 -20
  12. data/app/controllers/cms_admin/snippets_controller.rb +19 -20
  13. data/app/controllers/cms_admin/uploads_controller.rb +6 -6
  14. data/app/controllers/cms_content_controller.rb +30 -16
  15. data/app/models/cms/layout.rb +2 -9
  16. data/app/models/cms/site.rb +11 -6
  17. data/app/views/cms_admin/layouts/_form.html.erb +6 -6
  18. data/app/views/cms_admin/layouts/_index_branch.html.erb +10 -10
  19. data/app/views/cms_admin/layouts/edit.html.erb +6 -5
  20. data/app/views/cms_admin/layouts/index.html.erb +3 -3
  21. data/app/views/cms_admin/layouts/new.html.erb +3 -3
  22. data/app/views/cms_admin/pages/_form.html.erb +11 -11
  23. data/app/views/cms_admin/pages/_form_blocks.html.erb +3 -4
  24. data/app/views/cms_admin/pages/_index_branch.html.erb +15 -15
  25. data/app/views/cms_admin/pages/edit.html.erb +6 -5
  26. data/app/views/cms_admin/pages/index.html.erb +4 -4
  27. data/app/views/cms_admin/pages/new.html.erb +3 -3
  28. data/app/views/cms_admin/pages/toggle_branch.js.erb +3 -3
  29. data/app/views/cms_admin/revisions/show.html.erb +4 -4
  30. data/app/views/cms_admin/sites/_form.html.erb +5 -2
  31. data/app/views/cms_admin/sites/_mirrors.html.erb +6 -6
  32. data/app/views/cms_admin/sites/edit.html.erb +3 -3
  33. data/app/views/cms_admin/sites/index.html.erb +9 -9
  34. data/app/views/cms_admin/sites/new.html.erb +3 -3
  35. data/app/views/cms_admin/snippets/_form.html.erb +3 -3
  36. data/app/views/cms_admin/snippets/edit.html.erb +5 -5
  37. data/app/views/cms_admin/snippets/index.html.erb +9 -9
  38. data/app/views/cms_admin/snippets/new.html.erb +3 -3
  39. data/app/views/cms_admin/uploads/_file.html.erb +1 -1
  40. data/app/views/cms_admin/uploads/_index.html.erb +2 -2
  41. data/app/views/cms_admin/uploads/destroy.js.erb +1 -1
  42. data/app/views/layouts/cms_admin/_head.html.erb +2 -0
  43. data/app/views/layouts/cms_admin/_left.html.erb +6 -6
  44. data/comfortable_mexican_sofa.gemspec +10 -6
  45. data/config/boot.rb +3 -10
  46. data/config/initializers/comfortable_mexican_sofa.rb +14 -22
  47. data/config/locales/en.yml +179 -4
  48. data/config/locales/es.yml +179 -0
  49. data/config/routes.rb +25 -27
  50. data/db/migrate/01_create_cms.rb +8 -1
  51. data/db/migrate/upgrades/04_upgrade_to_1_3_0.rb +23 -0
  52. data/lib/comfortable_mexican_sofa/configuration.rb +15 -19
  53. data/lib/comfortable_mexican_sofa/fixtures.rb +12 -3
  54. data/lib/comfortable_mexican_sofa/form_builder.rb +7 -6
  55. data/lib/comfortable_mexican_sofa/is_mirrored.rb +9 -11
  56. data/lib/comfortable_mexican_sofa/tags/asset.rb +2 -2
  57. data/test/fixtures/cms/sites.yml +3 -1
  58. data/test/functional/cms_admin/base_controller_test.rb +18 -0
  59. data/test/functional/cms_admin/layouts_controller_test.rb +20 -19
  60. data/test/functional/cms_admin/pages_controller_test.rb +73 -71
  61. data/test/functional/cms_admin/revisions_controller_test.rb +23 -20
  62. data/test/functional/cms_admin/sites_controller_test.rb +8 -8
  63. data/test/functional/cms_admin/snippets_controller_test.rb +17 -16
  64. data/test/functional/cms_admin/uploads_controller_test.rb +3 -3
  65. data/test/integration/authentication_test.rb +4 -4
  66. data/test/integration/fixtures_test.rb +1 -1
  67. data/test/integration/mirrors_test.rb +15 -18
  68. data/test/integration/routing_extensions_test.rb +4 -19
  69. data/test/integration/sites_test.rb +67 -48
  70. data/test/test_helper.rb +26 -6
  71. data/test/unit/configuration_test.rb +5 -5
  72. data/test/unit/form_builder_test.rb +69 -0
  73. data/test/unit/mirrors_test.rb +2 -6
  74. data/test/unit/models/site_test.rb +30 -3
  75. metadata +55 -56
@@ -2,27 +2,27 @@ class CmsAdmin::UploadsController < CmsAdmin::BaseController
2
2
 
3
3
  skip_before_filter :load_fixtures
4
4
 
5
- before_filter :load_cms_upload, :only => :destroy
5
+ before_filter :load_upload, :only => :destroy
6
6
 
7
7
  def index
8
8
  render
9
9
  end
10
10
 
11
11
  def create
12
- @cms_upload = @cms_site.uploads.create!(:file => params[:file])
13
- render :partial => 'file', :object => @cms_upload
12
+ @upload = @site.uploads.create!(:file => params[:file])
13
+ render :partial => 'file', :object => @upload
14
14
  rescue ActiveRecord::RecordInvalid
15
15
  render :nothing => true, :status => :bad_request
16
16
  end
17
17
 
18
18
  def destroy
19
- @cms_upload.destroy
19
+ @upload.destroy
20
20
  end
21
21
 
22
22
  protected
23
23
 
24
- def load_cms_upload
25
- @cms_upload = @cms_site.uploads.find(params[:id])
24
+ def load_upload
25
+ @upload = @site.uploads.find(params[:id])
26
26
  rescue ActiveRecord::RecordNotFound
27
27
  render :nothing => true
28
28
  end
@@ -1,61 +1,75 @@
1
1
  class CmsContentController < ApplicationController
2
-
2
+
3
3
  before_filter :load_cms_site
4
4
  before_filter :load_fixtures
5
5
  before_filter :load_cms_page, :only => :render_html
6
6
  before_filter :load_cms_layout, :only => [:render_css, :render_js]
7
7
 
8
- caches_page :render_css, :render_js, :if => Proc.new { |c| ComfortableMexicanSofa.config.enable_caching }
9
-
10
8
  def render_html(status = 200)
11
9
  if layout = @cms_page.layout
12
10
  app_layout = layout.app_layout.blank?? false : layout.app_layout
13
11
  render :inline => @cms_page.content, :layout => app_layout, :status => status
14
12
  else
15
- render :text => 'Layout Not Found', :status => 404
13
+ render :text => I18n.t('cms.content.layout_not_found'), :status => 404
16
14
  end
17
15
  end
18
-
16
+
19
17
  def render_css
20
18
  render :text => @cms_layout.css, :content_type => 'text/css'
21
19
  end
22
-
20
+
23
21
  def render_js
24
22
  render :text => @cms_layout.js, :content_type => 'text/javascript'
25
23
  end
26
-
24
+
27
25
  protected
28
-
26
+
29
27
  def load_fixtures
30
28
  return unless ComfortableMexicanSofa.config.enable_fixtures
31
29
  ComfortableMexicanSofa::Fixtures.import_all(@cms_site.hostname)
32
30
  end
33
31
 
34
32
  def load_cms_site
35
- @cms_site = if ComfortableMexicanSofa.config.enable_multiple_sites
36
- Cms::Site.find_by_hostname(request.host.downcase)
33
+ @cms_site ||= Cms::Site.first if Cms::Site.count == 1
34
+ Cms::Site.find_all_by_hostname(request.host.downcase).each do |site|
35
+ if site.path.blank?
36
+ @cms_site = site
37
+ elsif "#{request.fullpath}/".match /^\/#{Regexp.escape(site.path.to_s)}\//
38
+ @cms_site = site
39
+ break
40
+ end
41
+ end unless @cms_site
42
+
43
+ if @cms_site
44
+ params[:cms_path].to_s.gsub!(/^#{@cms_site.path}/, '').gsub!(/^\//, '')
45
+ I18n.locale = @cms_site.locale
37
46
  else
38
- Cms::Site.first
47
+ I18n.locale = I18n.default_locale
48
+ render :text => I18n.t('cms.content.site_not_found'), :status => 404
39
49
  end
40
- render :text => 'Site Not Found', :status => 404 if !@cms_site
41
50
  end
42
51
 
52
+ def load_fixtures
53
+ return unless ComfortableMexicanSofa.config.enable_fixtures
54
+ ComfortableMexicanSofa::Fixtures.import_all(@cms_site.hostname)
55
+ end
56
+
43
57
  def load_cms_page
44
58
  @cms_page = @cms_site.pages.published.find_by_full_path!("/#{params[:cms_path]}")
45
59
  return redirect_to(@cms_page.target_page.full_path) if @cms_page.target_page
46
-
60
+
47
61
  rescue ActiveRecord::RecordNotFound
48
62
  if @cms_page = @cms_site.pages.published.find_by_full_path('/404')
49
63
  render_html(404)
50
64
  else
51
- render :text => 'Page Not Found', :status => 404
65
+ render :text => I18n.t('cms.content.page_not_found'), :status => 404
52
66
  end
53
67
  end
54
-
68
+
55
69
  def load_cms_layout
56
70
  @cms_layout = @cms_site.layouts.find_by_slug!(params[:id])
57
71
  rescue ActiveRecord::RecordNotFound
58
72
  render :nothing => true, :status => 404
59
73
  end
60
-
74
+
61
75
  end
@@ -12,8 +12,8 @@ class Cms::Layout < ActiveRecord::Base
12
12
 
13
13
  # -- Callbacks ------------------------------------------------------------
14
14
  before_validation :assign_label
15
- after_save :clear_cache, :clear_cached_page_content
16
- after_destroy :clear_cache, :clear_cached_page_content
15
+ after_save :clear_cached_page_content
16
+ after_destroy :clear_cached_page_content
17
17
 
18
18
  # -- Validations ----------------------------------------------------------
19
19
  validates :site_id,
@@ -71,13 +71,6 @@ protected
71
71
  self.label = self.label.blank?? self.slug.try(:titleize) : self.label
72
72
  end
73
73
 
74
- # After saving need to make sure that cached pages for css and js for this
75
- # layout and its children are gone. Good enough to avoid using cache sweepers.
76
- def clear_cache
77
- FileUtils.rm File.expand_path("cms-css/#{self.slug}.css", Rails.public_path), :force => true
78
- FileUtils.rm File.expand_path("cms-js/#{self.slug}.js", Rails.public_path), :force => true
79
- end
80
-
81
74
  # Forcing page content reload
82
75
  def clear_cached_page_content
83
76
  self.pages.each{ |page| page.save! }
@@ -10,24 +10,29 @@ class Cms::Site < ActiveRecord::Base
10
10
 
11
11
  # -- Callbacks ------------------------------------------------------------
12
12
  before_validation :assign_label
13
+ before_save :clean_path
13
14
 
14
15
  # -- Validations ----------------------------------------------------------
15
16
  validates :label,
16
17
  :presence => true
17
18
  validates :hostname,
18
19
  :presence => true,
19
- :uniqueness => true,
20
+ :uniqueness => { :scope => :path },
20
21
  :format => { :with => /^[\w\.\-]+$/ }
21
22
 
22
- # -- Class Methods --------------------------------------------------------
23
- def self.options_for_select
24
- Cms::Site.all.collect{|s| ["#{s.label} (#{s.hostname})", s.id]}
25
- end
23
+ # -- Scopes ---------------------------------------------------------------
24
+ scope :mirrored, where(:is_mirrored => true)
26
25
 
27
26
  protected
28
-
27
+
29
28
  def assign_label
30
29
  self.label = self.label.blank?? self.hostname : self.label
31
30
  end
32
31
 
32
+ def clean_path
33
+ self.path ||= ''
34
+ self.path.squeeze!('/')
35
+ self.path.gsub!(/\/$/, '')
36
+ end
37
+
33
38
  end
@@ -2,13 +2,13 @@
2
2
  <%= render :partial => 'cms_admin/uploads/index' %>
3
3
  <% end %>
4
4
 
5
- <%= form.text_field :label, :label => 'Layout Name', :id => (@cms_layout.new_record?? 'slugify' : nil)%>
5
+ <%= form.text_field :label, :id => (@layout.new_record?? 'slugify' : nil)%>
6
6
  <%= form.text_field :slug, :id => 'slug' %>
7
- <% if (options = Cms::Layout.options_for_select(@cms_site, @cms_layout)).present? %>
8
- <%= form.select :parent_id, [['---- Select Parent Layout ----', nil]] + options %>
7
+ <% if (options = Cms::Layout.options_for_select(@site, @layout)).present? %>
8
+ <%= form.select :parent_id, [["---- #{t('.select_parent_layout')} ----", nil]] + options %>
9
9
  <% end %>
10
10
  <% if (options = Cms::Layout.app_layouts_for_select).present? %>
11
- <%= form.select :app_layout, [['---- Select Application Layout ----', nil]] + options %>
11
+ <%= form.select :app_layout, [["---- #{t('.select_app_layout')} ----", nil]] + options %>
12
12
  <% end %>
13
13
 
14
14
  <%= form.text_area :content, :class => 'code' %>
@@ -16,5 +16,5 @@
16
16
  <%= form.text_area :js, :class => 'code js' %>
17
17
 
18
18
  <%= form.simple_field nil, nil, :class => 'submit_element' do %>
19
- <%= form.submit @cms_layout.new_record?? 'Create Layout' : 'Update Layout', :disable_builder => true %>
20
- <% end %>
19
+ <%= form.submit t(@layout.new_record?? '.create' : '.update'), :disable_builder => true %>
20
+ <% end %>
@@ -1,23 +1,23 @@
1
- <% cms_layout ||= index_branch %>
1
+ <% layout ||= index_branch %>
2
2
 
3
- <li id='cms_layout_<%= cms_layout.id %>'>
3
+ <li id='cms_layout_<%= layout.id %>'>
4
4
  <div class='item'>
5
5
  <div class='icon'></div>
6
6
  <div class='action_links'>
7
- <%= link_to 'Add Child Layout', new_cms_admin_layout_path(:parent_id => cms_layout.id) %>
8
- <%= link_to 'Edit', edit_cms_admin_layout_path(cms_layout) %>
9
- <%= link_to 'Delete', cms_admin_layout_path(cms_layout), :method => :delete, :confirm => 'Are you sure?' %>
7
+ <%= link_to t('.add_child_layout'), new_cms_admin_site_layout_path(@site, :parent_id => layout.id) %>
8
+ <%= link_to t('.edit'), edit_cms_admin_site_layout_path(@site, layout) %>
9
+ <%= link_to t('.delete'), cms_admin_site_layout_path(@site, layout), :method => :delete, :confirm => t('.are_you_sure') %>
10
10
  </div>
11
11
  <div class='label'>
12
- <%= link_to cms_layout.label, edit_cms_admin_layout_path(cms_layout) %>
12
+ <%= link_to layout.label, edit_cms_admin_site_layout_path(@site, layout) %>
13
13
  <div class='sublabel'>
14
- <%= link_to cms_layout.slug, edit_cms_admin_layout_path(cms_layout) %>
14
+ <%= link_to layout.slug, edit_cms_admin_site_layout_path(@site, layout) %>
15
15
  </div>
16
16
  </div>
17
17
  </div>
18
- <% if cms_layout.children.present? %>
18
+ <% if layout.children.present? %>
19
19
  <ul>
20
- <%= render :partial => 'index_branch', :collection => cms_layout.children %>
20
+ <%= render :partial => 'index_branch', :collection => layout.children %>
21
21
  </ul>
22
22
  <% end %>
23
- </li>
23
+ </li>
@@ -1,10 +1,11 @@
1
- <%= link_to span_tag(pluralize(@cms_layout.revisions.count, 'revision')), cms_admin_layout_revisions_path(@cms_layout), :class => 'big button' %>
2
- <h1> Editing Layout </h1>
1
+ <%= link_to span_tag(pluralize(@layout.revisions.count, t('.revision'))), cms_admin_site_layout_revisions_path(@site, @layout), :class => 'big button' %>
2
+
3
+ <h1><%= t('.title')%></h1>
3
4
 
4
5
  <% content_for :right_column do %>
5
- <%= render :partial => 'cms_admin/sites/mirrors', :object => @cms_layout %>
6
+ <%= render :partial => 'cms_admin/sites/mirrors', :object => @layout %>
6
7
  <% end %>
7
8
 
8
- <%= cms_form_for @cms_layout, :url => {:action => :update} do |form| %>
9
+ <%= cms_form_for @layout, :as => :layout, :url => {:action => :update} do |form| %>
9
10
  <%= render :partial => 'form', :object => form %>
10
- <% end %>
11
+ <% end %>
@@ -1,10 +1,10 @@
1
- <%= link_to span_tag('Create New Layout'), new_cms_admin_layout_path, :class => 'big button' %>
2
- <h1>Layouts</h1>
1
+ <%= link_to span_tag(t('.new_link')), new_cms_admin_site_layout_path(@site), :class => 'big button' %>
2
+ <h1><%= t('.title')%></h1>
3
3
 
4
4
  <% content_for :right_column do %>
5
5
  <%= render :partial => 'cms_admin/sites/mirrors' %>
6
6
  <% end %>
7
7
 
8
8
  <ul class='list'>
9
- <%= render :partial => 'index_branch', :collection => @cms_layouts %>
9
+ <%= render :partial => 'index_branch', :collection => @layouts %>
10
10
  </ul>
@@ -1,5 +1,5 @@
1
- <h1> New Layout </h1>
1
+ <h1><%= t('.title') %></h1>
2
2
 
3
- <%= cms_form_for @cms_layout, :url => {:action => :create} do |form| %>
3
+ <%= cms_form_for @layout, :as => :layout, :url => {:action => :create} do |form| %>
4
4
  <%= render :partial => 'form', :object => form %>
5
- <% end %>
5
+ <% end %>
@@ -2,27 +2,27 @@
2
2
  <div id='page_save' class='box'>
3
3
  <label>
4
4
  <input type='checkbox'/>
5
- Published
5
+ <%= Cms::Page.human_attribute_name(:is_published) %>
6
6
  </label>
7
7
  <button></button>
8
8
  </div>
9
9
  <%= render :partial => 'cms_admin/uploads/index' %>
10
10
  <% end %>
11
11
 
12
- <%= form.text_field :label, :id => (@cms_page.new_record?? 'slugify' : nil) %>
12
+ <%= form.text_field :label, :id => (@page.new_record?? 'slugify' : nil) %>
13
13
 
14
14
  <div class='page_form_extras'>
15
- <% unless @cms_site.pages.count == 0 || @cms_site.pages.root == @cms_page%>
15
+ <% unless @site.pages.count == 0 || @site.pages.root == @page%>
16
16
  <%= form.text_field :slug, :id => 'slug' %>
17
17
  <% end %>
18
- <% if (options = Cms::Layout.options_for_select(@cms_site)).present? %>
19
- <%= form.select :layout_id, options, {}, 'data-page-id' => @cms_page.id.to_i, :label => 'Layout' %>
18
+ <% if (options = Cms::Layout.options_for_select(@site)).present? %>
19
+ <%= form.select :layout_id, options, {}, 'data-page-id' => @page.id.to_i, :label => 'Layout' %>
20
20
  <% end %>
21
- <% if (options = Cms::Page.options_for_select(@cms_site, @cms_page)).present? %>
21
+ <% if (options = Cms::Page.options_for_select(@site, @page)).present? %>
22
22
  <%= form.select :parent_id, options %>
23
23
  <% end %>
24
- <% if (options = Cms::Page.options_for_select(@cms_site, @cms_page, nil, 0, false)).present? %>
25
- <%= form.select :target_page_id, [['---- No Redirect ----', nil]] + options, :label => 'Redirect To Page' %>
24
+ <% if (options = Cms::Page.options_for_select(@site, @page, nil, 0, false)).present? %>
25
+ <%= form.select :target_page_id, [["---- #{t('.select_target_page')} ----", nil]] + options %>
26
26
  <% end %>
27
27
  <%= cms_hook :page_form, :object => form %>
28
28
  </div>
@@ -31,7 +31,7 @@
31
31
 
32
32
  <%= form.simple_field nil, nil, :class => 'submit_element' do %>
33
33
  <%= form.check_box :is_published, :disable_builder => true %>
34
- <%= form.label_for :is_published, :label => 'Published' %>
35
- <%= form.submit 'Preview', :name => 'preview', :id => nil, :disable_builder => true %>
36
- <%= form.submit @cms_page.new_record? ? 'Create Page' : 'Update Page', :id => 'cms_page_submit', :disable_builder => true %>
34
+ <%= form.label_for :is_published %>
35
+ <%= form.submit t('.preview'), :name => 'preview', :id => nil, :disable_builder => true %>
36
+ <%= form.submit t(@page.new_record?? '.create' : '.update'), :id => 'cms_page_submit', :disable_builder => true %>
37
37
  <% end %>
@@ -1,11 +1,10 @@
1
- <% block_tags = @cms_page.tags(true).select{ |t| t.is_cms_block? } %>
1
+ <% block_tags = @page.tags(true).select{ |t| t.is_cms_block? } %>
2
2
 
3
3
  <div id='form_blocks'>
4
4
  <% if block_tags.empty? %>
5
5
  <div class='no_tags'>
6
- <%= link_to @cms_page.layout.label, edit_cms_admin_layout_path(@cms_page.layout) %>
7
- Layout has no content tags defined. <br/>
8
- Edit the content to include a page or field tag, for example: <code>{{cms:page:content}}</code>
6
+ <%= link_to @page.layout.label, edit_cms_admin_site_layout_path(@site, @page.layout) %>
7
+ <%= t('.no_tags').html_safe %>
9
8
  </div>
10
9
  <% else %>
11
10
  <%= fields_for :blocks, nil, :builder => ComfortableMexicanSofa::FormBuilder do |cms_blocks| %>
@@ -1,39 +1,39 @@
1
1
  <%
2
- cms_page ||= index_branch
3
- has_children = cms_page.children.present?
4
- has_siblings = cms_page.siblings.present?
5
- branch_open = (session[:cms_page_tree] || []).member?(cms_page.id.to_s) || cms_page.root?
2
+ page ||= index_branch
3
+ has_children = page.children.present?
4
+ has_siblings = page.siblings.present?
5
+ branch_open = (session[:cms_page_tree] || []).member?(page.id.to_s) || page.root?
6
6
  %>
7
7
 
8
- <li id='<%= dom_id(cms_page) %>'>
8
+ <li id='<%= dom_id(page) %>'>
9
9
  <div class='item'>
10
10
  <div class='toggle <%= 'open' if branch_open %>'>
11
11
  <%=
12
- if has_children && !cms_page.root?
13
- link_to span_tag('toggle'), toggle_branch_cms_admin_page_path(cms_page), :remote => true
12
+ if has_children && !page.root?
13
+ link_to span_tag(t('.toggle')), toggle_branch_cms_admin_site_page_path(@site, page), :remote => true
14
14
  end
15
15
  %>
16
16
  </div>
17
17
  <div class='icon'>
18
18
  <% if has_siblings %>
19
- <div class='dragger'><span>drag</span></div>
19
+ <div class='dragger'><span><%= t('cms.views.pages.drag') %></span></div>
20
20
  <% end %>
21
21
  </div>
22
22
  <div class='action_links'>
23
- <%= link_to 'Add Child Page', new_cms_admin_page_path(:parent_id => cms_page.id) %>
24
- <%= link_to 'Edit', edit_cms_admin_page_path(cms_page) %>
25
- <%= link_to 'Delete', cms_admin_page_path(cms_page), :method => :delete, :confirm => 'Are you sure?' %>
23
+ <%= link_to t('.add_page'), new_cms_admin_site_page_path(@site, :parent_id => page.id) %>
24
+ <%= link_to t('.edit'), edit_cms_admin_site_page_path(@site, page) %>
25
+ <%= link_to t('.delete'), cms_admin_site_page_path(@site, page), :method => :delete, :confirm => t('.are_you_sure') %>
26
26
  </div>
27
27
  <div class='label'>
28
- <%= link_to cms_page.label, edit_cms_admin_page_path(cms_page) %>
28
+ <%= link_to page.label, edit_cms_admin_site_page_path(@site, page) %>
29
29
  <div class='sublabel'>
30
- <%= link_to cms_page.url, cms_page.full_path, :target => '_blank' %>
30
+ <%= link_to page.url, page.full_path, :target => '_blank' %>
31
31
  </div>
32
32
  </div>
33
33
  </div>
34
34
  <% if has_children && branch_open %>
35
35
  <ul>
36
- <%= render :partial => 'index_branch', :collection => cms_page.children %>
36
+ <%= render :partial => 'index_branch', :collection => page.children %>
37
37
  </ul>
38
38
  <% end %>
39
- </li>
39
+ </li>
@@ -1,10 +1,11 @@
1
- <%= link_to span_tag(pluralize(@cms_page.revisions.count, 'revision')), cms_admin_page_revisions_path(@cms_page), :class => 'big button' %>
2
- <h1> Editing Page </h1>
1
+ <%= link_to span_tag(pluralize(@page.revisions.count, t('.revision'))), cms_admin_site_page_revisions_path(@site, @page), :class => 'big button' %>
2
+
3
+ <h1><%= t('.title') %></h1>
3
4
 
4
5
  <% content_for :right_column do %>
5
- <%= render :partial => 'cms_admin/sites/mirrors', :object => @cms_page %>
6
+ <%= render :partial => 'cms_admin/sites/mirrors', :object => @page %>
6
7
  <% end %>
7
8
 
8
- <%= cms_form_for @cms_page, :url => {:action => :update} do |form| %>
9
+ <%= cms_form_for @page, :as => :page, :url => {:action => :update} do |form| %>
9
10
  <%= render :partial => 'form', :object => form %>
10
- <% end %>
11
+ <% end %>
@@ -1,10 +1,10 @@
1
- <%= link_to span_tag('Create New Page'), new_cms_admin_page_path, :class => 'big button' %>
2
- <h1>Pages</h1>
1
+ <%= link_to span_tag(t('.new_link')), new_cms_admin_site_page_path(@site), :class => 'big button' %>
2
+ <h1><%= t('.title')%></h1>
3
3
 
4
4
  <% content_for :right_column do %>
5
5
  <%= render :partial => 'cms_admin/sites/mirrors' %>
6
6
  <% end %>
7
7
 
8
8
  <ul class='list sortable'>
9
- <%= render :partial => 'index_branch', :collection => @cms_pages %>
10
- </ul>
9
+ <%= render :partial => 'index_branch', :collection => @pages %>
10
+ </ul>