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.
- data/Gemfile +1 -1
- data/README.md +1 -1
- data/VERSION +1 -1
- data/app/assets/javascripts/comfortable_mexican_sofa/application.js +3 -3
- data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/jquery.wymeditor.cms.js +1 -1
- data/app/assets/stylesheets/comfortable_mexican_sofa/structure.css +1 -1
- data/app/controllers/cms_admin/base_controller.rb +22 -25
- data/app/controllers/cms_admin/layouts_controller.rb +21 -21
- data/app/controllers/cms_admin/pages_controller.rb +29 -29
- data/app/controllers/cms_admin/revisions_controller.rb +6 -6
- data/app/controllers/cms_admin/sites_controller.rb +21 -20
- data/app/controllers/cms_admin/snippets_controller.rb +19 -20
- data/app/controllers/cms_admin/uploads_controller.rb +6 -6
- data/app/controllers/cms_content_controller.rb +30 -16
- data/app/models/cms/layout.rb +2 -9
- data/app/models/cms/site.rb +11 -6
- data/app/views/cms_admin/layouts/_form.html.erb +6 -6
- data/app/views/cms_admin/layouts/_index_branch.html.erb +10 -10
- data/app/views/cms_admin/layouts/edit.html.erb +6 -5
- data/app/views/cms_admin/layouts/index.html.erb +3 -3
- data/app/views/cms_admin/layouts/new.html.erb +3 -3
- data/app/views/cms_admin/pages/_form.html.erb +11 -11
- data/app/views/cms_admin/pages/_form_blocks.html.erb +3 -4
- data/app/views/cms_admin/pages/_index_branch.html.erb +15 -15
- data/app/views/cms_admin/pages/edit.html.erb +6 -5
- data/app/views/cms_admin/pages/index.html.erb +4 -4
- data/app/views/cms_admin/pages/new.html.erb +3 -3
- data/app/views/cms_admin/pages/toggle_branch.js.erb +3 -3
- data/app/views/cms_admin/revisions/show.html.erb +4 -4
- data/app/views/cms_admin/sites/_form.html.erb +5 -2
- data/app/views/cms_admin/sites/_mirrors.html.erb +6 -6
- data/app/views/cms_admin/sites/edit.html.erb +3 -3
- data/app/views/cms_admin/sites/index.html.erb +9 -9
- data/app/views/cms_admin/sites/new.html.erb +3 -3
- data/app/views/cms_admin/snippets/_form.html.erb +3 -3
- data/app/views/cms_admin/snippets/edit.html.erb +5 -5
- data/app/views/cms_admin/snippets/index.html.erb +9 -9
- data/app/views/cms_admin/snippets/new.html.erb +3 -3
- data/app/views/cms_admin/uploads/_file.html.erb +1 -1
- data/app/views/cms_admin/uploads/_index.html.erb +2 -2
- data/app/views/cms_admin/uploads/destroy.js.erb +1 -1
- data/app/views/layouts/cms_admin/_head.html.erb +2 -0
- data/app/views/layouts/cms_admin/_left.html.erb +6 -6
- data/comfortable_mexican_sofa.gemspec +10 -6
- data/config/boot.rb +3 -10
- data/config/initializers/comfortable_mexican_sofa.rb +14 -22
- data/config/locales/en.yml +179 -4
- data/config/locales/es.yml +179 -0
- data/config/routes.rb +25 -27
- data/db/migrate/01_create_cms.rb +8 -1
- data/db/migrate/upgrades/04_upgrade_to_1_3_0.rb +23 -0
- data/lib/comfortable_mexican_sofa/configuration.rb +15 -19
- data/lib/comfortable_mexican_sofa/fixtures.rb +12 -3
- data/lib/comfortable_mexican_sofa/form_builder.rb +7 -6
- data/lib/comfortable_mexican_sofa/is_mirrored.rb +9 -11
- data/lib/comfortable_mexican_sofa/tags/asset.rb +2 -2
- data/test/fixtures/cms/sites.yml +3 -1
- data/test/functional/cms_admin/base_controller_test.rb +18 -0
- data/test/functional/cms_admin/layouts_controller_test.rb +20 -19
- data/test/functional/cms_admin/pages_controller_test.rb +73 -71
- data/test/functional/cms_admin/revisions_controller_test.rb +23 -20
- data/test/functional/cms_admin/sites_controller_test.rb +8 -8
- data/test/functional/cms_admin/snippets_controller_test.rb +17 -16
- data/test/functional/cms_admin/uploads_controller_test.rb +3 -3
- data/test/integration/authentication_test.rb +4 -4
- data/test/integration/fixtures_test.rb +1 -1
- data/test/integration/mirrors_test.rb +15 -18
- data/test/integration/routing_extensions_test.rb +4 -19
- data/test/integration/sites_test.rb +67 -48
- data/test/test_helper.rb +26 -6
- data/test/unit/configuration_test.rb +5 -5
- data/test/unit/form_builder_test.rb +69 -0
- data/test/unit/mirrors_test.rb +2 -6
- data/test/unit/models/site_test.rb +30 -3
- 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 :
|
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
|
-
@
|
13
|
-
render :partial => 'file', :object => @
|
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
|
-
@
|
19
|
+
@upload.destroy
|
20
20
|
end
|
21
21
|
|
22
22
|
protected
|
23
23
|
|
24
|
-
def
|
25
|
-
@
|
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 => '
|
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
|
36
|
-
|
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
|
-
|
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 => '
|
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
|
data/app/models/cms/layout.rb
CHANGED
@@ -12,8 +12,8 @@ class Cms::Layout < ActiveRecord::Base
|
|
12
12
|
|
13
13
|
# -- Callbacks ------------------------------------------------------------
|
14
14
|
before_validation :assign_label
|
15
|
-
after_save :
|
16
|
-
after_destroy :
|
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! }
|
data/app/models/cms/site.rb
CHANGED
@@ -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 =>
|
20
|
+
:uniqueness => { :scope => :path },
|
20
21
|
:format => { :with => /^[\w\.\-]+$/ }
|
21
22
|
|
22
|
-
# --
|
23
|
-
|
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, :
|
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(@
|
8
|
-
<%= form.select :parent_id, [[
|
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, [[
|
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 @
|
20
|
-
<% end %>
|
19
|
+
<%= form.submit t(@layout.new_record?? '.create' : '.update'), :disable_builder => true %>
|
20
|
+
<% end %>
|
@@ -1,23 +1,23 @@
|
|
1
|
-
<%
|
1
|
+
<% layout ||= index_branch %>
|
2
2
|
|
3
|
-
<li id='cms_layout_<%=
|
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 '
|
8
|
-
<%= link_to '
|
9
|
-
<%= link_to '
|
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
|
12
|
+
<%= link_to layout.label, edit_cms_admin_site_layout_path(@site, layout) %>
|
13
13
|
<div class='sublabel'>
|
14
|
-
<%= link_to
|
14
|
+
<%= link_to layout.slug, edit_cms_admin_site_layout_path(@site, layout) %>
|
15
15
|
</div>
|
16
16
|
</div>
|
17
17
|
</div>
|
18
|
-
<% if
|
18
|
+
<% if layout.children.present? %>
|
19
19
|
<ul>
|
20
|
-
<%= render :partial => 'index_branch', :collection =>
|
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(@
|
2
|
-
|
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 => @
|
6
|
+
<%= render :partial => 'cms_admin/sites/mirrors', :object => @layout %>
|
6
7
|
<% end %>
|
7
8
|
|
8
|
-
<%= cms_form_for @
|
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('
|
2
|
-
<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 => @
|
9
|
+
<%= render :partial => 'index_branch', :collection => @layouts %>
|
10
10
|
</ul>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<h1
|
1
|
+
<h1><%= t('.title') %></h1>
|
2
2
|
|
3
|
-
<%= cms_form_for @
|
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
|
-
|
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 => (@
|
12
|
+
<%= form.text_field :label, :id => (@page.new_record?? 'slugify' : nil) %>
|
13
13
|
|
14
14
|
<div class='page_form_extras'>
|
15
|
-
<% unless @
|
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(@
|
19
|
-
<%= form.select :layout_id, options, {}, 'data-page-id' => @
|
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(@
|
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(@
|
25
|
-
<%= form.select :target_page_id, [[
|
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
|
35
|
-
<%= form.submit '
|
36
|
-
<%= form.submit @
|
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 = @
|
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 @
|
7
|
-
|
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
|
-
|
3
|
-
has_children =
|
4
|
-
has_siblings =
|
5
|
-
branch_open = (session[:cms_page_tree] || []).member?(
|
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(
|
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 && !
|
13
|
-
link_to span_tag('toggle'),
|
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
|
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 '
|
24
|
-
<%= link_to '
|
25
|
-
<%= link_to '
|
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
|
28
|
+
<%= link_to page.label, edit_cms_admin_site_page_path(@site, page) %>
|
29
29
|
<div class='sublabel'>
|
30
|
-
<%= link_to
|
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 =>
|
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(@
|
2
|
-
|
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 => @
|
6
|
+
<%= render :partial => 'cms_admin/sites/mirrors', :object => @page %>
|
6
7
|
<% end %>
|
7
8
|
|
8
|
-
<%= cms_form_for @
|
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('
|
2
|
-
<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 => @
|
10
|
-
</ul>
|
9
|
+
<%= render :partial => 'index_branch', :collection => @pages %>
|
10
|
+
</ul>
|