comfortable_mexican_sofa 1.6.2 → 1.6.3

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.
Files changed (32) hide show
  1. data/.travis.yml +3 -2
  2. data/VERSION +1 -1
  3. data/app/assets/javascripts/comfortable_mexican_sofa/application.js +9 -0
  4. data/app/assets/javascripts/comfortable_mexican_sofa/elrte/elrte.js +2 -2
  5. data/app/models/cms/block.rb +1 -1
  6. data/app/models/cms/categorization.rb +1 -1
  7. data/app/models/cms/category.rb +1 -1
  8. data/app/models/cms/file.rb +1 -1
  9. data/app/models/cms/layout.rb +1 -1
  10. data/app/models/cms/page.rb +1 -1
  11. data/app/models/cms/revision.rb +1 -1
  12. data/app/models/cms/site.rb +1 -1
  13. data/app/models/cms/snippet.rb +1 -1
  14. data/comfortable_mexican_sofa.gemspec +12 -10
  15. data/config/locales/pt-BR.yml +230 -0
  16. data/db/cms_fixtures/example.com/pages/index/content.html +1 -1
  17. data/db/{migrate/upgrades → upgrade_migrations}/02_upgrade_to_1_1_0.rb +0 -0
  18. data/db/{migrate/upgrades → upgrade_migrations}/03_upgrade_to_1_2_0.rb +0 -0
  19. data/db/{migrate/upgrades → upgrade_migrations}/04_upgrade_to_1_3_0.rb +0 -0
  20. data/db/{migrate/upgrades → upgrade_migrations}/05_upgrade_to_1_4_0.rb +0 -0
  21. data/db/{migrate/upgrades → upgrade_migrations}/06_upgrade_to_1_5_0.rb +0 -0
  22. data/db/{migrate/upgrades → upgrade_migrations}/07_upgrade_to_1_6_0.rb +1 -1
  23. data/lib/comfortable_mexican_sofa/configuration.rb +1 -1
  24. data/lib/comfortable_mexican_sofa/fixtures.rb +5 -5
  25. data/lib/generators/cms_generator.rb +11 -6
  26. data/test/gemfiles/{Gemfile.rails-3.0 → Gemfile.rails.3.0} +0 -0
  27. data/test/gemfiles/{Gemfile.rails-3.1 → Gemfile.rails.3.1} +0 -0
  28. data/test/gemfiles/Gemfile.rails.3.2 +10 -0
  29. data/test/integration/fixtures_test.rb +3 -1
  30. data/test/integration/routing_extensions_test.rb +8 -6
  31. data/test/unit/fixtures_test.rb +3 -1
  32. metadata +19 -17
data/.travis.yml CHANGED
@@ -6,8 +6,9 @@ rvm:
6
6
  - ree
7
7
  # - jruby
8
8
  gemfile:
9
- - test/gemfiles/Gemfile.rails-3.0
10
- - test/gemfiles/Gemfile.rails-3.1
9
+ - test/gemfiles/Gemfile.rails.3.0
10
+ - test/gemfiles/Gemfile.rails.3.1
11
+ - test/gemfiles/Gemfile.rails.3.2
11
12
  notifications:
12
13
  recipients:
13
14
  - oleg@twg.ca
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.2
1
+ 1.6.3
@@ -96,6 +96,15 @@ $.CMS = function(){
96
96
 
97
97
  elRTE.prototype.options.toolbars.sofa = $.CMS.config.elRTE.toolbar;
98
98
 
99
+ // BUG: Need to set content to an empty <p> for IE
100
+ if ($.browser.msie){
101
+ $('textarea.rich_text').each(function(){
102
+ if ($(this).val() == ''){
103
+ $(this).val('<p></p>');
104
+ }
105
+ })
106
+ }
107
+
99
108
  $('textarea.rich_text').elrte({
100
109
  height: 300,
101
110
  toolbar: 'sofa',
@@ -39,8 +39,8 @@ this.value=q+"\t"+u;this.setSelectionRange(q.length+1,q.length+1)}}});a(this.doc
39
39
  c.selection.select(p);setTimeout(function(){if(t.parentNode){a(t).html(c.filter.proccess("paste",a(t).html()));p=t.lastChild;c.dom.unwrap(t);if(p){c.selection.select(p);c.selection.collapse(false)}}else{t.parentNode&&t.parentNode.removeChild(t);c.val(c.filter.proccess("paste",c.filter.wysiwyg2wysiwyg(a(c.doc.body).html())));c.selection.select(c.doc.body.firstChild);c.selection.collapse(true)}a(c.doc.body).mouseup()},15)}});if(a.browser.msie){this.$doc.bind("keyup",function(p){if(p.keyCode==86&&(p.metaKey||p.ctrlKey)){c.history.add(true);
40
40
  c.typing=true;c.lastKey=null;c.selection.saveIERange();c.val(c.filter.proccess("paste",c.filter.wysiwyg2wysiwyg(a(c.doc.body).html())));c.selection.restoreIERange();a(c.doc.body).mouseup();this.ui.update()}})}if(a.browser.safari){this.$doc.bind("click",function(p){a(c.doc.body).find(".elrte-webkit-hl").removeClass("elrte-webkit-hl");if(p.target.nodeName=="IMG"){a(p.target).addClass("elrte-webkit-hl")}}).bind("keyup",function(p){a(c.doc.body).find(".elrte-webkit-hl").removeClass("elrte-webkit-hl")
41
41
  })}this.window.focus();this.destroy=function(){this.updateSource();this.target.is("textarea")?this.target.val(a.trim(this.source.val())):this.target.html(a.trim(this.source.val()));this.editor.remove();this.target.show().parents("form").unbind("submit.elfinder")}};elRTE.prototype.i18n=function(b){return this._i18n.translate(b)};elRTE.prototype.open=function(){this.editor.show()};elRTE.prototype.close=function(){this.editor.hide()};elRTE.prototype.updateEditor=function(){this.val(this.source.val())
42
- };elRTE.prototype.updateSource=function(){this.source.val(this.filter.source(a(this.doc.body).html()))};elRTE.prototype.val=function(b){if(typeof(b)=="string"){b=""+b;if(this.source.is(":visible")){this.source.val(this.filter.source2source(b))}else{if(a.browser.msie){this.doc.body.innerHTML="<br />"+this.filter.wysiwyg(b);this.doc.body.removeChild(this.doc.body.firstChild)}else{this.doc.body.innerHTML=this.filter.wysiwyg(b)}}}else{if(this.source.is(":visible")){return this.filter.source2source(this.source.val()).trim()
43
- }else{return this.filter.source(a(this.doc.body).html()).trim()}}};elRTE.prototype.beforeSave=function(){this.source.val(a.trim(this.val())||"")};elRTE.prototype.save=function(){this.beforeSave();this.editor.parents("form").submit()};elRTE.prototype.log=function(b){if(window.console&&window.console.log){window.console.log(b)}};elRTE.prototype.i18Messages={};a.fn.elrte=function(g,b){var f=typeof(g)=="string"?g:"",c;this.each(function(){if(!this.elrte){this.elrte=new elRTE(this,typeof(g)=="object"?g:{})
42
+ };elRTE.prototype.updateSource=function(){this.source.val(this.filter.source(a(this.doc.body).html()))};elRTE.prototype.val=function(b){if(typeof(b)=="string"){b=""+b;if(this.source.is(":visible")){this.source.val(this.filter.source2source(b))}else{if(a.browser.msie){this.doc.body.innerHTML="<br />"+this.filter.wysiwyg(b);this.doc.body.removeChild(this.doc.body.firstChild)}else{this.doc.body.innerHTML=this.filter.wysiwyg(b)}}}else{if(this.source.is(":visible")){return $.trim(this.filter.source2source(this.source.val()))
43
+ }else{return $.trim(this.filter.source(a(this.doc.body).html()))}}};elRTE.prototype.beforeSave=function(){this.source.val(a.trim(this.val())||"")};elRTE.prototype.save=function(){this.beforeSave();this.editor.parents("form").submit()};elRTE.prototype.log=function(b){if(window.console&&window.console.log){window.console.log(b)}};elRTE.prototype.i18Messages={};a.fn.elrte=function(g,b){var f=typeof(g)=="string"?g:"",c;this.each(function(){if(!this.elrte){this.elrte=new elRTE(this,typeof(g)=="object"?g:{})
44
44
  }switch(f){case"open":case"show":this.elrte.open();break;case"close":case"hide":this.elrte.close();break;case"updateSource":this.elrte.updateSource();break;case"destroy":this.elrte.destroy()}});if(f=="val"){if(!this.length){return""}else{if(this.length==1){return b?this[0].elrte.val(b):this[0].elrte.val()}else{c={};this.each(function(){c[this.elrte.source.attr("name")]=this.elrte.val()});return c}}}return this}})(jQuery);(function(a){elRTE.prototype.dom=function(c){this.rte=c;var b=this;this.regExp={textNodes:/^(A|ABBR|ACRONYM|ADDRESS|B|BDO|BIG|BLOCKQUOTE|CAPTION|CENTER|CITE|CODE|DD|DEL|DFN|DIV|DT|EM|FIELDSET|FONT|H[1-6]|I|INS|KBD|LABEL|LEGEND|LI|MARQUEE|NOBR|NOEMBED|P|PRE|Q|SAMP|SMALL|SPAN|STRIKE|STRONG|SUB|SUP|TD|TH|TT|VAR)$/,textContainsNodes:/^(A|ABBR|ACRONYM|ADDRESS|B|BDO|BIG|BLOCKQUOTE|CAPTION|CENTER|CITE|CODE|DD|DEL|DFN|DIV|DL|DT|EM|FIELDSET|FONT|H[1-6]|I|INS|KBD|LABEL|LEGEND|LI|MARQUEE|NOBR|NOEMBED|OL|P|PRE|Q|SAMP|SMALL|SPAN|STRIKE|STRONG|SUB|SUP|TABLE|THEAD|TBODY|TFOOT|TD|TH|TR|TT|UL|VAR)$/,block:/^(APPLET|BLOCKQUOTE|BR|CAPTION|CENTER|COL|COLGROUP|DD|DIV|DL|DT|H[1-6]|EMBED|FIELDSET|LI|MARQUEE|NOBR|OBJECT|OL|P|PRE|TABLE|THEAD|TBODY|TFOOT|TD|TH|TR|UL)$/,selectionBlock:/^(APPLET|BLOCKQUOTE|BR|CAPTION|CENTER|COL|COLGROUP|DD|DIV|DL|DT|H[1-6]|EMBED|FIELDSET|LI|MARQUEE|NOBR|OBJECT|OL|P|PRE|TD|TH|TR|UL)$/,header:/^H[1-6]$/,formElement:/^(FORM|INPUT|HIDDEN|TEXTAREA|SELECT|BUTTON)$/};
45
45
  this.root=function(){return this.rte.body};this.create=function(f){return this.rte.doc.createElement(f)};this.createBookmark=function(){var f=this.rte.doc.createElement("span");f.id="elrte-bm-"+Math.random().toString().substr(2);a(f).addClass("elrtebm elrte-protected");return f};this.indexOf=function(g){var f=0;g=a(g);while((g=g.prev())&&g.length){f++}return f};this.attr=function(h,f){var g="";if(h.nodeType==1){g=a(h).attr(f);if(g&&f!="src"&&f!="href"&&f!="title"&&f!="alt"){g=g.toString().toLowerCase()
46
46
  }}return g||""};this.findCommonAncestor=function(j,h){if(!j||!h){return this.rte.log("dom.findCommonAncestor invalid arguments")}if(j==h){return j}else{if(j.nodeName=="BODY"||h.nodeName=="BODY"){return this.rte.doc.body}}var o=a(j).parents(),k=a(h).parents(),f=k.length-1,p=k[f];for(var g=o.length-1;g>=0;g--,f--){if(o[g]==k[f]){p=o[g]}else{break}}return p};this.isEmpty=function(f){if(f.nodeType==1){return this.regExp.textNodes.test(f.nodeName)?a.trim(a(f).text()).length==0:false}else{if(f.nodeType==3){return/^(TABLE|THEAD|TFOOT|TBODY|TR|UL|OL|DL)$/.test(f.parentNode.nodeName)||f.nodeValue==""||(a.trim(f.nodeValue).length==0&&!(f.nextSibling&&f.previousSibling&&f.nextSibling.nodeType==1&&f.previousSibling.nodeType==1&&!this.regExp.block.test(f.nextSibling.nodeName)&&!this.regExp.block.test(f.previousSibling.nodeName)))
@@ -2,7 +2,7 @@ class Cms::Block < ActiveRecord::Base
2
2
 
3
3
  ComfortableMexicanSofa.establish_connection(self)
4
4
 
5
- set_table_name :cms_blocks
5
+ self.table_name = 'cms_blocks'
6
6
 
7
7
  # -- Relationships --------------------------------------------------------
8
8
  belongs_to :page
@@ -2,7 +2,7 @@ class Cms::Categorization < ActiveRecord::Base
2
2
 
3
3
  ComfortableMexicanSofa.establish_connection(self)
4
4
 
5
- set_table_name :cms_categorizations
5
+ self.table_name = 'cms_categorizations'
6
6
 
7
7
  # -- Relationships --------------------------------------------------------
8
8
  belongs_to :category
@@ -2,7 +2,7 @@ class Cms::Category < ActiveRecord::Base
2
2
 
3
3
  ComfortableMexicanSofa.establish_connection(self)
4
4
 
5
- set_table_name :cms_categories
5
+ self.table_name = 'cms_categories'
6
6
 
7
7
  # -- Relationships --------------------------------------------------------
8
8
  belongs_to :site
@@ -4,7 +4,7 @@ class Cms::File < ActiveRecord::Base
4
4
 
5
5
  ComfortableMexicanSofa.establish_connection(self)
6
6
 
7
- set_table_name :cms_files
7
+ self.table_name = 'cms_files'
8
8
 
9
9
  cms_is_categorized
10
10
 
@@ -2,7 +2,7 @@ class Cms::Layout < ActiveRecord::Base
2
2
 
3
3
  ComfortableMexicanSofa.establish_connection(self)
4
4
 
5
- set_table_name :cms_layouts
5
+ self.table_name = 'cms_layouts'
6
6
 
7
7
  cms_acts_as_tree
8
8
  cms_is_mirrored
@@ -2,7 +2,7 @@ class Cms::Page < ActiveRecord::Base
2
2
 
3
3
  ComfortableMexicanSofa.establish_connection(self)
4
4
 
5
- set_table_name :cms_pages
5
+ self.table_name = 'cms_pages'
6
6
 
7
7
  cms_acts_as_tree :counter_cache => :children_count
8
8
  cms_is_categorized
@@ -2,7 +2,7 @@ class Cms::Revision < ActiveRecord::Base
2
2
 
3
3
  ComfortableMexicanSofa.establish_connection(self)
4
4
 
5
- set_table_name :cms_revisions
5
+ self.table_name = 'cms_revisions'
6
6
 
7
7
  serialize :data
8
8
 
@@ -2,7 +2,7 @@ class Cms::Site < ActiveRecord::Base
2
2
 
3
3
  ComfortableMexicanSofa.establish_connection(self)
4
4
 
5
- set_table_name :cms_sites
5
+ self.table_name = 'cms_sites'
6
6
 
7
7
  # -- Relationships --------------------------------------------------------
8
8
  has_many :layouts, :dependent => :destroy
@@ -2,7 +2,7 @@ class Cms::Snippet < ActiveRecord::Base
2
2
 
3
3
  ComfortableMexicanSofa.establish_connection(self)
4
4
 
5
- set_table_name :cms_snippets
5
+ self.table_name = 'cms_snippets'
6
6
 
7
7
  cms_is_categorized
8
8
  cms_is_mirrored
@@ -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.2"
8
+ s.version = "1.6.3"
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 = "2011-12-20"
12
+ s.date = "2011-12-30"
13
13
  s.description = ""
14
14
  s.email = "oleg@theworkinggroup.ca"
15
15
  s.extra_rdoc_files = [
@@ -173,6 +173,7 @@ Gem::Specification.new do |s|
173
173
  "config/initializers/paperclip.rb",
174
174
  "config/locales/en.yml",
175
175
  "config/locales/es.yml",
176
+ "config/locales/pt-BR.yml",
176
177
  "config/routes.rb",
177
178
  "db/cms_fixtures/example.com/layouts/default/_default.yml",
178
179
  "db/cms_fixtures/example.com/layouts/default/content.html",
@@ -190,13 +191,13 @@ Gem::Specification.new do |s|
190
191
  "db/cms_fixtures/example.com/snippets/default/_default.yml",
191
192
  "db/cms_fixtures/example.com/snippets/default/content.html",
192
193
  "db/migrate/01_create_cms.rb",
193
- "db/migrate/upgrades/02_upgrade_to_1_1_0.rb",
194
- "db/migrate/upgrades/03_upgrade_to_1_2_0.rb",
195
- "db/migrate/upgrades/04_upgrade_to_1_3_0.rb",
196
- "db/migrate/upgrades/05_upgrade_to_1_4_0.rb",
197
- "db/migrate/upgrades/06_upgrade_to_1_5_0.rb",
198
- "db/migrate/upgrades/07_upgrade_to_1_6_0.rb",
199
194
  "db/seeds.rb",
195
+ "db/upgrade_migrations/02_upgrade_to_1_1_0.rb",
196
+ "db/upgrade_migrations/03_upgrade_to_1_2_0.rb",
197
+ "db/upgrade_migrations/04_upgrade_to_1_3_0.rb",
198
+ "db/upgrade_migrations/05_upgrade_to_1_4_0.rb",
199
+ "db/upgrade_migrations/06_upgrade_to_1_5_0.rb",
200
+ "db/upgrade_migrations/07_upgrade_to_1_6_0.rb",
200
201
  "doc/preview.png",
201
202
  "doc/sofa.png",
202
203
  "lib/comfortable_mexican_sofa.rb",
@@ -266,8 +267,9 @@ Gem::Specification.new do |s|
266
267
  "test/functional/cms_admin/sites_controller_test.rb",
267
268
  "test/functional/cms_admin/snippets_controller_test.rb",
268
269
  "test/functional/cms_content_controller_test.rb",
269
- "test/gemfiles/Gemfile.rails-3.0",
270
- "test/gemfiles/Gemfile.rails-3.1",
270
+ "test/gemfiles/Gemfile.rails.3.0",
271
+ "test/gemfiles/Gemfile.rails.3.1",
272
+ "test/gemfiles/Gemfile.rails.3.2",
271
273
  "test/integration/authentication_test.rb",
272
274
  "test/integration/fixtures_test.rb",
273
275
  "test/integration/mirrors_test.rb",
@@ -0,0 +1,230 @@
1
+ # encoding: utf-8
2
+ pt-BR:
3
+ # -- Models ---------------------------------------------------------------
4
+ attributes:
5
+ label: Nome
6
+ parent_id: Pai
7
+ content: Conteúdo
8
+ slug: Identificador
9
+ identifier: Identificador
10
+ activerecord:
11
+ models:
12
+ cms/site: Site
13
+ cms/layout: Leiaute
14
+ cms/page: Página
15
+ cms/snippet: Fragmento
16
+ attributes:
17
+ cms/site:
18
+ hostname: Nome do Host
19
+ path: Caminho
20
+ locale: Idioma
21
+ is_mirrored: Espelhado
22
+ cms/layout:
23
+ label: Nome do Leiaute
24
+ app_layout: Leiaute da Aplicação
25
+ parent_id: Leiaute Pai
26
+ css: Stylesheet
27
+ js: Javascript
28
+ cms/page:
29
+ label: Título
30
+ layout_id: Leiaute
31
+ slug: Identificador
32
+ target_page_id: Redirecionar para a Página
33
+ is_published: Publicada
34
+ cms/file:
35
+ file: Arquivo
36
+ description: Descrição
37
+ cms/snippet:
38
+ identifier: Identificador
39
+
40
+ # -- Controllers ----------------------------------------------------------
41
+ cms:
42
+ base:
43
+ site_not_found: Site não encontrado
44
+ fixtures_enabled: Os Fixtures do CMS estão ativados. Todas as mudanças feitas aqui serão descartadas.
45
+
46
+ sites:
47
+ created: Site criado
48
+ creation_failure: Não foi possível criar site
49
+ updated: Site atualizado
50
+ update_failure: Não foi possível atualizar site
51
+ deleted: Site excluído
52
+ not_found: Site não encontrado
53
+
54
+ layouts:
55
+ created: Leiaute criado
56
+ creation_failure: Não foi possível criar leiaute
57
+ updated: Leiaute atualizado
58
+ update_failure: Não foi possível atualizar leiaute
59
+ deleted: Leiaute excluído
60
+ not_found: Leiaute não encontrado
61
+
62
+ pages:
63
+ created: Página criada
64
+ creation_failure: Não foi possível criar página
65
+ updated: Página atualizada
66
+ update_failure: Não foi possível atualizar página
67
+ deleted: Página excluída
68
+ not_found: Página não encontrada
69
+ layout_not_found: "Nenhum leiaute encontrado. Por favor, crie um."
70
+
71
+ snippets:
72
+ created: Fragmento criado
73
+ creation_failure: Não foi possível criar fragmento
74
+ updated: Fragmento atualizado
75
+ update_failure: Não foi possível atualizar fragmento
76
+ deleted: Fragmento excluído
77
+ not_found: Fragmento não encontrado
78
+
79
+ revisions:
80
+ reverted: Conteúdo Revertido
81
+ record_not_found: Registro Não Encontrado
82
+ not_found: Revisão Não Encontrada
83
+
84
+ files:
85
+ created: Arquivo enviado
86
+ creation_failure: Não foi possível enviar arquivo
87
+ updated: Arquivo atualizado
88
+ update_failure: Não foi possível atualizar arquivo
89
+ deleted: Arquivo excluído
90
+ not_found: Arquivo não encontrado
91
+
92
+ content:
93
+ site_not_found: Site Não Encontrado
94
+ layout_not_found: Leiaute Não Encontrado
95
+ page_not_found: Página Não Encontrada
96
+
97
+ # -- Views ----------------------------------------------------------------
98
+ cms_admin:
99
+ base:
100
+ sites: Sites
101
+ layouts: Leiautes
102
+ pages: Páginas
103
+ snippets: Fragmentos
104
+ files: Arquivos
105
+
106
+ sites:
107
+ index:
108
+ title: Sites
109
+ new_link: Criar Novo Site
110
+ select: Selecionar Site
111
+ edit: Editar
112
+ delete: Excluir
113
+ are_you_sure: Tem certeza que deseja excluir este site?
114
+ new:
115
+ title: Novo Site
116
+ edit:
117
+ title: Editando Site
118
+ form:
119
+ create: Criar Site
120
+ update: Atualizar Site
121
+
122
+ layouts:
123
+ index:
124
+ title: Leiautes
125
+ new_link: Criar Novo Leiaute
126
+ index_branch:
127
+ add_child_layout: Adicionar Leiaute Filho
128
+ edit: Editar
129
+ delete: Excluir
130
+ are_you_sure: Tem certeza?
131
+ new:
132
+ title: Novo Leiaute
133
+ edit:
134
+ title: Editando Leiaute
135
+ revision: Revisão
136
+ form:
137
+ select_parent_layout: Selecione o Leiaute Pai
138
+ select_app_layout: Selecione o Leiaute da Aplicação
139
+ create: Criar Leiaute
140
+ update: Atualizar Leiaute
141
+
142
+ pages:
143
+ index:
144
+ title: Páginas
145
+ new_link: Criar Nova Página
146
+ index_branch:
147
+ toggle: Alterar
148
+ add_child_page: Adicionar Página Filha
149
+ edit: Editar
150
+ delete: Excluir
151
+ are_you_sure: Tem certeza?
152
+ new:
153
+ title: Nova Página
154
+ edit:
155
+ title: Editando Página
156
+ revision: Revisão
157
+ form:
158
+ select_target_page: Sem Redirecionar
159
+ preview: Pré-visualização
160
+ create: Criar Página
161
+ update: Atualizar Página
162
+ form_blocks:
163
+ no_tags: |-
164
+ O leiaute não possui tags de conteúdo definidas.<br/>
165
+ Edite o conteúdo e inclua uma tag de página ou de campo. Por exemplo: <code>{{cms:page:content}}</code>
166
+
167
+ snippets:
168
+ index:
169
+ title: Fragmentos
170
+ new_link: Criar Novo Fragmento
171
+ edit: Editar
172
+ delete: Excluir
173
+ are_you_sure: Tem certeza?
174
+ new:
175
+ title: Novo Fragmento
176
+ edit:
177
+ title: Editando Fragmento
178
+ revision: Revisão
179
+ form:
180
+ create: Criar Fragmento
181
+ update: Atualizar Fragmento
182
+
183
+ revisions:
184
+ show:
185
+ title: Revisões de
186
+ revision: Revisão
187
+ full_path: Caminho completo
188
+ slug: Identificador
189
+ update: Atualizar para esta revisão
190
+
191
+ files:
192
+ index:
193
+ title: Arquivos
194
+ new_link: Enviar Novo Arquivo
195
+ edit: Editar
196
+ delete: Excluir
197
+ are_you_sure: Tem certeza?
198
+ button: Enviar Arquivos
199
+ new:
200
+ title: Novo Arquivo
201
+ edit:
202
+ title: Editando Arquivo
203
+ form:
204
+ current_file: Arquivo Atual
205
+ create: Enviar Arquivo
206
+ update: Atualizar Arquivo
207
+ page_form:
208
+ are_you_sure: Tem certeza?
209
+ file:
210
+ are_you_sure: Tem certeza?
211
+
212
+ categories:
213
+ index:
214
+ label: Categorias
215
+ edit: Editar
216
+ done: Pronto
217
+ all: Todas
218
+ add: Adicionar
219
+ show:
220
+ are_you_sure: Tem certeza?
221
+ edit:
222
+ save: Salvar
223
+ form:
224
+ label: Categorias
225
+
226
+ dialogs:
227
+ image:
228
+ insert: Inserir Imagem
229
+ link:
230
+ create: Criar Link
@@ -1,2 +1,2 @@
1
- Home Page Fixture Content
1
+ Home Page Fixture Contént
2
2
  {{ cms:snippet:default }}
@@ -1,6 +1,6 @@
1
1
  class UpgradeTo160 < ActiveRecord::Migration
2
2
  def self.up
3
- add_column :cms_sites, :identifier, :string, :null => false
3
+ add_column :cms_sites, :identifier, :string
4
4
  add_index :cms_sites, :identifier
5
5
 
6
6
  rename_column :cms_layouts, :slug, :identifier
@@ -62,7 +62,7 @@ class ComfortableMexicanSofa::Configuration
62
62
  @enable_fixtures = false
63
63
  @fixtures_path = File.expand_path('db/cms_fixtures', Rails.root)
64
64
  @revisions_limit = 25
65
- @locales = { :en => 'English', :es => 'Español' }
65
+ @locales = { :en => 'English', :es => 'Español', 'pt-BR' => 'Brazilian Portuguese' }
66
66
  @admin_locale = nil
67
67
  @database_config = nil
68
68
  end
@@ -38,17 +38,17 @@ module ComfortableMexicanSofa::Fixtures
38
38
  # updating content
39
39
  if File.exists?(file_path = File.join(path, 'content.html'))
40
40
  if layout.new_record? || File.mtime(file_path) > layout.updated_at
41
- layout.content = File.open(file_path, 'rb').read
41
+ layout.content = File.open(file_path).read
42
42
  end
43
43
  end
44
44
  if File.exists?(file_path = File.join(path, 'css.css'))
45
45
  if layout.new_record? || File.mtime(file_path) > layout.updated_at
46
- layout.css = File.open(file_path, 'rb').read
46
+ layout.css = File.open(file_path).read
47
47
  end
48
48
  end
49
49
  if File.exists?(file_path = File.join(path, 'js.js'))
50
50
  if layout.new_record? || File.mtime(file_path) > layout.updated_at
51
- layout.js = File.open(file_path, 'rb').read
51
+ layout.js = File.open(file_path).read
52
52
  end
53
53
  end
54
54
 
@@ -110,7 +110,7 @@ module ComfortableMexicanSofa::Fixtures
110
110
  identifier = file_path.split('/').last.split('.').first
111
111
  blocks_attributes << {
112
112
  :identifier => identifier,
113
- :content => File.open(file_path, 'rb').read
113
+ :content => File.open(file_path).read
114
114
  }
115
115
  end
116
116
  end
@@ -162,7 +162,7 @@ module ComfortableMexicanSofa::Fixtures
162
162
  # updating content
163
163
  if File.exists?(file_path = File.join(path, 'content.html'))
164
164
  if snippet.new_record? || File.mtime(file_path) > snippet.updated_at
165
- snippet.content = File.open(file_path, 'rb').read
165
+ snippet.content = File.open(file_path).read
166
166
  end
167
167
  end
168
168
 
@@ -28,12 +28,17 @@ class CmsGenerator < Rails::Generators::Base
28
28
  directory 'app/assets/javascripts/comfortable_mexican_sofa', 'public/javascripts/comfortable_mexican_sofa'
29
29
  directory 'app/assets/images/comfortable_mexican_sofa', 'public/images/comfortable_mexican_sofa'
30
30
 
31
- gsub_file 'public/stylesheets/comfortable_mexican_sofa/content.css',
32
- '/assets/comfortable_mexican_sofa/', '/images/comfortable_mexican_sofa/'
33
- gsub_file 'public/stylesheets/comfortable_mexican_sofa/widgets.css',
34
- '/assets/comfortable_mexican_sofa/', '/images/comfortable_mexican_sofa/'
35
- gsub_file 'public/stylesheets/comfortable_mexican_sofa/jquery_ui.css',
36
- '/assets/comfortable_mexican_sofa/', '/images/comfortable_mexican_sofa/'
31
+ files_to_be_changed = [
32
+ 'public/stylesheets/comfortable_mexican_sofa/content.css',
33
+ 'public/stylesheets/comfortable_mexican_sofa/widgets.css',
34
+ 'public/stylesheets/comfortable_mexican_sofa/jquery_ui.css',
35
+ 'public/stylesheets/comfortable_mexican_sofa/elrte.css',
36
+ 'public/stylesheets/comfortable_mexican_sofa/files.css'
37
+ ]
38
+
39
+ files_to_be_changed.each do |file_path|
40
+ gsub_file file_path, '/assets/comfortable_mexican_sofa/', '/images/comfortable_mexican_sofa/'
41
+ end
37
42
  end
38
43
 
39
44
  def generate_cms_seeds
@@ -0,0 +1,10 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '3.2.0.rc1'
4
+ gem 'active_link_to', '~>1.0.0'
5
+ gem 'paperclip', '~>2.3.0'
6
+
7
+ group :test do
8
+ gem 'sqlite3'
9
+ gem 'jeweler'
10
+ end
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require File.expand_path('../test_helper', File.dirname(__FILE__))
2
4
 
3
5
  class FixturesTest < ActionDispatch::IntegrationTest
@@ -34,7 +36,7 @@ class FixturesTest < ActionDispatch::IntegrationTest
34
36
  assert_equal 'Default Fixture Layout', Cms::Layout.find_by_identifier('default').label
35
37
  assert_equal 'Default Fixture Snippet', Cms::Snippet.find_by_identifier('default').label
36
38
 
37
- assert_equal "<html>\n <body>\n Home Page Fixture Content\nFixture Content for Default Snippet\n </body>\n</html>", response.body
39
+ assert_equal "<html>\n <body>\n Home Page Fixture Contént\nFixture Content for Default Snippet\n </body>\n</html>", response.body
38
40
  end
39
41
  end
40
42
  end
@@ -4,21 +4,23 @@ class RoutingExtensionsTest < ActionDispatch::IntegrationTest
4
4
 
5
5
  def teardown
6
6
  reset_config
7
- load(File.expand_path('config/routes.rb', Rails.root))
7
+ Rails.application.reload_routes!
8
8
  end
9
9
 
10
10
  def test_get_admin_with_admin_route_prefix
11
11
  ComfortableMexicanSofa.config.admin_route_prefix = 'custom-admin'
12
- load(File.expand_path('config/routes.rb', Rails.root))
12
+ Rails.application.reload_routes!
13
13
 
14
- assert_equal '/custom-admin/sites', cms_admin_sites_path
15
- http_auth :get, cms_admin_sites_path
14
+ http_auth :get, '/cms-admin/sites'
15
+ assert_response 404
16
+
17
+ http_auth :get, '/custom-admin/sites'
16
18
  assert_response :success
17
19
  end
18
20
 
19
21
  def test_get_admin_with_admin_route_redirect
20
22
  ComfortableMexicanSofa.config.admin_route_redirect = '/cms-admin/sites'
21
- load(File.expand_path('config/routes.rb', Rails.root))
23
+ Rails.application.reload_routes!
22
24
 
23
25
  http_auth :get, '/cms-admin'
24
26
  assert_response :redirect
@@ -27,7 +29,7 @@ class RoutingExtensionsTest < ActionDispatch::IntegrationTest
27
29
 
28
30
  def test_get_admin_with_admin_route_prefix_disabled
29
31
  ComfortableMexicanSofa.config.admin_route_prefix = ''
30
- load(File.expand_path('config/routes.rb', Rails.root))
32
+ Rails.application.reload_routes!
31
33
 
32
34
  http_auth :get, '/cms-admin'
33
35
  assert_response 404
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require File.expand_path('../test_helper', File.dirname(__FILE__))
2
4
 
3
5
  class FixturesTest < ActiveSupport::TestCase
@@ -88,7 +90,7 @@ class FixturesTest < ActiveSupport::TestCase
88
90
  assert page = Cms::Page.find_by_full_path('/')
89
91
  assert_equal layout, page.layout
90
92
  assert_equal 'index', page.slug
91
- assert_equal "<html>Home Page Fixture Content\ndefault_snippet_content</html>", page.content
93
+ assert_equal "<html>Home Page Fixture Contént\ndefault_snippet_content</html>", page.content
92
94
  assert page.is_published?
93
95
 
94
96
  assert child_page = Cms::Page.find_by_full_path('/child')
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.2
4
+ version: 1.6.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-12-20 00:00:00.000000000Z
13
+ date: 2011-12-30 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &70266720140420 !ruby/object:Gem::Requirement
17
+ requirement: &70148499151060 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70266720140420
25
+ version_requirements: *70148499151060
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: active_link_to
28
- requirement: &70266720139840 !ruby/object:Gem::Requirement
28
+ requirement: &70148499149820 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70266720139840
36
+ version_requirements: *70148499149820
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: paperclip
39
- requirement: &70266720139320 !ruby/object:Gem::Requirement
39
+ requirement: &70148499148020 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: 2.3.0
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70266720139320
47
+ version_requirements: *70148499148020
48
48
  description: ''
49
49
  email: oleg@theworkinggroup.ca
50
50
  executables: []
@@ -209,6 +209,7 @@ files:
209
209
  - config/initializers/paperclip.rb
210
210
  - config/locales/en.yml
211
211
  - config/locales/es.yml
212
+ - config/locales/pt-BR.yml
212
213
  - config/routes.rb
213
214
  - db/cms_fixtures/example.com/layouts/default/_default.yml
214
215
  - db/cms_fixtures/example.com/layouts/default/content.html
@@ -226,13 +227,13 @@ files:
226
227
  - db/cms_fixtures/example.com/snippets/default/_default.yml
227
228
  - db/cms_fixtures/example.com/snippets/default/content.html
228
229
  - db/migrate/01_create_cms.rb
229
- - db/migrate/upgrades/02_upgrade_to_1_1_0.rb
230
- - db/migrate/upgrades/03_upgrade_to_1_2_0.rb
231
- - db/migrate/upgrades/04_upgrade_to_1_3_0.rb
232
- - db/migrate/upgrades/05_upgrade_to_1_4_0.rb
233
- - db/migrate/upgrades/06_upgrade_to_1_5_0.rb
234
- - db/migrate/upgrades/07_upgrade_to_1_6_0.rb
235
230
  - db/seeds.rb
231
+ - db/upgrade_migrations/02_upgrade_to_1_1_0.rb
232
+ - db/upgrade_migrations/03_upgrade_to_1_2_0.rb
233
+ - db/upgrade_migrations/04_upgrade_to_1_3_0.rb
234
+ - db/upgrade_migrations/05_upgrade_to_1_4_0.rb
235
+ - db/upgrade_migrations/06_upgrade_to_1_5_0.rb
236
+ - db/upgrade_migrations/07_upgrade_to_1_6_0.rb
236
237
  - doc/preview.png
237
238
  - doc/sofa.png
238
239
  - lib/comfortable_mexican_sofa.rb
@@ -302,8 +303,9 @@ files:
302
303
  - test/functional/cms_admin/sites_controller_test.rb
303
304
  - test/functional/cms_admin/snippets_controller_test.rb
304
305
  - test/functional/cms_content_controller_test.rb
305
- - test/gemfiles/Gemfile.rails-3.0
306
- - test/gemfiles/Gemfile.rails-3.1
306
+ - test/gemfiles/Gemfile.rails.3.0
307
+ - test/gemfiles/Gemfile.rails.3.1
308
+ - test/gemfiles/Gemfile.rails.3.2
307
309
  - test/integration/authentication_test.rb
308
310
  - test/integration/fixtures_test.rb
309
311
  - test/integration/mirrors_test.rb
@@ -358,7 +360,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
358
360
  version: '0'
359
361
  segments:
360
362
  - 0
361
- hash: -3318486019662235143
363
+ hash: -1734611149156211223
362
364
  required_rubygems_version: !ruby/object:Gem::Requirement
363
365
  none: false
364
366
  requirements: