comfortable_mexican_sofa 1.12.6 → 1.12.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a67800e1ac43f82aa665227129a59f87ab127ce
4
- data.tar.gz: d870c9327212ba948fa84fe6db561ddcb454708b
3
+ metadata.gz: c52b1a77e4bfaf2d30972cfab68c402313e1b890
4
+ data.tar.gz: 75b8d1e27e366945246919e3ede5fe5298cd7bb4
5
5
  SHA512:
6
- metadata.gz: 5d79be3f5a1c73c26902d92f26bc097e77975bd0178101ec5016fdd874e40fa4007fb751a899a62b70518f4d515d26a912464f1c2b6562f50d9580ce5c116fe5
7
- data.tar.gz: 5f1d2535676b25d1be3582d13a4fc37589c85ae079cbeb2a260fd463befd948afebd1fc253abb88208460d0d3ecd9f72bb07a2790858cde60bcc4c522a5a7a9a
6
+ metadata.gz: 660c8208447330360005e76d8cdabd153244ca26df3f39e7072991838e67251efda5f6c203af3bc5cda973fe57d432c9d180ae16b5e55defe39731c3ca989569
7
+ data.tar.gz: 43cf5358ca68f84839f7da76e917f5b8d0e7ab10603fdb3bd440cd6d19359998b84e7c6ebc2e11f7e1438033d92e2e11806a1cd79d82cb2adb77d9d18bca5890
data/README.md CHANGED
@@ -9,7 +9,7 @@ ComfortableMexicanSofa is a powerful Rails 4 CMS Engine
9
9
  * Build your application in Rails, not in CMS
10
10
  * Powerful page templating capability using [Tags](https://github.com/comfy/comfortable-mexican-sofa/wiki/Tags)
11
11
  * [Multiple Sites](https://github.com/comfy/comfortable-mexican-sofa/wiki/Sites) from a single installation
12
- * Multi-Language Support (i18n) (cs, da, de, en, es, fr, it, ja, nb, nl, pl, pt-BR, ru, sv, zh-CN, zh-TW)
12
+ * Multi-Language Support (i18n) (cs, da, de, en, es, fr, it, ja, nb, nl, pl, pt-BR, ru, sv, uk, zh-CN, zh-TW)
13
13
  * [Fixtures](https://github.com/comfy/comfortable-mexican-sofa/wiki/Working-with-CMS-fixtures) for initial content population
14
14
  * [Revision History](https://github.com/comfy/comfortable-mexican-sofa/wiki/Revisions)
15
15
  * [Great extendable admin interface](https://github.com/comfy/comfortable-mexican-sofa/wiki/Reusing-sofa%27s-admin-area) built with [Bootstrap](http://twitter.github.com/bootstrap/), [CodeMirror](http://codemirror.net/) and [Redactor](http://imperavi.com/redactor)
@@ -8,8 +8,8 @@
8
8
  #= require codemirror/modes/markdown
9
9
  #= require codemirror/modes/xml
10
10
  #= require codemirror/addons/edit/closetag
11
- #= require bootstrap
12
11
  #= require bootstrap-sprockets
12
+ #= require bootstrap
13
13
  #= require comfy/admin/cms/lib/bootstrap-datetimepicker
14
14
  #= require comfy/admin/cms/lib/diff
15
15
  #= require comfy/admin/cms/lib/redactor
@@ -7,12 +7,14 @@ $(document).on 'page:load ready', ->
7
7
  CMS.init()
8
8
 
9
9
  window.CMS.init = ->
10
+ CMS.set_iframe_layout()
10
11
  CMS.slugify()
11
12
  CMS.wysiwyg()
12
13
  CMS.codemirror()
13
14
  CMS.sortable_list()
14
15
  CMS.timepicker()
15
16
  CMS.page_blocks()
17
+ CMS.page_file_popovers()
16
18
  CMS.mirrors()
17
19
  CMS.page_update_preview()
18
20
  CMS.page_update_publish()
@@ -101,7 +103,14 @@ window.CMS.page_blocks = ->
101
103
  CMS.wysiwyg()
102
104
  CMS.timepicker()
103
105
  CMS.codemirror()
104
- CMS.reinitialize_page_blocks() if CMS.reinitialize_page_blocks?
106
+ CMS.page_file_popovers()
107
+
108
+
109
+ window.CMS.page_file_popovers = ->
110
+ $('[data-toggle="page-file-popover"]').popover
111
+ trigger: 'hover'
112
+ placement: 'top'
113
+ html: true
105
114
 
106
115
 
107
116
  window.CMS.mirrors = ->
@@ -150,6 +159,3 @@ window.CMS.set_iframe_layout = ->
150
159
  $('body').ready ->
151
160
  if in_iframe()
152
161
  $('body').addClass('in-iframe')
153
-
154
- # Triggering this right away to prevent flicker
155
- window.CMS.set_iframe_layout()
@@ -1,5 +1,5 @@
1
1
  (function ($) {
2
- $.Redactor.opts.langs['no_NB'] = {
2
+ $.Redactor.opts.langs['nb'] = {
3
3
  html: 'HTML',
4
4
  video: 'Sett inn video...',
5
5
  image: 'Sett inn bilde...',
@@ -0,0 +1,76 @@
1
+ (function ($) {
2
+ $.Redactor.opts.langs['uk'] = {
3
+ html: 'Код',
4
+ video: 'Відео',
5
+ image: 'Зображення',
6
+ table: 'Таблиця',
7
+ link: 'Посилання',
8
+ link_insert: 'Вставити посилання ...',
9
+ link_edit: 'Edit link',
10
+ unlink: 'Видалити посилання',
11
+ formatting: 'Стилі',
12
+ paragraph: 'Звичайний текст',
13
+ quote: 'Цитата',
14
+ code: 'Код',
15
+ header1: 'Заголовок 1',
16
+ header2: 'Заголовок 2',
17
+ header3: 'Заголовок 3',
18
+ header4: 'Заголовок 4',
19
+ header5: 'Заголовок 5',
20
+ bold: 'Жирний',
21
+ italic: 'Похилий',
22
+ fontcolor: 'Колір тексту',
23
+ backcolor: 'Заливка тексту',
24
+ unorderedlist: 'Звичайний список',
25
+ orderedlist: 'Нумерований список',
26
+ outdent: 'Зменшити відступ',
27
+ indent: 'Збільшити відступ',
28
+ cancel: 'Скасувати',
29
+ insert: 'Вставити',
30
+ save: 'Зберегти',
31
+ _delete: 'Видалити',
32
+ insert_table: 'Вставити таблицю',
33
+ insert_row_above: 'Додати рядок зверху',
34
+ insert_row_below: 'Додати рядок знизу',
35
+ insert_column_left: 'Додати стовпець ліворуч',
36
+ insert_column_right: 'Додати стовпець праворуч',
37
+ delete_column: 'Видалити стовпець',
38
+ delete_row: 'Видалити рядок',
39
+ delete_table: 'Видалити таблицю',
40
+ rows: 'Рядки',
41
+ columns: 'Стовпці',
42
+ add_head: 'Додати заголовок',
43
+ delete_head: 'Видалити заголовок',
44
+ title: 'Підказка',
45
+ image_view: 'Завантажити зображення',
46
+ image_position: 'Обтікання текстом',
47
+ none: 'ні',
48
+ left: 'ліворуч',
49
+ right: 'праворуч',
50
+ image_web_link: 'Посилання на зображення',
51
+ text: 'Текст',
52
+ mailto: 'Ел. пошта',
53
+ web: 'URL',
54
+ video_html_code: 'Код відео ролика',
55
+ file: 'Файл',
56
+ upload: 'Завантажити',
57
+ download: 'Завантажити',
58
+ choose: 'Вибрати',
59
+ or_choose: 'Або виберіть',
60
+ drop_file_here: 'Перетягніть файл сюди',
61
+ align_left: 'По лівому краю',
62
+ align_center: 'По центру',
63
+ align_right: 'По правому краю',
64
+ align_justify: 'Вирівняти текст по ширині',
65
+ horizontalrule: 'Горизонтальная лінійка',
66
+ fullscreen: 'На весь екран',
67
+ deleted: 'Закреслений',
68
+ anchor: 'Anchor',
69
+ link_new_tab: 'Open link in new tab',
70
+ underline: 'Underline',
71
+ alignment: 'Alignment',
72
+ filename: 'Name (optional)',
73
+ edit: 'Edit',
74
+ center: 'Center'
75
+ };
76
+ })( jQuery );
@@ -47,6 +47,8 @@ body#comfy
47
47
  padding: 25px 10px
48
48
  width: 250px
49
49
  position: fixed
50
+ height: 100%
51
+ background-color: #f5f5f5
50
52
 
51
53
  // -- Navigation ----------------------------------------------------------
52
54
  .left-column-content ul.navigation
@@ -1,5 +1,7 @@
1
1
  class Comfy::Admin::Cms::BaseController < ComfortableMexicanSofa.config.base_controller.to_s.constantize
2
2
 
3
+ include Comfy::Paginate
4
+
3
5
  # Authentication module must have `authenticate` method
4
6
  include ComfortableMexicanSofa.config.admin_auth.to_s.constantize
5
7
 
@@ -53,15 +55,4 @@ protected
53
55
  flash.now[:danger] = I18n.t('comfy.admin.cms.base.fixtures_enabled')
54
56
  end
55
57
  end
56
-
57
- # Wrapper to deal with WillPaginate vs Kaminari nonsense
58
- def comfy_paginate(scope, per_page = 50)
59
- if defined?(WillPaginate)
60
- scope.paginate(:page => params[:page], :per_page => per_page)
61
- elsif defined?(Kaminari)
62
- scope.page(params[:page]).per(per_page)
63
- else
64
- scope
65
- end
66
- end
67
58
  end
@@ -0,0 +1,13 @@
1
+ module Comfy::Paginate
2
+
3
+ # Wrapper to deal with WillPaginate vs Kaminari nonsense
4
+ def comfy_paginate(scope, per_page = 50)
5
+ if defined?(WillPaginate)
6
+ scope.paginate(:page => params[:page], :per_page => per_page)
7
+ elsif defined?(Kaminari)
8
+ scope.page(params[:page]).per(per_page)
9
+ else
10
+ scope
11
+ end
12
+ end
13
+ end
@@ -3,7 +3,8 @@
3
3
  - if (files = block.files).present?
4
4
  .files
5
5
  - files.each do |file|
6
- .file{:class => dom_id(file)}
6
+ - file_thumb = image_tag(file.file.url(:cms_thumb)) if file.is_image?
7
+ .file{:id => dom_id(file), :data => {:toggle => 'page-file-popover', :content => file_thumb}}
7
8
  = link_to file.file_file_name, file.file.url, :target => '_blank'
8
9
  = link_to comfy_admin_cms_site_file_path(@site, file), :method => :delete, :remote => true, :data => {:confirm => t('.are_you_sure')}, :class => 'delete' do
9
10
  %i.glyphicon.glyphicon-remove-circle
@@ -4,7 +4,7 @@
4
4
  = form.text_field :identifier, :data => {:slug => true}
5
5
  = form.text_field :hostname
6
6
  = form.text_field :path
7
- = form.select :locale, ComfortableMexicanSofa.config.locales.to_a.collect{|l| [l[1], l[0]]}
7
+ = form.select :locale, ComfortableMexicanSofa.config.locales.to_a.collect{|l| ["#{l[1]} (#{l[0]})", l[0]]}
8
8
  = form.form_group do
9
9
  = form.check_box :is_mirrored, :label => t('.is_mirrored')
10
10
 
@@ -0,0 +1,241 @@
1
+ # encoding: utf-8
2
+ uk:
3
+ attributes:
4
+ label: Label
5
+ slug: Посилання
6
+ parent_id: Parent
7
+ content: Зміст
8
+ identifier: Ідентифікатор
9
+ full_path: Повний Шлях
10
+ activerecord:
11
+ models:
12
+ comfy/cms/site: Сайт
13
+ comfy/cms/layout: Шаблон
14
+ comfy/cms/page: Сторінка
15
+ comfy/cms/snippet: Сніппет
16
+ comfy/cms/file: Файл
17
+ attributes:
18
+ comfy/cms/site:
19
+ identifier: Ідентифікатор
20
+ hostname: Ім'я хоста
21
+ path: Шлях
22
+ locale: Мова
23
+ is_mirrored: Синхронізований з іншими сайтами
24
+ comfy/cms/layout:
25
+ identifier: Ідентифікатор
26
+ label: Назва шаблону
27
+ app_layout: Шаблон додатку
28
+ parent_id: Батьківскький шаблон
29
+ css: CSS
30
+ js: Javascript
31
+ comfy/cms/page:
32
+ label: Назва
33
+ layout_id: Шаблон
34
+ slug: Посилання
35
+ target_page_id: Редірект на сторінку
36
+ is_published: Опублікована
37
+ comfy/cms/file:
38
+ file: Файл
39
+ description: Опис
40
+ comfy/cms/snippet:
41
+ identifier: Ідентифікатор
42
+
43
+ comfy:
44
+ cms:
45
+ content:
46
+ site_not_found: Сайт не знайдено
47
+ layout_not_found: Шаблон не знайдено
48
+ page_not_found: Сторінку не знайдено
49
+
50
+ admin:
51
+ cms:
52
+ base:
53
+ site_not_found: Сайт не знайдено
54
+ fixtures_enabled: CMS Fixtures ввімкнені. Всі зміни, зроблені тут, будуть скасовані.
55
+
56
+ sites: Сайти
57
+ layouts: Шаблони
58
+ pages: Сторінки
59
+ snippets: Сніппети
60
+ files: Файли
61
+
62
+ sites:
63
+ created: Сайт створено
64
+ creation_failure: Не вийшло створити сайт
65
+ updated: Сайт оновлено
66
+ update_failure: Не вдалося оновити сайт
67
+ deleted: Сайт видалено
68
+ not_found: Сайт не знайдено
69
+
70
+ index:
71
+ title: Сайти
72
+ new_link: Створити новий сайт
73
+ select: Обрати сайт
74
+ edit: Редагувати
75
+ delete: Видалити
76
+ are_you_sure: Ви впевнені що хочете видалити цей сайт?
77
+ new:
78
+ title: Новий сайт
79
+ edit:
80
+ title: Редагувати сайт
81
+ form:
82
+ create: Створити сайт
83
+ cancel: Cкасувати
84
+ update: Оновити сайт
85
+ is_mirrored: Синхронізований
86
+
87
+ layouts:
88
+ created: Шаблон створено
89
+ creation_failure: Не вдалося створити шаблон
90
+ updated: Шаблон оновлено
91
+ update_failure: Не вдалося оновити шаблон
92
+ deleted: Шаблон видалено
93
+ not_found: Шаблон не знайдено
94
+
95
+ index:
96
+ title: Шаблони
97
+ new_link: Створити новий шаблон
98
+ index_branch:
99
+ add_child_layout: Додати дочірній шаблон
100
+ edit: Редагувати
101
+ delete: Видалити
102
+ are_you_sure: Ви впевнені?
103
+ new:
104
+ title: Новий шаблон
105
+ edit:
106
+ title: Редагувати шаблон
107
+ revision: &revision
108
+ zero: Нeмa Ревізій
109
+ one: '%{count} Ревізія'
110
+ few: '%{count} Ревізій'
111
+ many: '%{count} Ревізій'
112
+ other: '%{count} Ревізій'
113
+ form:
114
+ select_parent_layout: Вибрати батьківский шаблон
115
+ select_app_layout: Вибрати шаблон додатку
116
+ create: Створити шаблон
117
+ cancel: Cкасувати
118
+ update: Оновити шаблон
119
+
120
+ pages:
121
+ created: Сторінка створена
122
+ creation_failure: Не вийшло створити сторінку
123
+ updated: Сторінку оновлено
124
+ update_failure: Не вийшло оновити сторінку
125
+ deleted: Сторінка видалена
126
+ not_found: Сторінку не знайдено
127
+ layout_not_found: Жодного шаблону не знайдено
128
+
129
+ index:
130
+ title: Сторінки
131
+ new_link: Створити нову сторінку
132
+ index_branch:
133
+ toggle: Перемикач
134
+ add_child_page: Додати дочірню сторінку
135
+ edit: Редагувати
136
+ delete: Видалити
137
+ are_you_sure: Ви впевнені?
138
+ new:
139
+ title: Нова сторінка
140
+ edit:
141
+ title: Редагування сторінки
142
+ revision:
143
+ <<: *revision
144
+ form:
145
+ select_target_page: Без редіректу
146
+ preview: Передперегляд
147
+ create: Створити сторінку
148
+ cancel: Cкасувати
149
+ update: Оновити сторінку
150
+ is_published: Опублікована
151
+ form_blocks:
152
+ no_tags: |-
153
+ Шаблон не містить жодного контент-тега. <br/>
154
+ Відредагуйте контент, вставивши тег сторінки або поля. Наприклад: <code>{{cms:page:content}}</code>
155
+
156
+ snippets:
157
+ created: Сніппет створено
158
+ creation_failure: Не вдалося створити сніппет
159
+ updated: Сніппет оновлено
160
+ update_failure: Не вдалося оновити сніппет
161
+ deleted: Сніппет видалено
162
+ not_found: Сніппет не знайдено
163
+
164
+ index:
165
+ title: Сніппети
166
+ new_link: Створити новий сніппет
167
+ edit: Редагувати
168
+ delete: Видалити
169
+ are_you_sure: Ви впевнені?
170
+ new:
171
+ title: Новий сніппет
172
+ edit:
173
+ title: Редагувати сніппет
174
+ revision:
175
+ <<: *revision
176
+ form:
177
+ create: Створити сніппет
178
+ cancel: Cкасувати
179
+ update: Оновити сніппет
180
+
181
+ revisions:
182
+ reverted: Контент повернутий до попереднього стану
183
+ record_not_found: Запису не знайдено
184
+ not_found: Ревізії не знайдено
185
+
186
+ show:
187
+ title: Ревізія для
188
+ revision: Ревізія
189
+ full_path: Повний Шлях
190
+ slug: Посилання
191
+ update: Оновити до цієї ревізії
192
+ content: Зміст
193
+ changes: Зміни
194
+ previous: Попередній
195
+ current: Поточний
196
+
197
+ files:
198
+ created: Файли завантажені
199
+ creation_failure: Не вдалося завантажити файли
200
+ updated: Файл оновлено
201
+ update_failure: Не вдалося оновити файл
202
+ deleted: Файл видалено
203
+ not_found: Файл не знайдено
204
+
205
+ index:
206
+ title: Файли
207
+ new_link: Завантажити новий файл
208
+ edit: Редагувати
209
+ delete: Видалити
210
+ are_you_sure: Ви впевнені?
211
+ button: Завантажити файли
212
+ new:
213
+ title: Новий файл
214
+ edit:
215
+ title: Редагувати файл
216
+ form:
217
+ current_file: Поочний файл
218
+ create: Оновити файл
219
+ cancel: Cкасувати
220
+ update: Оновити файл
221
+ delete: Видалити
222
+ are_you_sure: Ви впевнені?
223
+ page_form:
224
+ are_you_sure: Ви впевнені?
225
+ file:
226
+ are_you_sure: Ви впевнені?
227
+
228
+ categories:
229
+ index:
230
+ label: Категорії
231
+ edit: Редагувати
232
+ done: Зроблено
233
+ all: Всі
234
+ add: Додати
235
+ add_placeholder: Додати Категорію
236
+ show:
237
+ are_you_sure: Ви впевнені?
238
+ edit:
239
+ save: Save
240
+ form:
241
+ label: Зберегти
@@ -90,22 +90,23 @@ class ComfortableMexicanSofa::Configuration
90
90
  @fixtures_path = File.expand_path('db/cms_fixtures', Rails.root)
91
91
  @revisions_limit = 25
92
92
  @locales = {
93
+ 'cs' => 'Česky',
94
+ 'da' => 'Dansk',
95
+ 'de' => 'Deutsch',
93
96
  'en' => 'English',
94
- 'fr' => 'Français',
95
97
  'es' => 'Español',
96
- 'pt-BR' => 'Português Brasileiro',
97
- 'zh-CN' => '简体中文',
98
- 'zh-TW' => '正體中文',
98
+ 'fr' => 'Français',
99
+ 'it' => 'Italiano',
99
100
  'ja' => '日本語',
100
- 'sv' => 'Svenska',
101
- 'ru' => 'Русский',
102
- 'pl' => 'Polski',
103
- 'de' => 'Deutsch',
101
+ 'nb' => 'Norsk',
104
102
  'nl' => 'Nederlands',
105
- 'it' => 'Italiano',
106
- 'da' => 'Dansk',
107
- 'cs' => 'Česky',
108
- 'nb' => 'Norsk'
103
+ 'pl' => 'Polski',
104
+ 'pt-BR' => 'Português Brasileiro',
105
+ 'ru' => 'Русский',
106
+ 'sv' => 'Svenska',
107
+ 'uk' => 'Українська',
108
+ 'zh-CN' => '简体中文',
109
+ 'zh-TW' => '正體中文'
109
110
  }
110
111
  @admin_locale = nil
111
112
  @admin_cache_sweeper = nil
@@ -1,25 +1,25 @@
1
1
  module ComfortableMexicanSofa::RenderMethods
2
-
2
+
3
3
  def self.included(base)
4
-
4
+
5
5
  # If application controller doesn't have template associated with it
6
6
  # CMS will attempt to find one. This is so you don't have to explicitly
7
7
  # call render :cms_page => '/something'
8
8
  base.rescue_from 'ActionView::MissingTemplate' do |e|
9
9
  begin
10
10
  render :cms_page => request.path
11
- rescue ComfortableMexicanSofa::MissingPage
11
+ rescue ComfortableMexicanSofa::MissingPage, ComfortableMexicanSofa::MissingSite
12
12
  raise e
13
13
  end
14
14
  end
15
-
15
+
16
16
  # Now you can render cms_page simply by calling:
17
17
  # render :cms_page => '/path/to/page'
18
18
  # This way application controllers can use CMS content while populating
19
19
  # instance variables that can be used in partials (that are included by
20
20
  # by the cms page and/or layout)
21
21
  #
22
- # Or how about not worrying about setting up CMS pages and rendering
22
+ # Or how about not worrying about setting up CMS pages and rendering
23
23
  # application view using a CMS layout?
24
24
  # render :cms_layout => 'layout_slug', :cms_blocks => {
25
25
  # :block_label_a => 'content text',
@@ -33,23 +33,23 @@ module ComfortableMexicanSofa::RenderMethods
33
33
  # Site is loaded automatically based on the request. However you can force
34
34
  # it by passing :cms_site parameter with site's slug. For example:
35
35
  # render :cms_page => '/path/to/page', :cms_site => 'default'
36
- #
36
+ #
37
37
  def render(options = {}, locals = {}, &block)
38
-
38
+
39
39
  return super unless options.is_a?(Hash)
40
-
40
+
41
41
  if site_identifier = options.delete(:cms_site)
42
42
  unless @cms_site = Comfy::Cms::Site.find_by_identifier(site_identifier)
43
43
  raise ComfortableMexicanSofa::MissingSite.new(site_identifier)
44
44
  end
45
45
  end
46
-
46
+
47
47
  if (page_path = options.delete(:cms_page)) || (layout_identifier = options.delete(:cms_layout))
48
48
  unless @cms_site ||= Comfy::Cms::Site.find_site(request.host.downcase, request.fullpath)
49
49
  raise ComfortableMexicanSofa::MissingSite.new("#{request.host.downcase}/#{request.fullpath}")
50
50
  end
51
51
  end
52
-
52
+
53
53
  if page_path
54
54
  render_cms_page(page_path, options, locals, &block)
55
55
  elsif layout_identifier
@@ -58,14 +58,14 @@ module ComfortableMexicanSofa::RenderMethods
58
58
  super
59
59
  end
60
60
  end
61
-
61
+
62
62
  def render_cms_page(path, options = {}, locals = {}, &block)
63
63
  path.gsub!(/^\/#{@cms_site.path}/, '') if @cms_site.path.present?
64
-
64
+
65
65
  unless @cms_page = @cms_site.pages.find_by_full_path(path)
66
66
  raise ComfortableMexicanSofa::MissingPage.new(path)
67
67
  end
68
-
68
+
69
69
  @cms_layout = @cms_page.layout
70
70
  if (cms_blocks = options.delete(:cms_blocks)).present?
71
71
  cms_blocks.each do |identifier, value|
@@ -78,16 +78,16 @@ module ComfortableMexicanSofa::RenderMethods
78
78
  cms_app_layout = @cms_layout.app_layout
79
79
  options[:layout] ||= cms_app_layout.blank?? nil : cms_app_layout
80
80
  options[:inline] = @cms_page.render
81
-
81
+
82
82
  render(options, locals, &block)
83
83
  end
84
-
84
+
85
85
  def render_cms_layout(identifier, options = {}, locals = {}, &block)
86
-
86
+
87
87
  unless @cms_layout = @cms_site.layouts.find_by_identifier(identifier)
88
88
  raise ComfortableMexicanSofa::MissingLayout.new(identifier)
89
89
  end
90
-
90
+
91
91
  cms_app_layout = @cms_layout.app_layout
92
92
  cms_page = @cms_site.pages.build(:layout => @cms_layout)
93
93
  cms_blocks = options.delete(:cms_blocks) || { :content => render_to_string({ :layout => false }.merge(options)) }
@@ -97,10 +97,10 @@ module ComfortableMexicanSofa::RenderMethods
97
97
  end
98
98
  options[:layout] ||= cms_app_layout.blank?? nil : cms_app_layout
99
99
  options[:inline] = cms_page.render
100
-
100
+
101
101
  render(options, locals, &block)
102
102
  end
103
-
103
+
104
104
  end
105
105
  end
106
106
 
@@ -1,3 +1,3 @@
1
1
  module ComfortableMexicanSofa
2
- VERSION = "1.12.6"
2
+ VERSION = "1.12.7"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require_relative '../test_helper'
2
2
 
3
3
  class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
4
-
4
+
5
5
  def setup
6
6
  super
7
7
  Rails.application.routes.draw do
@@ -15,11 +15,11 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
15
15
  { :identifier => 'content', :content => 'TestBlockContent' }
16
16
  ])
17
17
  end
18
-
18
+
19
19
  def teardown
20
20
  Rails.application.reload_routes!
21
21
  end
22
-
22
+
23
23
  def create_site_b
24
24
  site = Comfy::Cms::Site.create!(
25
25
  :identifier => 'site-b',
@@ -32,23 +32,23 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
32
32
  :layout => layout,
33
33
  :blocks_attributes => [{ :identifier => 'content', :content => 'SiteBContent' }])
34
34
  end
35
-
35
+
36
36
  class ::RenderTestController < ApplicationController
37
37
  append_view_path(File.expand_path('../fixtures/views', File.dirname(__FILE__)))
38
-
38
+
39
39
  def render_basic
40
40
  case params[:type]
41
41
  when 'text'
42
42
  render :text => 'TestText'
43
43
  when 'update'
44
- render :update do |page|
44
+ render :update do |page|
45
45
  page.alert('rendered text')
46
46
  end
47
47
  else
48
48
  render
49
49
  end
50
50
  end
51
-
51
+
52
52
  def render_page
53
53
  case params[:type]
54
54
  when 'page_implicit'
@@ -67,7 +67,7 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
67
67
  raise 'Invalid or no param[:type] provided'
68
68
  end
69
69
  end
70
-
70
+
71
71
  def render_layout
72
72
  @test_value = 'TestValue'
73
73
  case params[:type]
@@ -95,20 +95,21 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
95
95
  def new
96
96
  end
97
97
  end
98
-
98
+
99
99
  # -- Basic Render Tests ---------------------------------------------------
100
100
  def test_text
101
101
  get '/render-basic?type=text'
102
102
  assert_response :success
103
103
  assert_equal 'TestText', response.body
104
104
  end
105
-
105
+
106
106
  def test_implicit_cms_page_failure
107
+ Comfy::Cms::Site.destroy_all
107
108
  assert_exception_raised ActionView::MissingTemplate do
108
109
  get '/render-basic'
109
110
  end
110
111
  end
111
-
112
+
112
113
  # -- Page Render Test -----------------------------------------------------
113
114
  def test_implicit_cms_page
114
115
  page = comfy_cms_pages(:child)
@@ -121,7 +122,7 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
121
122
  assert_equal page, assigns(:cms_page)
122
123
  assert_equal 'TestBlockContent', response.body
123
124
  end
124
-
125
+
125
126
  def test_implicit_cms_page_with_site_path
126
127
  comfy_cms_sites(:default).update_column(:path, 'site-path')
127
128
  comfy_cms_pages(:child).update_attributes(:slug => 'render-page')
@@ -129,7 +130,7 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
129
130
  assert_response :success
130
131
  assert_equal 'TestBlockContent', response.body
131
132
  end
132
-
133
+
133
134
  def test_explicit_cms_page
134
135
  page = comfy_cms_pages(:child)
135
136
  page.update_attributes(slug: 'test-page')
@@ -141,7 +142,7 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
141
142
  assert_equal page, assigns(:cms_page)
142
143
  assert_equal 'TestBlockContent', response.body
143
144
  end
144
-
145
+
145
146
  def test_explicit_cms_page_with_status
146
147
  page = comfy_cms_pages(:child)
147
148
  page.update_attributes(:slug => 'test-page')
@@ -153,7 +154,7 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
153
154
  assert_equal page, assigns(:cms_page)
154
155
  assert_equal 'TestBlockContent', response.body
155
156
  end
156
-
157
+
157
158
  def test_explicit_cms_page_failure
158
159
  page = comfy_cms_pages(:child)
159
160
  page.update_attributes(:slug => 'invalid')
@@ -162,7 +163,7 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
162
163
  raise Rails.env.to_s
163
164
  end
164
165
  end
165
-
166
+
166
167
  def test_explicit_with_site
167
168
  create_site_b
168
169
  get '/render-page?type=page_explicit_with_site'
@@ -171,13 +172,13 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
171
172
  assert_equal 'site-b', assigns(:cms_site).identifier
172
173
  assert_equal 'site-b SiteBContent', response.body
173
174
  end
174
-
175
+
175
176
  def test_explicit_with_site_failure
176
177
  assert_exception_raised ComfortableMexicanSofa::MissingSite do
177
178
  get '/render-page?type=page_explicit_with_site'
178
179
  end
179
180
  end
180
-
181
+
181
182
  def test_explicit_with_page_blocks
182
183
  page = comfy_cms_pages(:child)
183
184
  page.update_attributes(slug: 'test-page')
@@ -185,7 +186,7 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
185
186
  assert_response :success
186
187
  assert_equal 'custom page content', response.body
187
188
  end
188
-
189
+
189
190
  # -- Layout Render Tests --------------------------------------------------
190
191
  def test_cms_layout_defaults
191
192
  get '/render-layout?type=layout_defaults'
@@ -195,7 +196,7 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
195
196
  assert assigns(:cms_layout)
196
197
  assert_equal comfy_cms_layouts(:default), assigns(:cms_layout)
197
198
  end
198
-
199
+
199
200
  def test_cms_layout
200
201
  comfy_cms_layouts(:default).update_columns(:content => '{{cms:page:content}} {{cms:page:content_b}} {{cms:page:content_c}}')
201
202
  get '/render-layout?type=layout'
@@ -205,7 +206,7 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
205
206
  assert assigns(:cms_layout)
206
207
  assert_equal comfy_cms_layouts(:default), assigns(:cms_layout)
207
208
  end
208
-
209
+
209
210
  def test_cms_layout_with_status
210
211
  get '/render-layout?type=layout_with_status'
211
212
  assert_response 404
@@ -224,13 +225,13 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
224
225
  assert assigns(:cms_layout)
225
226
  assert_equal comfy_cms_layouts(:default), assigns(:cms_layout)
226
227
  end
227
-
228
+
228
229
  def test_cms_layout_failure
229
230
  assert_exception_raised ComfortableMexicanSofa::MissingLayout do
230
231
  get '/render-layout?type=layout_invalid'
231
232
  end
232
233
  end
233
-
234
+
234
235
  def test_cms_layout_defaults_with_site
235
236
  create_site_b
236
237
  get '/render-layout?type=layout_defaults_with_site'
@@ -239,11 +240,11 @@ class RenderCmsIntergrationTest < ActionDispatch::IntegrationTest
239
240
  assert_equal 'site-b', assigns(:cms_site).identifier
240
241
  assert_equal 'site-b TestTemplate TestValue', response.body
241
242
  end
242
-
243
+
243
244
  def test_cms_layout_defaults_with_site_failure
244
245
  assert_exception_raised ComfortableMexicanSofa::MissingSite do
245
246
  get '/render-layout?type=layout_defaults_with_site'
246
247
  end
247
248
  end
248
-
249
+
249
250
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfortable_mexican_sofa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.6
4
+ version: 1.12.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Khabarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-19 00:00:00.000000000 Z
11
+ date: 2015-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -256,11 +256,12 @@ files:
256
256
  - app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/nb.js
257
257
  - app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/nl.js
258
258
  - app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/pl.js
259
- - app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/pt_BR.js
259
+ - app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/pt-BR.js
260
260
  - app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/ru.js
261
261
  - app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/sv.js
262
- - app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/zh_CN.js
263
- - app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/zh_TW.js
262
+ - app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/uk.js
263
+ - app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/zh-CN.js
264
+ - app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/zh-TW.js
264
265
  - app/assets/javascripts/comfy/admin/cms/lib/redactor/imagemanager.js
265
266
  - app/assets/javascripts/comfy/admin/cms/lib/redactor/table.js
266
267
  - app/assets/javascripts/comfy/admin/cms/lib/redactor/video.js
@@ -285,6 +286,7 @@ files:
285
286
  - app/controllers/comfy/cms/assets_controller.rb
286
287
  - app/controllers/comfy/cms/base_controller.rb
287
288
  - app/controllers/comfy/cms/content_controller.rb
289
+ - app/controllers/concerns/comfy/paginate.rb
288
290
  - app/helpers/comfy/cms_helper.rb
289
291
  - app/models/comfy/cms/block.rb
290
292
  - app/models/comfy/cms/categorization.rb
@@ -407,6 +409,7 @@ files:
407
409
  - config/locales/pt-BR.yml
408
410
  - config/locales/ru.yml
409
411
  - config/locales/sv.yml
412
+ - config/locales/uk.yml
410
413
  - config/locales/zh-CN.yml
411
414
  - config/locales/zh-TW.yml
412
415
  - db/cms_fixtures/sample-site/categories/files.yml