comfortable_mexican_sofa 1.6.24 → 1.6.25
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/assets/javascripts/comfortable_mexican_sofa/application.js +4 -2
- data/app/controllers/cms_admin/pages_controller.rb +2 -0
- data/app/controllers/cms_admin/sites_controller.rb +1 -1
- data/app/views/cms_admin/pages/_form_blocks.html.erb +3 -2
- data/app/views/cms_admin/pages/_index_branch.html.erb +8 -6
- data/comfortable_mexican_sofa.gemspec +5 -2
- data/config/initializers/comfortable_mexican_sofa.rb +1 -1
- data/config/locales/de.yml +234 -0
- data/config/locales/en.yml +0 -1
- data/config/locales/pl.yml +234 -0
- data/config/locales/ru.yml +0 -1
- data/config/locales/zh-CN.yml +1 -1
- data/lib/comfortable_mexican_sofa/configuration.rb +3 -1
- data/lib/comfortable_mexican_sofa/extensions/acts_as_tree.rb +2 -2
- data/lib/comfortable_mexican_sofa/render_methods.rb +2 -2
- data/lib/comfortable_mexican_sofa/tag.rb +1 -1
- data/lib/comfortable_mexican_sofa/view_hooks.rb +7 -5
- data/test/fixtures/views/render_test/new.html.erb +1 -0
- data/test/integration/render_cms_test.rb +16 -1
- data/test/integration/view_hooks_test.rb +12 -2
- data/test/unit/tag_test.rb +5 -0
- metadata +6 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.6.
|
1
|
+
1.6.25
|
@@ -34,7 +34,8 @@ $.CMS = function(){
|
|
34
34
|
// $.CMS.config.elRTE.toolbar = ['undoredo']
|
35
35
|
config: {
|
36
36
|
'elRTE': {
|
37
|
-
toolbar: ['undoredo', 'sofa_format', 'sofa_style', 'sofa_alignment', 'lists', 'sofa_copypaste', 'sofa_image', 'sofa_links']
|
37
|
+
toolbar: ['undoredo', 'sofa_format', 'sofa_style', 'sofa_alignment', 'lists', 'sofa_copypaste', 'sofa_image', 'sofa_links'],
|
38
|
+
cssfiles: []
|
38
39
|
}
|
39
40
|
},
|
40
41
|
|
@@ -95,7 +96,8 @@ $.CMS = function(){
|
|
95
96
|
elRTE.prototype.options.panels.sofa_links = ['sofa_link', 'unlink'];
|
96
97
|
|
97
98
|
elRTE.prototype.options.toolbars.sofa = $.CMS.config.elRTE.toolbar;
|
98
|
-
|
99
|
+
elRTE.prototype.options.cssfiles = $.CMS.config.elRTE.cssfiles;
|
100
|
+
|
99
101
|
// BUG: Need to set content to an empty <p> for IE
|
100
102
|
if ($.browser.msie){
|
101
103
|
$('textarea.rich_text').each(function(){
|
@@ -8,6 +8,7 @@ class CmsAdmin::PagesController < CmsAdmin::BaseController
|
|
8
8
|
|
9
9
|
def index
|
10
10
|
return redirect_to :action => :new if @site.pages.count == 0
|
11
|
+
@pages_by_parent = @site.pages.includes(:categories).all.group_by(&:parent_id)
|
11
12
|
if params[:category].present?
|
12
13
|
@pages = @site.pages.includes(:categories).for_category(params[:category]).all(:order => 'label')
|
13
14
|
else
|
@@ -55,6 +56,7 @@ class CmsAdmin::PagesController < CmsAdmin::BaseController
|
|
55
56
|
end
|
56
57
|
|
57
58
|
def toggle_branch
|
59
|
+
@pages_by_parent = @site.pages.includes(:categories).all.group_by(&:parent_id)
|
58
60
|
@page = @site.pages.find(params[:id])
|
59
61
|
s = (session[:cms_page_tree] ||= [])
|
60
62
|
id = @page.id.to_s
|
@@ -5,6 +5,7 @@
|
|
5
5
|
namespace[tag.namespace || 'default'] ||= []
|
6
6
|
namespace[tag.namespace || 'default'] << tag
|
7
7
|
end
|
8
|
+
has_namespaces = namespace.size > 1
|
8
9
|
%>
|
9
10
|
|
10
11
|
<div id='form_blocks'>
|
@@ -16,8 +17,8 @@
|
|
16
17
|
|
17
18
|
<% else %>
|
18
19
|
<%= fields_for :blocks, nil, :builder => ComfortableMexicanSofa::FormBuilder do |cms_blocks| %>
|
19
|
-
<div id='tag_namespaces'>
|
20
|
-
<% if
|
20
|
+
<div id='<%= has_namespaces ? 'tag_namespaces' : 'no_tag_namespaces' %>'>
|
21
|
+
<% if has_namespaces %>
|
21
22
|
<ul>
|
22
23
|
<% namespace.each do |name, tags| %>
|
23
24
|
<li><%= link_to name.humanize, "#ns-#{name}" %></li>
|
@@ -1,7 +1,9 @@
|
|
1
|
-
<%
|
2
|
-
page ||= index_branch
|
3
|
-
|
4
|
-
|
1
|
+
<%
|
2
|
+
page ||= index_branch
|
3
|
+
children = @pages_by_parent[page.id]
|
4
|
+
siblings = @pages_by_parent[page.parent_id]
|
5
|
+
has_children = children.present?
|
6
|
+
has_siblings = siblings.size > 1
|
5
7
|
branch_open = (session[:cms_page_tree] || []).member?(page.id.to_s) || page.root?
|
6
8
|
category_view = params[:category].present?
|
7
9
|
%>
|
@@ -9,7 +11,7 @@
|
|
9
11
|
<li id='<%= dom_id(page) %>'>
|
10
12
|
<div class='item'>
|
11
13
|
<div class='toggle <%= 'open' if branch_open %>'>
|
12
|
-
<%=
|
14
|
+
<%=
|
13
15
|
if !category_view && has_children && !page.root?
|
14
16
|
link_to span_tag(t('.toggle')), toggle_branch_cms_admin_site_page_path(@site, page), :remote => true
|
15
17
|
end
|
@@ -35,7 +37,7 @@
|
|
35
37
|
</div>
|
36
38
|
<% if !category_view && has_children && branch_open %>
|
37
39
|
<ul>
|
38
|
-
<%= render :partial => 'index_branch', :collection =>
|
40
|
+
<%= render :partial => 'index_branch', :collection => children %>
|
39
41
|
</ul>
|
40
42
|
<% end %>
|
41
43
|
</li>
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "comfortable_mexican_sofa"
|
8
|
-
s.version = "1.6.
|
8
|
+
s.version = "1.6.25"
|
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"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-10-12"
|
13
13
|
s.description = ""
|
14
14
|
s.email = "oleg@theworkinggroup.ca"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -174,9 +174,11 @@ Gem::Specification.new do |s|
|
|
174
174
|
"config/environments/test.rb",
|
175
175
|
"config/initializers/comfortable_mexican_sofa.rb",
|
176
176
|
"config/initializers/paperclip.rb",
|
177
|
+
"config/locales/de.yml",
|
177
178
|
"config/locales/en.yml",
|
178
179
|
"config/locales/es.yml",
|
179
180
|
"config/locales/ja.yml",
|
181
|
+
"config/locales/pl.yml",
|
180
182
|
"config/locales/pt-BR.yml",
|
181
183
|
"config/locales/ru.yml",
|
182
184
|
"config/locales/sv.yml",
|
@@ -265,6 +267,7 @@ Gem::Specification.new do |s|
|
|
265
267
|
"test/fixtures/views/_nav_hook.html.erb",
|
266
268
|
"test/fixtures/views/_nav_hook_2.html.erb",
|
267
269
|
"test/fixtures/views/render_test/_test.html.erb",
|
270
|
+
"test/fixtures/views/render_test/new.html.erb",
|
268
271
|
"test/fixtures/views/render_test/render_layout.html.erb",
|
269
272
|
"test/functional/cms_admin/base_controller_test.rb",
|
270
273
|
"test/functional/cms_admin/categories_controller_test.rb",
|
@@ -108,4 +108,4 @@ ComfortableMexicanSofa::HttpAuth.password = 'password'
|
|
108
108
|
# should be rendered into the following areas:
|
109
109
|
# ComfortableMexicanSofa::ViewHooks.add(:navigation, '/layouts/admin/navigation')
|
110
110
|
# ComfortableMexicanSofa::ViewHooks.add(:html_head, '/layouts/admin/html_head')
|
111
|
-
# ComfortableMexicanSofa::ViewHooks.add(:page_form, '/layouts/admin/page_form')
|
111
|
+
# ComfortableMexicanSofa::ViewHooks.add(:page_form, '/layouts/admin/page_form')
|
@@ -0,0 +1,234 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
de:
|
3
|
+
# -- Models ---------------------------------------------------------------
|
4
|
+
attributes:
|
5
|
+
label: Bezeichnung
|
6
|
+
slug: Slug
|
7
|
+
parent_id: Parent
|
8
|
+
content: Inhalt
|
9
|
+
identifier: Identifikator
|
10
|
+
activerecord:
|
11
|
+
models:
|
12
|
+
cms/site: Web-Site
|
13
|
+
cms/layout: Layout
|
14
|
+
cms/page: Seite
|
15
|
+
cms/snippet: Schnipsel
|
16
|
+
cms/file: Datei
|
17
|
+
attributes:
|
18
|
+
cms/site:
|
19
|
+
identifier: Identifikator
|
20
|
+
hostname: Hostname
|
21
|
+
path: Pfad
|
22
|
+
locale: Sprache
|
23
|
+
is_mirrored: Gespiegelt
|
24
|
+
cms/layout:
|
25
|
+
identifier: Identifikator
|
26
|
+
label: Layout Name
|
27
|
+
app_layout: App Layout
|
28
|
+
parent_id: Parent Layout
|
29
|
+
css: Stylesheet
|
30
|
+
js: Javascript
|
31
|
+
cms/page:
|
32
|
+
label: Bezeichnung
|
33
|
+
layout_id: Layout
|
34
|
+
slug: Slug
|
35
|
+
target_page_id: Weiterleiten zu Seite
|
36
|
+
is_published: Veröffentlicht
|
37
|
+
cms/file:
|
38
|
+
file: Datei
|
39
|
+
description: Beschreibung
|
40
|
+
cms/snippet:
|
41
|
+
identifier: Identifikator
|
42
|
+
|
43
|
+
# -- Controllers ----------------------------------------------------------
|
44
|
+
cms:
|
45
|
+
base:
|
46
|
+
site_not_found: Web-Site nicht gefunden
|
47
|
+
fixtures_enabled: CMS Fixtures are aktiviert. Alle Änderungen hier gespeichert werden verworfen.
|
48
|
+
|
49
|
+
sites:
|
50
|
+
created: Web-Site erstellt
|
51
|
+
creation_failure: Fehler beim erstellen der Web-Site
|
52
|
+
updated: Web-Site aktualisiert
|
53
|
+
update_failure: Fehler beim speichern der Web-Site
|
54
|
+
deleted: Web-Site gelöscht
|
55
|
+
not_found: Web-Site nicht gefunden
|
56
|
+
|
57
|
+
layouts:
|
58
|
+
created: Layout erstellt
|
59
|
+
creation_failure: Fehler beim erstellen des Layouts
|
60
|
+
updated: Layout aktualisiert
|
61
|
+
update_failure: Fehler beim speichern des Layouts
|
62
|
+
deleted: Layout gelöscht
|
63
|
+
not_found: Layout nicht gefunden
|
64
|
+
|
65
|
+
pages:
|
66
|
+
created: Seite erstellt
|
67
|
+
creation_failure: Fehler beim erstellen der Seite
|
68
|
+
updated: Seite aktualisiert
|
69
|
+
update_failure: Fehler beim speichern der Seite
|
70
|
+
deleted: Seite gelöscht
|
71
|
+
not_found: Seite nicht gefunden
|
72
|
+
layout_not_found: Kein Layout gefunden. Bitte erstellen Sie eines.
|
73
|
+
|
74
|
+
snippets:
|
75
|
+
created: Schnipsel erstellt
|
76
|
+
creation_failure: Fehler beim erstellen des Schnipsels
|
77
|
+
updated: Schnipsel aktualisiert
|
78
|
+
update_failure: Fehler beim speichern des Schnipsel
|
79
|
+
deleted: Schnipsel gelöscht
|
80
|
+
not_found: Schnipsel nicht gefunden
|
81
|
+
|
82
|
+
revisions:
|
83
|
+
reverted: Inhalt wiederhergestellt
|
84
|
+
record_not_found: Eintrag nicht gefunden
|
85
|
+
not_found: Revision nicht gefunden
|
86
|
+
|
87
|
+
files:
|
88
|
+
created: Datei hochgeladet
|
89
|
+
creation_failure: Fehler beim hochladen der Datei
|
90
|
+
updated: Datei hochgeladet
|
91
|
+
update_failure: Fehler beim hochladen der Datei
|
92
|
+
deleted: Datei gelöscht
|
93
|
+
not_found: Datei nicht gefunden
|
94
|
+
|
95
|
+
content:
|
96
|
+
site_not_found: Web-Site nicht gefunden
|
97
|
+
layout_not_found: Layout nicht gefunden
|
98
|
+
page_not_found: Seite nicht gefunden
|
99
|
+
|
100
|
+
# -- Views ----------------------------------------------------------------
|
101
|
+
cms_admin:
|
102
|
+
base:
|
103
|
+
sites: Web-Sites
|
104
|
+
layouts: Layouts
|
105
|
+
pages: Seiten
|
106
|
+
snippets: Schnipsel
|
107
|
+
files: Datei
|
108
|
+
|
109
|
+
sites:
|
110
|
+
index:
|
111
|
+
title: Web-Sites
|
112
|
+
new_link: Erstelle neue Web-Site
|
113
|
+
select: Wähle Web-Site
|
114
|
+
edit: Bearbeiten
|
115
|
+
delete: Löschen
|
116
|
+
are_you_sure: Sind Sie sicher, dass Sie diese Web-Site löschen wollen?
|
117
|
+
new:
|
118
|
+
title: Neue Web-Site
|
119
|
+
edit:
|
120
|
+
title: Web-Site bearbeiten
|
121
|
+
form:
|
122
|
+
create: Erstelle Web-Site
|
123
|
+
update: Web-Site speichern
|
124
|
+
|
125
|
+
layouts:
|
126
|
+
index:
|
127
|
+
title: Layouts
|
128
|
+
new_link: Erstelle neue Layout
|
129
|
+
index_branch:
|
130
|
+
add_child_layout: Erstelle untergeordnetes Layout
|
131
|
+
edit: Bearbeiten
|
132
|
+
delete: Löschen
|
133
|
+
are_you_sure: Sind Sie sicher?
|
134
|
+
new:
|
135
|
+
title: Neues Layout
|
136
|
+
edit:
|
137
|
+
title: Layout bearbeiten
|
138
|
+
revision: Revision
|
139
|
+
form:
|
140
|
+
select_parent_layout: Select Parent Layout
|
141
|
+
select_app_layout: Select Application Layout
|
142
|
+
create: Erstelle Layout
|
143
|
+
update: Layout speichern
|
144
|
+
|
145
|
+
pages:
|
146
|
+
index:
|
147
|
+
title: Seiten
|
148
|
+
new_link: Erstelle neue Seite
|
149
|
+
index_branch:
|
150
|
+
toggle: Toggle
|
151
|
+
add_child_page: Erstelle untergeordnete Seite
|
152
|
+
edit: Bearbeiten
|
153
|
+
delete: Löschen
|
154
|
+
are_you_sure: Sind Sie sicher?
|
155
|
+
new:
|
156
|
+
title: Neue Seite
|
157
|
+
edit:
|
158
|
+
title: Seite bearbeiten
|
159
|
+
revision: Revision
|
160
|
+
form:
|
161
|
+
select_target_page: Keine Weiterleitung
|
162
|
+
preview: Vorschau
|
163
|
+
create: Erstelle Seite
|
164
|
+
update: Seite speichern
|
165
|
+
form_blocks:
|
166
|
+
no_tags: |-
|
167
|
+
Layout has hat keine Inhalt-Tags definiert.<br/>
|
168
|
+
Bearbeiten den Inhalt des Layout um ein Inhalt-Tag hinzuzufügen. Zum Beispiel: <code>{{cms:page:content}}</code>
|
169
|
+
|
170
|
+
snippets:
|
171
|
+
index:
|
172
|
+
title: Schnipsels
|
173
|
+
new_link: Erstelle neuen Schnipsel
|
174
|
+
edit: Bearbeiten
|
175
|
+
delete: Löschen
|
176
|
+
are_you_sure: Sind Sie sicher?
|
177
|
+
new:
|
178
|
+
title: Neuer Schnipsel
|
179
|
+
edit:
|
180
|
+
title: Schnipsel bearbeiten
|
181
|
+
revision: Revision
|
182
|
+
form:
|
183
|
+
create: Erstelle Schnipsel
|
184
|
+
update: Schnipsel speichern
|
185
|
+
|
186
|
+
revisions:
|
187
|
+
show:
|
188
|
+
title: Revisionen von
|
189
|
+
revision: Revision
|
190
|
+
full_path: Completer Pfad
|
191
|
+
slug: Slug
|
192
|
+
update: Zurücksetzen auf diese Revision
|
193
|
+
current: Aktuell
|
194
|
+
|
195
|
+
files:
|
196
|
+
index:
|
197
|
+
title: Datei
|
198
|
+
new_link: Neue Datei hochladen
|
199
|
+
edit: Bearbeiten
|
200
|
+
delete: Löschen
|
201
|
+
are_you_sure: Sind Sie sicher?
|
202
|
+
button: Datei hochladen
|
203
|
+
new:
|
204
|
+
title: Neue Datei
|
205
|
+
edit:
|
206
|
+
title: Datei bearbeiten
|
207
|
+
form:
|
208
|
+
current_file: Aktuelle Datei
|
209
|
+
create: Lade Datei hoch
|
210
|
+
update: Datei speichern
|
211
|
+
page_form:
|
212
|
+
are_you_sure: Sind Sie sicher?
|
213
|
+
file:
|
214
|
+
are_you_sure: Sind Sie sicher?
|
215
|
+
|
216
|
+
categories:
|
217
|
+
index:
|
218
|
+
label: Kategorien
|
219
|
+
edit: Bearbeiten
|
220
|
+
done: Erledigt
|
221
|
+
all: Alle
|
222
|
+
add: Hinzuzufügen
|
223
|
+
show:
|
224
|
+
are_you_sure: Sind Sie sicher?
|
225
|
+
edit:
|
226
|
+
save: Speichern
|
227
|
+
form:
|
228
|
+
label: Kategorien
|
229
|
+
|
230
|
+
dialogs:
|
231
|
+
image:
|
232
|
+
insert: Bild einfügen
|
233
|
+
link:
|
234
|
+
create: Link erstellen
|
data/config/locales/en.yml
CHANGED
@@ -0,0 +1,234 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
pl:
|
3
|
+
# -- Models ---------------------------------------------------------------
|
4
|
+
attributes:
|
5
|
+
label: Tytuł
|
6
|
+
slug: Ścieżka
|
7
|
+
parent_id: Rodzic
|
8
|
+
content: Zawartość
|
9
|
+
identifier: Identyfikator
|
10
|
+
activerecord:
|
11
|
+
models:
|
12
|
+
cms/site: Witryna
|
13
|
+
cms/layout: Szablin
|
14
|
+
cms/page: Strona
|
15
|
+
cms/snippet: Snippet
|
16
|
+
cms/file: Plik
|
17
|
+
attributes:
|
18
|
+
cms/site:
|
19
|
+
identifier: Identyfikator
|
20
|
+
hostname: Nazwa hosta
|
21
|
+
path: Ścieżka
|
22
|
+
locale: Język
|
23
|
+
is_mirrored: Mirror
|
24
|
+
cms/layout:
|
25
|
+
identifier: Identyfikator
|
26
|
+
label: Nazwa layout'u
|
27
|
+
app_layout: Nazwa aplikacji
|
28
|
+
parent_id: Rodzic
|
29
|
+
css: Style
|
30
|
+
js: Javascript
|
31
|
+
cms/page:
|
32
|
+
label: Tytuł
|
33
|
+
layout_id: Identyfikator szablonu
|
34
|
+
slug: Ścieżka
|
35
|
+
target_page_id: Przekieruj do strony
|
36
|
+
is_published: Opublikowana
|
37
|
+
cms/file:
|
38
|
+
file: Plik
|
39
|
+
description: Opis
|
40
|
+
cms/snippet:
|
41
|
+
identifier: Identyfikator
|
42
|
+
|
43
|
+
# -- Controllers ----------------------------------------------------------
|
44
|
+
cms:
|
45
|
+
base:
|
46
|
+
site_not_found: Strona nie została znaleziona
|
47
|
+
fixtures_enabled: Fikstury CMS są włączone. Wszystkie zmiany zpisane tutaj nie będą uwzględnione.
|
48
|
+
|
49
|
+
sites:
|
50
|
+
created: Witryna została utworzona
|
51
|
+
creation_failure: Błąd przy tworzeniu witryny
|
52
|
+
updated: Witryna została uaktulaniona
|
53
|
+
update_failure: Błąd przy uaktualnianiu witryny
|
54
|
+
deleted: Witryna została usunięta
|
55
|
+
not_found: Nie znaleziono witryny
|
56
|
+
|
57
|
+
layouts:
|
58
|
+
created: Szablon został utworzony
|
59
|
+
creation_failure: Błąd przy tworzeniu layoutu
|
60
|
+
updated: Szanlon został uaktualniony
|
61
|
+
update_failure: Błąd przy uaktualnianiu layoutu
|
62
|
+
deleted: Szablon został usunięty
|
63
|
+
not_found: Nie znaleziono layoutu
|
64
|
+
|
65
|
+
pages:
|
66
|
+
created: Strona została utworzona
|
67
|
+
creation_failure: Błąd przy tworzeniu strony
|
68
|
+
updated: Strona została uaktualniona
|
69
|
+
update_failure: Błąd przy uaktualnianiu strony
|
70
|
+
deleted: Strona została usunięta
|
71
|
+
not_found: Nie znaleziono strony
|
72
|
+
layout_not_found: Brakuje layoutu. Proszę utworzyć
|
73
|
+
|
74
|
+
snippets:
|
75
|
+
created: Snippet został utworzony
|
76
|
+
creation_failure: Błąd przy tworzeniu snippeta
|
77
|
+
updated: Snippet został uaktualniony
|
78
|
+
update_failure: Błąd przy uaktualnianiu snippeta
|
79
|
+
deleted: Snippet został usunięty
|
80
|
+
not_found: Nie znaleziono snippeta
|
81
|
+
|
82
|
+
revisions:
|
83
|
+
reverted: Zawartość zostala przywrócona
|
84
|
+
record_not_found: Wpis nie został znaleziony
|
85
|
+
not_found: Wersja nie została znaleziona
|
86
|
+
|
87
|
+
files:
|
88
|
+
created: Plik wrzucony na serwer
|
89
|
+
creation_failure: Błąd przy wrzucaniu pliku
|
90
|
+
updated: Plik został uaktualniony
|
91
|
+
update_failure: Błąd przy uaktualnianiu pliku
|
92
|
+
deleted: Plik został usunięty
|
93
|
+
not_found: Plik nie został znaleziony
|
94
|
+
|
95
|
+
content:
|
96
|
+
site_not_found: Witryna nie została znaleziona
|
97
|
+
layout_not_found: Szablon nie został znaleziony
|
98
|
+
page_not_found: Strona nie została znaleziona
|
99
|
+
|
100
|
+
# -- Views ----------------------------------------------------------------
|
101
|
+
cms_admin:
|
102
|
+
base:
|
103
|
+
sites: Witryny
|
104
|
+
layouts: Szablony
|
105
|
+
pages: Pages
|
106
|
+
snippets: Snippets
|
107
|
+
files: Files
|
108
|
+
|
109
|
+
sites:
|
110
|
+
index:
|
111
|
+
title: Witryny
|
112
|
+
new_link: Utwórz nowa witrynę
|
113
|
+
select: Wybierz witrynę
|
114
|
+
edit: Edytuj
|
115
|
+
delete: Usuń
|
116
|
+
are_you_sure: Jesteś pewien, że chce usunąć tą witrynę?
|
117
|
+
new:
|
118
|
+
title: Nowa witryna
|
119
|
+
edit:
|
120
|
+
title: Edytuj witrynę
|
121
|
+
form:
|
122
|
+
create: Utwórz witrynę
|
123
|
+
update: Uaktualnij witrynę
|
124
|
+
|
125
|
+
layouts:
|
126
|
+
index:
|
127
|
+
title: Szablony
|
128
|
+
new_link: Utwórz nowy szablon
|
129
|
+
index_branch:
|
130
|
+
add_child_layout: Dodaj podszablon
|
131
|
+
edit: Edytuj
|
132
|
+
delete: Usuń
|
133
|
+
are_you_sure: Jesteś pewien?
|
134
|
+
new:
|
135
|
+
title: Nowy szablon
|
136
|
+
edit:
|
137
|
+
title: Edytuj szablon
|
138
|
+
revision: Wersje
|
139
|
+
form:
|
140
|
+
select_parent_layout: Wybierz szablon rodzic
|
141
|
+
select_app_layout: Wybierz szablon aplikacji
|
142
|
+
create: Stwórz szablon
|
143
|
+
update: Uaktualnij szablon
|
144
|
+
|
145
|
+
pages:
|
146
|
+
index:
|
147
|
+
title: Strony
|
148
|
+
new_link: Utwórz nową stronę
|
149
|
+
index_branch:
|
150
|
+
toggle: Przełącz
|
151
|
+
add_child_page: Dodaj podstronę
|
152
|
+
edit: Edytuj
|
153
|
+
delete: Usuń
|
154
|
+
are_you_sure: Jesteś pewien?
|
155
|
+
new:
|
156
|
+
title: Nowa strona
|
157
|
+
edit:
|
158
|
+
title: Edytuj stronę
|
159
|
+
revision: Wersje
|
160
|
+
form:
|
161
|
+
select_target_page: Bez przekierowania
|
162
|
+
preview: Podgląd
|
163
|
+
create: Utwórz stronę
|
164
|
+
update: Uaktualnij stronę
|
165
|
+
form_blocks:
|
166
|
+
no_tags: |-
|
167
|
+
Szablon nie ma zdefiniowanych tagów<br/>
|
168
|
+
Wyedytuj treść aby dodać stronę lub pole np. <code>{{cms:page:content}}</code>
|
169
|
+
|
170
|
+
snippets:
|
171
|
+
index:
|
172
|
+
title: Snippets
|
173
|
+
new_link: Utwórz nowy snippet
|
174
|
+
edit: Edytuj
|
175
|
+
delete: Usuń
|
176
|
+
are_you_sure: Jesteś pewien?
|
177
|
+
new:
|
178
|
+
title: Nowy snippet
|
179
|
+
edit:
|
180
|
+
title: Edytuj snippet
|
181
|
+
revision: Wersje
|
182
|
+
form:
|
183
|
+
create: Utwórz snippet
|
184
|
+
update: Uaktualnij snippet
|
185
|
+
|
186
|
+
revisions:
|
187
|
+
show:
|
188
|
+
title: Wersje dla
|
189
|
+
revision: Wersja
|
190
|
+
full_path: Pełna ścieżka
|
191
|
+
slug: Ścieżka
|
192
|
+
update: Uaktualnij do tej wersji
|
193
|
+
current: Aktualna
|
194
|
+
|
195
|
+
files:
|
196
|
+
index:
|
197
|
+
title: Pliki
|
198
|
+
new_link: Wrzuć nowy plik
|
199
|
+
edit: Edytuj
|
200
|
+
delete: Usuń
|
201
|
+
are_you_sure: Jesteś pewien?
|
202
|
+
button: Wrzuć plik
|
203
|
+
new:
|
204
|
+
title: Nowy plik
|
205
|
+
edit:
|
206
|
+
title: Edytuj plik
|
207
|
+
form:
|
208
|
+
current_file: Aktualny plik
|
209
|
+
create: Wrzuć plik
|
210
|
+
update: Uaktualnij plik
|
211
|
+
page_form:
|
212
|
+
are_you_sure: Jesteś pewien?
|
213
|
+
file:
|
214
|
+
are_you_sure: Jesteś pewien?
|
215
|
+
|
216
|
+
categories:
|
217
|
+
index:
|
218
|
+
label: Kategorie
|
219
|
+
edit: Edytuj
|
220
|
+
done: Zrobione
|
221
|
+
all: Wszystko
|
222
|
+
add: Dodaj
|
223
|
+
show:
|
224
|
+
are_you_sure: Jesteś pewien?
|
225
|
+
edit:
|
226
|
+
save: Zapisz
|
227
|
+
form:
|
228
|
+
label: Tytuł
|
229
|
+
|
230
|
+
dialogs:
|
231
|
+
image:
|
232
|
+
insert: Dodaj obrazek
|
233
|
+
link:
|
234
|
+
create: Utwórz link
|
data/config/locales/ru.yml
CHANGED
data/config/locales/zh-CN.yml
CHANGED
@@ -80,7 +80,7 @@ module ComfortableMexicanSofa::ActsAsTree
|
|
80
80
|
|
81
81
|
# Checks if this node is a root
|
82
82
|
def root?
|
83
|
-
!self.
|
83
|
+
!self.parent_id
|
84
84
|
end
|
85
85
|
|
86
86
|
# Returns all siblings of the current node.
|
@@ -99,4 +99,4 @@ module ComfortableMexicanSofa::ActsAsTree
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
-
ActiveRecord::Base.send :include, ComfortableMexicanSofa::ActsAsTree
|
102
|
+
ActiveRecord::Base.send :include, ComfortableMexicanSofa::ActsAsTree
|
@@ -59,7 +59,7 @@ module ComfortableMexicanSofa::RenderMethods
|
|
59
59
|
if @cms_layout = @cms_site && @cms_site.layouts.find_by_identifier(identifier)
|
60
60
|
cms_app_layout = @cms_layout.try(:app_layout)
|
61
61
|
cms_page = @cms_site.pages.build(:layout => @cms_layout)
|
62
|
-
cms_blocks = options.delete(:cms_blocks) || { :content => render_to_string(:layout => false)}
|
62
|
+
cms_blocks = options.delete(:cms_blocks) || { :content => render_to_string({ :layout => false }.merge(options)) }
|
63
63
|
cms_blocks.each do |identifier, value|
|
64
64
|
content = if value.is_a?(Hash)
|
65
65
|
render_to_string(value.keys.first.to_sym => value[value.keys.first], :layout => false)
|
@@ -82,4 +82,4 @@ module ComfortableMexicanSofa::RenderMethods
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
-
ActionController::Base.send :include, ComfortableMexicanSofa::RenderMethods
|
85
|
+
ActionController::Base.send :include, ComfortableMexicanSofa::RenderMethods
|
@@ -93,7 +93,7 @@ module ComfortableMexicanSofa::Tag
|
|
93
93
|
|
94
94
|
# Checks if this tag is using Cms::Block
|
95
95
|
def is_cms_block?
|
96
|
-
%w(page field collection
|
96
|
+
%w(page field collection).member?(self.class.to_s.demodulize.underscore.split(/_/).first)
|
97
97
|
end
|
98
98
|
|
99
99
|
# Used in displaying form elements for Cms::Block
|
@@ -9,7 +9,7 @@ module ComfortableMexicanSofa::ViewHooks
|
|
9
9
|
def self.render(name, template, options = {})
|
10
10
|
out = ''
|
11
11
|
(self.hooks[name.to_sym] || []).each do |path|
|
12
|
-
out += template.render({:partial => path}.merge(options))
|
12
|
+
out += template.render({:partial => path.first}.merge(options))
|
13
13
|
end
|
14
14
|
return out.html_safe
|
15
15
|
end
|
@@ -17,14 +17,16 @@ module ComfortableMexicanSofa::ViewHooks
|
|
17
17
|
# Will declare a partial that will be rendered for this hook
|
18
18
|
# Example:
|
19
19
|
# ComfortableMexicanSofa::ViewHooks.add(:navigation, 'shared/navigation')
|
20
|
-
def self.add(name, partial_path)
|
20
|
+
def self.add(name, partial_path, position = 0)
|
21
21
|
self.hooks[name.to_sym] ||= []
|
22
|
-
self.hooks[name.to_sym] << partial_path
|
22
|
+
self.hooks[name.to_sym] << [partial_path, position]
|
23
|
+
self.hooks[name.to_sym].sort_by! { |hook| hook.last }
|
23
24
|
end
|
25
|
+
|
24
26
|
|
25
27
|
# Removing previously declared hook
|
26
28
|
def self.remove(name)
|
27
29
|
self.hooks.delete(name)
|
28
30
|
end
|
29
|
-
|
30
|
-
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Can render CMS layout and specify action
|
@@ -80,10 +80,15 @@ class RenderCmsTest < ActionDispatch::IntegrationTest
|
|
80
80
|
render :cms_layout => 'invalid'
|
81
81
|
when 'layout_defaults_with_site'
|
82
82
|
render :cms_layout => 'default', :cms_site => 'site-b'
|
83
|
+
when 'layout_with_action'
|
84
|
+
render :cms_layout => 'default', :action => :new
|
83
85
|
else
|
84
86
|
raise 'Invalid or no param[:type] provided'
|
85
87
|
end
|
86
88
|
end
|
89
|
+
|
90
|
+
def new
|
91
|
+
end
|
87
92
|
end
|
88
93
|
|
89
94
|
# -- Basic Render Tests ---------------------------------------------------
|
@@ -193,6 +198,16 @@ class RenderCmsTest < ActionDispatch::IntegrationTest
|
|
193
198
|
assert assigns(:cms_layout)
|
194
199
|
assert_equal cms_layouts(:default), assigns(:cms_layout)
|
195
200
|
end
|
201
|
+
|
202
|
+
def test_cms_layout_with_action
|
203
|
+
cms_layouts(:default).update_column(:content, '{{cms:page:content}} {{cms:page:content_b}} {{cms:page:content_c}}')
|
204
|
+
get '/render-layout?type=layout_with_action'
|
205
|
+
assert_response :success
|
206
|
+
assert_equal "Can render CMS layout and specify action\n ", response.body
|
207
|
+
assert assigns(:cms_site)
|
208
|
+
assert assigns(:cms_layout)
|
209
|
+
assert_equal cms_layouts(:default), assigns(:cms_layout)
|
210
|
+
end
|
196
211
|
|
197
212
|
def test_cms_layout_failure
|
198
213
|
assert_exception_raised ComfortableMexicanSofa::MissingLayout do
|
@@ -215,4 +230,4 @@ class RenderCmsTest < ActionDispatch::IntegrationTest
|
|
215
230
|
end
|
216
231
|
end
|
217
232
|
|
218
|
-
end
|
233
|
+
end
|
@@ -21,6 +21,16 @@ class ViewHooksTest < ActionDispatch::IntegrationTest
|
|
21
21
|
assert_match /hook_content/, response.body
|
22
22
|
assert_match /<hook_content_2>/, response.body
|
23
23
|
end
|
24
|
+
|
25
|
+
def test_hooks_rendering_with_proper_order
|
26
|
+
CmsAdmin::SitesController.append_view_path(File.expand_path('../fixtures/views', File.dirname(__FILE__)))
|
27
|
+
ComfortableMexicanSofa::ViewHooks.add(:navigation, '/nav_hook_2', 0)
|
28
|
+
ComfortableMexicanSofa::ViewHooks.add(:navigation, '/nav_hook', 1)
|
29
|
+
|
30
|
+
http_auth :get, cms_admin_sites_path
|
31
|
+
assert_response :success
|
32
|
+
assert_match /<hook_content_2>hook_content/, response.body
|
33
|
+
end
|
24
34
|
|
25
35
|
def test_hooks_rendering_with_no_hook
|
26
36
|
ComfortableMexicanSofa::ViewHooks.remove(:navigation)
|
@@ -29,5 +39,5 @@ class ViewHooksTest < ActionDispatch::IntegrationTest
|
|
29
39
|
assert_response :success
|
30
40
|
assert_no_match /hook_content/, response.body
|
31
41
|
end
|
32
|
-
|
33
|
-
end
|
42
|
+
|
43
|
+
end
|
data/test/unit/tag_test.rb
CHANGED
@@ -212,6 +212,11 @@ class TagTest < ActiveSupport::TestCase
|
|
212
212
|
cms_pages(:default), '{{ cms:snippet:label }}'
|
213
213
|
)
|
214
214
|
assert !tag.is_cms_block?
|
215
|
+
|
216
|
+
tag = ComfortableMexicanSofa::Tag::File.initialize_tag(
|
217
|
+
cms_pages(:default), '{{ cms:file:sample.jpg }}'
|
218
|
+
)
|
219
|
+
assert !tag.is_cms_block?
|
215
220
|
end
|
216
221
|
|
217
222
|
def test_content_with_irb_disabled
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comfortable_mexican_sofa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.25
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-10-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -225,9 +225,11 @@ files:
|
|
225
225
|
- config/environments/test.rb
|
226
226
|
- config/initializers/comfortable_mexican_sofa.rb
|
227
227
|
- config/initializers/paperclip.rb
|
228
|
+
- config/locales/de.yml
|
228
229
|
- config/locales/en.yml
|
229
230
|
- config/locales/es.yml
|
230
231
|
- config/locales/ja.yml
|
232
|
+
- config/locales/pl.yml
|
231
233
|
- config/locales/pt-BR.yml
|
232
234
|
- config/locales/ru.yml
|
233
235
|
- config/locales/sv.yml
|
@@ -316,6 +318,7 @@ files:
|
|
316
318
|
- test/fixtures/views/_nav_hook.html.erb
|
317
319
|
- test/fixtures/views/_nav_hook_2.html.erb
|
318
320
|
- test/fixtures/views/render_test/_test.html.erb
|
321
|
+
- test/fixtures/views/render_test/new.html.erb
|
319
322
|
- test/fixtures/views/render_test/render_layout.html.erb
|
320
323
|
- test/functional/cms_admin/base_controller_test.rb
|
321
324
|
- test/functional/cms_admin/categories_controller_test.rb
|
@@ -386,7 +389,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
386
389
|
version: '0'
|
387
390
|
segments:
|
388
391
|
- 0
|
389
|
-
hash:
|
392
|
+
hash: -4349925487218817830
|
390
393
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
391
394
|
none: false
|
392
395
|
requirements:
|