camaleon_cms 2.1.2.1 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of camaleon_cms might be problematic. Click here for more details.

Files changed (186) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -4
  3. data/app/apps/plugins/attack/attack_helper.rb +3 -0
  4. data/app/apps/plugins/attack/config/custom_models.rb +4 -2
  5. data/app/apps/plugins/attack/config/locales/translation.yml +19 -0
  6. data/app/apps/plugins/attack/models/attack.rb +1 -1
  7. data/app/apps/plugins/front_cache/config/initializer.rb +4 -2
  8. data/app/apps/plugins/front_cache/config/locales/translation.yml +19 -0
  9. data/app/apps/themes/camaleon_first/main_helper.rb +1 -3
  10. data/app/apps/themes/default/views/admin/settings.html.erb +0 -1
  11. data/app/apps/themes/default/views/layouts/index.html.erb +5 -5
  12. data/app/apps/themes/new/assets/css/main.css +1 -1
  13. data/app/apps/themes/new/assets/js/main.js +1 -1
  14. data/app/apps/themes/new/views/admin/settings.html.erb +1 -1
  15. data/app/assets/images/camaleon_cms/language/{pt_br.png → pt-BR.png} +0 -0
  16. data/app/assets/javascripts/camaleon_cms/admin/_custom_fields.js +105 -51
  17. data/app/assets/javascripts/camaleon_cms/admin/_libraries.js +4 -2
  18. data/app/assets/javascripts/camaleon_cms/admin/_translator.js +2 -2
  19. data/app/assets/javascripts/camaleon_cms/admin/custom_fields_form.js +9 -7
  20. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/{pt_br.js → pt-BR.js} +0 -0
  21. data/app/assets/javascripts/camaleon_cms/admin/momentjs/{pt_br.js → pt-BR.js} +1 -1
  22. data/app/assets/javascripts/camaleon_cms/admin/nav_menu.js.coffee +15 -1
  23. data/app/assets/javascripts/camaleon_cms/admin/tinymce/langs/{pt_br.js → pt-BR.js} +1 -1
  24. data/app/assets/javascripts/camaleon_cms/admin/uploader/_media_manager.js.coffee +24 -12
  25. data/app/assets/stylesheets/camaleon_cms/admin/_custom_admin.css.scss +9 -0
  26. data/app/assets/stylesheets/camaleon_cms/admin/lte/_admin.css.scss +1 -1
  27. data/app/controllers/camaleon_cms/admin/appearances/nav_menus_controller.rb +13 -6
  28. data/app/controllers/camaleon_cms/admin/appearances/themes_controller.rb +1 -1
  29. data/app/controllers/camaleon_cms/admin/appearances/widgets/assign_controller.rb +1 -1
  30. data/app/controllers/camaleon_cms/admin/appearances/widgets/main_controller.rb +1 -1
  31. data/app/controllers/camaleon_cms/admin/appearances/widgets/sidebar_controller.rb +1 -1
  32. data/app/controllers/camaleon_cms/admin/comments_controller.rb +1 -1
  33. data/app/controllers/camaleon_cms/admin/media_controller.rb +15 -5
  34. data/app/controllers/camaleon_cms/admin/plugins_controller.rb +1 -1
  35. data/app/controllers/camaleon_cms/admin/settings/custom_fields_controller.rb +14 -8
  36. data/app/controllers/camaleon_cms/admin/settings_controller.rb +22 -7
  37. data/app/controllers/camaleon_cms/admin/user_roles_controller.rb +1 -1
  38. data/app/controllers/camaleon_cms/admin/users_controller.rb +1 -1
  39. data/app/controllers/camaleon_cms/apps/plugins_admin_controller.rb +4 -1
  40. data/app/controllers/camaleon_cms/apps/plugins_front_controller.rb +5 -10
  41. data/app/controllers/camaleon_cms/apps/themes_front_controller.rb +1 -4
  42. data/app/controllers/camaleon_cms/camaleon_controller.rb +4 -13
  43. data/app/controllers/camaleon_cms/frontend_controller.rb +15 -9
  44. data/app/controllers/concerns/camaleon_cms/frontend_concern.rb +17 -8
  45. data/app/decorators/camaleon_cms/application_decorator.rb +3 -3
  46. data/app/decorators/camaleon_cms/custom_fields_concern.rb +21 -6
  47. data/app/decorators/camaleon_cms/post_comment_decorator.rb +21 -0
  48. data/app/decorators/camaleon_cms/site_decorator.rb +5 -5
  49. data/app/decorators/camaleon_cms/theme_decorator.rb +10 -0
  50. data/app/decorators/camaleon_cms/user_decorator.rb +2 -2
  51. data/app/helpers/camaleon_cms/admin/custom_fields_helper.rb +24 -2
  52. data/app/helpers/camaleon_cms/admin/menus_helper.rb +13 -12
  53. data/app/helpers/camaleon_cms/frontend/application_helper.rb +1 -1
  54. data/app/helpers/camaleon_cms/frontend/nav_menu_helper.rb +7 -6
  55. data/app/helpers/camaleon_cms/plugins_helper.rb +20 -18
  56. data/app/helpers/camaleon_cms/site_helper.rb +1 -20
  57. data/app/helpers/camaleon_cms/theme_helper.rb +1 -1
  58. data/app/helpers/camaleon_cms/uploader_helper.rb +25 -20
  59. data/app/helpers/camaleon_cms/user_roles_helper.rb +6 -1
  60. data/app/mailers/camaleon_cms/html_mailer.rb +2 -1
  61. data/app/models/camaleon_cms/ability.rb +3 -26
  62. data/app/models/camaleon_cms/custom_field.rb +2 -1
  63. data/app/models/camaleon_cms/custom_field_group.rb +23 -22
  64. data/app/models/camaleon_cms/custom_fields_relationship.rb +1 -1
  65. data/app/models/camaleon_cms/nav_menu.rb +1 -1
  66. data/app/models/camaleon_cms/nav_menu_item.rb +12 -19
  67. data/app/models/camaleon_cms/post.rb +1 -1
  68. data/app/models/camaleon_cms/post_comment.rb +3 -1
  69. data/app/models/camaleon_cms/post_default.rb +1 -1
  70. data/app/models/camaleon_cms/post_type.rb +5 -4
  71. data/app/models/camaleon_cms/site.rb +12 -0
  72. data/app/models/camaleon_cms/term_taxonomy.rb +1 -1
  73. data/app/models/camaleon_cms/user_role.rb +5 -1
  74. data/app/models/concerns/camaleon_cms/custom_fields_read.rb +99 -49
  75. data/app/uploaders/camaleon_cms_aws_uploader.rb +1 -1
  76. data/app/uploaders/camaleon_cms_local_uploader.rb +19 -3
  77. data/app/uploaders/camaleon_cms_uploader.rb +13 -6
  78. data/app/views/camaleon_cms/admin/appearances/nav_menus/_custom_menus.html.erb +9 -2
  79. data/app/views/camaleon_cms/admin/appearances/nav_menus/_form.html.erb +1 -1
  80. data/app/views/camaleon_cms/admin/appearances/nav_menus/_menu_items.html.erb +2 -2
  81. data/app/views/camaleon_cms/admin/appearances/themes/index.html.erb +1 -3
  82. data/app/views/camaleon_cms/admin/media/_render_file_item.html.erb +1 -0
  83. data/app/views/camaleon_cms/admin/media/index.html.erb +3 -3
  84. data/app/views/camaleon_cms/admin/posts/_sidebar.html.erb +1 -1
  85. data/app/views/camaleon_cms/admin/posts/form.html.erb +1 -1
  86. data/app/views/camaleon_cms/admin/settings/_configuration_settings.html.erb +4 -0
  87. data/app/views/camaleon_cms/admin/settings/custom_fields/_get_items.html.erb +6 -6
  88. data/app/views/camaleon_cms/admin/settings/custom_fields/_meta_data.html.erb +0 -9
  89. data/app/views/camaleon_cms/admin/settings/custom_fields/_render.html.erb +39 -55
  90. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_audio.html.erb +1 -1
  91. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_checkbox.html.erb +2 -2
  92. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_checkboxes.html.erb +3 -3
  93. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_colorpicker.html.erb +3 -3
  94. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_date.html.erb +3 -3
  95. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_editor.html.erb +2 -2
  96. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_email.html.erb +1 -1
  97. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_field_attrs.html.erb +3 -3
  98. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_file.html.erb +1 -1
  99. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_image.html.erb +2 -2
  100. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_numeric.html.erb +1 -1
  101. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_phone.html.erb +1 -1
  102. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_posts.html.erb +3 -3
  103. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_private_file.html.erb +4 -0
  104. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_radio.html.erb +3 -3
  105. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_select.html.erb +3 -3
  106. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_select_eval.html.erb +1 -1
  107. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_text_area.html.erb +2 -2
  108. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_text_box.html.erb +2 -2
  109. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_url.html.erb +1 -1
  110. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_users.html.erb +1 -1
  111. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_video.html.erb +1 -1
  112. data/app/views/camaleon_cms/admin/settings/custom_fields/form.html.erb +8 -0
  113. data/app/views/camaleon_cms/admin/settings/site.html.erb +1 -20
  114. data/app/views/camaleon_cms/admin/settings/theme.html.erb +20 -0
  115. data/app/views/camaleon_cms/admin/user_roles/form.html.erb +2 -2
  116. data/app/views/camaleon_cms/default_theme/admin/settings.html.erb +0 -1
  117. data/app/views/camaleon_cms/default_theme/partials/_comments.html.erb +0 -2
  118. data/app/views/camaleon_cms/default_theme/partials/_search_form.html.erb +1 -1
  119. data/app/views/camaleon_cms/default_theme/partials/_sidebar.html.erb +3 -3
  120. data/app/views/layouts/camaleon_cms/admin/_footer.html.erb +1 -1
  121. data/config/initializers/action_view.rb +12 -7
  122. data/config/initializers/custom_initializers.rb +6 -12
  123. data/config/locales/camaleon_cms/admin/en.yml +1 -0
  124. data/config/locales/camaleon_cms/admin/es.yml +4 -0
  125. data/config/locales/camaleon_cms/admin/it.yml +1 -24
  126. data/config/locales/camaleon_cms/admin/js.yml +41 -0
  127. data/config/locales/camaleon_cms/admin/{pt_br.yml → pt-BR.yml} +48 -18
  128. data/config/locales/camaleon_cms/common.yml +66 -0
  129. data/config/locales/camaleon_cms/languages.yml +13 -0
  130. data/config/locales/camaleon_cms/routes.yml +2 -2
  131. data/config/routes/admin.rb +3 -0
  132. data/config/system.json +3 -3
  133. data/db/migrate/20160606135421_improve_menus_structure.rb +7 -0
  134. data/db/migrate/20160609121449_add_group_to_custom_field_values.rb +5 -0
  135. data/lib/camaleon_cms/engine.rb +4 -3
  136. data/lib/camaleon_cms/version.rb +1 -1
  137. data/lib/ext/string.rb +20 -0
  138. data/lib/ext/translator.rb +2 -2
  139. data/lib/generators/camaleon_cms/gem_plugin_generator.rb +1 -1
  140. data/lib/generators/camaleon_cms/gem_plugin_template/config/camaleon_plugin.json +1 -1
  141. data/lib/generators/camaleon_cms/install_generator.rb +1 -0
  142. data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/main_helper.rb +1 -4
  143. data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/views/index.html.erb +1 -25
  144. data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/views/layouts/index.html.erb +17 -18
  145. data/lib/plugin_routes.rb +4 -4
  146. metadata +25 -48
  147. data/app/apps/plugins/contact_form/admin_forms_controller.rb +0 -85
  148. data/app/apps/plugins/contact_form/assets/css/admin/form-builder/formbuilder.css +0 -70
  149. data/app/apps/plugins/contact_form/assets/css/contact-form.css +0 -8
  150. data/app/apps/plugins/contact_form/assets/css/front/railsform.scss +0 -94
  151. data/app/apps/plugins/contact_form/assets/css/readme.txt +0 -1
  152. data/app/apps/plugins/contact_form/assets/js/contact_form.js +0 -2
  153. data/app/apps/plugins/contact_form/assets/js/form-builder/formbuilder.js +0 -1271
  154. data/app/apps/plugins/contact_form/assets/js/form-builder/vendor.js +0 -3072
  155. data/app/apps/plugins/contact_form/assets/js/readme.txt +0 -1
  156. data/app/apps/plugins/contact_form/config/config.json +0 -35
  157. data/app/apps/plugins/contact_form/config/custom_models.rb +0 -3
  158. data/app/apps/plugins/contact_form/config/locales/readme.txt +0 -1
  159. data/app/apps/plugins/contact_form/config/locales/translation.yml +0 -315
  160. data/app/apps/plugins/contact_form/config/routes_admin.txt +0 -4
  161. data/app/apps/plugins/contact_form/config/routes_front.txt +0 -2
  162. data/app/apps/plugins/contact_form/contact_form_helper.rb +0 -154
  163. data/app/apps/plugins/contact_form/contact_form_html_helper.rb +0 -140
  164. data/app/apps/plugins/contact_form/front_controller.rb +0 -50
  165. data/app/apps/plugins/contact_form/models/contact_form.rb +0 -26
  166. data/app/apps/plugins/contact_form/views/admin_forms/_form.html.erb +0 -33
  167. data/app/apps/plugins/contact_form/views/admin_forms/edit.html.erb +0 -338
  168. data/app/apps/plugins/contact_form/views/admin_forms/index.html.erb +0 -65
  169. data/app/apps/plugins/contact_form/views/admin_forms/responses.html.erb +0 -60
  170. data/app/apps/plugins/contact_form/views/contact_form/_email_content.html.erb +0 -26
  171. data/app/apps/plugins/contact_form/views/forms_shorcode.html.erb +0 -28
  172. data/app/apps/plugins/contact_form/views/front/index.html.erb +0 -3
  173. data/app/apps/themes/camaleon_first/views/admin/settings.html.erb +0 -4
  174. data/app/apps/themes/new/assets/css/bootstrap/bootstrap.min.css +0 -6735
  175. data/app/apps/themes/new/assets/js/plugins/bootstrap/bootstrap.min.js +0 -6
  176. data/app/apps/themes/new/assets/js/plugins/jquery/jquery.min.js +0 -4
  177. data/lib/generators/camaleon_cms/gem_theme_generator.rb +0 -97
  178. data/lib/generators/camaleon_cms/gem_theme_template/app/assets/images/themes/my_plugin/image.png +0 -0
  179. data/lib/generators/camaleon_cms/gem_theme_template/app/assets/javascripts/themes/my_plugin/main.js +0 -14
  180. data/lib/generators/camaleon_cms/gem_theme_template/app/assets/stylesheets/themes/my_plugin/main.css +0 -13
  181. data/lib/generators/camaleon_cms/gem_theme_template/app/helpers/themes/my_plugin/main_helper.rb +0 -26
  182. data/lib/generators/camaleon_cms/gem_theme_template/app/views/themes/my_plugin/admin/settings.html.erb +0 -4
  183. data/lib/generators/camaleon_cms/gem_theme_template/app/views/themes/my_plugin/index.html.erb +0 -25
  184. data/lib/generators/camaleon_cms/gem_theme_template/app/views/themes/my_plugin/layouts/index.html.erb +0 -70
  185. data/lib/generators/camaleon_cms/gem_theme_template/app/views/themes/my_plugin/partials/readme.txt +0 -1
  186. data/lib/generators/camaleon_cms/gem_theme_template/config/camaleon_theme.json +0 -14
@@ -4,6 +4,8 @@
4
4
  en:
5
5
  camaleon_cms:
6
6
  common:
7
+ profile: "Profile"
8
+ dashboard: "Dashboard"
7
9
  read_more: "Read More"
8
10
  submit: "Submit"
9
11
  send: "Send"
@@ -321,3 +323,67 @@ ru:
321
323
  previous_label: 'Предыдущий'
322
324
  next_label: 'Следующий'
323
325
 
326
+ pt-BR:
327
+ camaleon_cms:
328
+ common:
329
+ profile: "Perfil"
330
+ dashboard: "Página Inicial"
331
+ read_more: "Ler Mais"
332
+ submit: "Submeter"
333
+ send: "Enviar"
334
+ login: "Login"
335
+ logout: "Sair"
336
+ confirm: "Você tem certeza?"
337
+ register: "Registrar"
338
+ proceted_article: 'Artigo Protegido'
339
+
340
+ comment_msg: "Você deve estar logado para postar um comentário"
341
+ comment: "Comentário"
342
+ comments: "Comentários"
343
+ message: "Mensagem"
344
+ leave_comment: "Deixar um comentário"
345
+ comment_new: "Novo comentário"
346
+ comment_saved: "Seu comentário foi salvo"
347
+ comment_error: "Ocorreu um erro ao tentar salvar o comentário"
348
+ comment_reply: "Responder"
349
+ edit: "Editar"
350
+
351
+ recent_posts: "Posts Recentes"
352
+
353
+ search_msg: "Procurar Resultados para:"
354
+ search_not_found: "A busca não achou nenhum item"
355
+ category_list: "Listagem de Categorias"
356
+ post_tag_list: "Lista de Tags"
357
+ sub_category_list: "Lista de Sub Categorias"
358
+ content_list: "Lista de Conteúdo: %s"
359
+ visit: "Visitar"
360
+ no_contents_found: "Nenhum conteúdo encontrado"
361
+ no_results_found: "Nenhum resultado encontrado"
362
+
363
+ author: "Autor"
364
+ site: "Site"
365
+ categories: "Categorias"
366
+ next: "Próximo"
367
+ prev: "Anterior"
368
+ current: "Atual"
369
+ search: "Procurar"
370
+ file_format_error: "Formato de arquivo não permitido"
371
+ file_size_exceeded: "Tamanho do arquivo excedeu o limite"
372
+
373
+ notice: "Novidades "
374
+ share: "Compatilhar em"
375
+ share_facebook: "Compartilhar no Facebook"
376
+ share_twitter: "Compatilhar no Twitter"
377
+ share_google_plus: "Compartilhar no Google Plus"
378
+ back_top: "Voltar para o topo"
379
+ total_followers_social: "Total de seguidores nas redes sociais"
380
+ latest_articles: "Últimos Artigos"
381
+ photo_gallery: "Galeria de Fotos"
382
+ home_galleries: "Ir para a home das Categorias"
383
+ addition: "Adição"
384
+ view_all_news: "Ver todas as notícias"
385
+ extra_attributes: "Atributos Extras"
386
+
387
+ will_paginate:
388
+ previous_label: 'Anterior'
389
+ next_label: 'Próximo'
@@ -57,3 +57,16 @@ nl:
57
57
  it: "Italiaans"
58
58
  ru: "Russisch"
59
59
  nl: "Nederlands"
60
+
61
+ pt-BR:
62
+ languages:
63
+ es: "Espanhol"
64
+ en: "Inglês"
65
+ fr: "Francês"
66
+ zh: "Chinês"
67
+ de: "Alemão"
68
+ pt: "Português (Portugal)"
69
+ it: "Italiano"
70
+ ru: "Russo"
71
+ nl: "Holandês"
72
+ pt-BR: "Português (Brasil)"
@@ -14,11 +14,11 @@ pt:
14
14
  search: buscar
15
15
  profile: perfil
16
16
 
17
- pt_br:
17
+ pt-BR:
18
18
  routes:
19
19
  group: grupo
20
20
  category: categoria
21
- tag: etiqueta
21
+ tag: tag
22
22
  search: buscar
23
23
  profile: perfil
24
24
 
@@ -55,6 +55,8 @@ Rails.application.routes.draw do
55
55
  end
56
56
  end
57
57
  get 'site'
58
+ get 'theme'
59
+ post 'save_theme'
58
60
  get "languages"
59
61
  get "shortcodes"
60
62
  post "languages" => :save_languages
@@ -123,6 +125,7 @@ Rails.application.routes.draw do
123
125
  resources :media, only: [:index] do
124
126
  match 'crop', via: :all, on: :collection
125
127
  get "ajax", on: :collection
128
+ get "download_private_file", on: :collection
126
129
  post "upload", on: :collection
127
130
  post "actions", on: :collection
128
131
  end
data/config/system.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "default_template": "default", // default template name for new sites
3
3
  "hooks": { }, // system hooks
4
4
  "skip_format_url": true, // enable or disable .html extension in the urls.
5
- "default_plugins": ["front_cache", "contact_form", "attack"], // Default plugins installed for each new site
6
- "available_languages": ["es", "en", "fr", "zh", "de", "it", "pt_br", "nl"], // Available languages for frontend panel, here all locales: https://github.com/svenfuchs/rails-i18n
7
- "admin_available_languages": ["en", "es", "it", "pt_br" , "nl"], //Available languages for the admin panel
5
+ "default_plugins": ["front_cache", "cama_contact_form", "attack"], // Default plugins installed for each new site
6
+ "available_languages": ["es", "en", "fr", "zh", "de", "it", "pt-BR", "nl"], // Available languages for frontend panel, here all locales: https://github.com/svenfuchs/rails-i18n
7
+ "admin_available_languages": ["en", "es", "it", "pt-BR" , "nl"], //Available languages for the admin panel
8
8
  "default_user_role": "client", // default user role for all new users
9
9
  "users_share_sites": true, //(boolean) true: permit to share users between sites, false: All users are assigned for an unique site.
10
10
  "db_prefix": "", // prefix name for database tables
@@ -0,0 +1,7 @@
1
+ class ImproveMenusStructure < ActiveRecord::Migration
2
+ def change
3
+ CamaleonCms::NavMenuItem.all.each do |menu|
4
+ menu.update_columns({description: menu.get_option('object_id'), slug: menu.get_option('type')})
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ class AddGroupToCustomFieldValues < ActiveRecord::Migration
2
+ def change
3
+ add_column "#{PluginRoutes.static_system_info["db_prefix"]}custom_fields_relationships", :group_number, :integer, default: 0
4
+ end
5
+ end
@@ -12,6 +12,7 @@ require 'breadcrumbs_on_rails'
12
12
  require 'aws-sdk'
13
13
  require 'font-awesome-rails'
14
14
  require 'tinymce-rails'
15
+ require 'cama_contact_form'
15
16
 
16
17
  $camaleon_engine_dir = File.expand_path("../../../", __FILE__)
17
18
  require File.join($camaleon_engine_dir, "lib", "plugin_routes").to_s
@@ -21,9 +22,9 @@ module CamaleonCms
21
22
  config.before_initialize do |app|
22
23
  if app.respond_to?(:console)
23
24
  app.console do
24
- puts "******** Camaleon CMS: To use custom models and helpers of installed plugins, write this: ********"
25
- puts "- include CamaleonCms::SiteHelper"
26
- puts "- site_console_switch(CamaleonCms::Site.first.decorate)"
25
+ # puts "******** Camaleon CMS: ********"
26
+ # puts "- include CamaleonCms::SiteHelper"
27
+ # puts "- $current_site = CamaleonCms::Site.first.decorate"
27
28
  end
28
29
  end
29
30
  end
@@ -1,3 +1,3 @@
1
1
  module CamaleonCms
2
- VERSION = '2.1.2.1'
2
+ VERSION = '2.2.0'
3
3
  end
data/lib/ext/string.rb CHANGED
@@ -26,6 +26,14 @@ class String
26
26
  self == 'false' || self == 'true'
27
27
  end
28
28
 
29
+ # check if current string is true or false
30
+ # cases for true: '1' | 'true'
31
+ # cases for false: '0' | 'false' | ''
32
+ # return boolean
33
+ def cama_true?
34
+ self == 'true' || self == '1'
35
+ end
36
+
29
37
  def to_var
30
38
  if is_float?
31
39
  self.to_f
@@ -120,6 +128,18 @@ class String
120
128
  "#{h}#{":#{uri.port}" unless [80, 443].include?(uri.port)}"
121
129
  end
122
130
 
131
+ # parse all codes in current text to replace with values
132
+ # sample: "Hello [c1]".cama_replace_codes({c1: 'World'}) ==> Hello World
133
+ def cama_replace_codes(values, format_code = '[')
134
+ res = self
135
+ values.each do |k, v|
136
+ v = v.join(',') if v.is_a?(Array)
137
+ res = res.gsub("[#{k}]", v) if format_code == '['
138
+ res = res.gsub("{#{k}}", v) if format_code == '{'
139
+ end
140
+ res
141
+ end
142
+
123
143
  # return cleaned model class name
124
144
  # remove decorate
125
145
  # remove Cama prefix
@@ -50,7 +50,7 @@ class String
50
50
  return translations_per_locale if !self.squish.starts_with?("<!--") or self.blank?
51
51
 
52
52
  self.split('<!--:-->').each do |t|
53
- t.match(/^<!--:([\w]{2,5})/) do |lang|
53
+ t.match(/^<!--:([\w||-]{2,5})/) do |lang|
54
54
  lt = lang[1].sub("--", "")
55
55
  translations_per_locale[lt.to_sym] = t.gsub(/<!--:#{lt}-->(.*)/, '\1')
56
56
  end
@@ -81,4 +81,4 @@ class Array
81
81
  val.to_s.translate(locale)
82
82
  end
83
83
  end
84
- end
84
+ end
@@ -71,7 +71,7 @@ module CamaleonCms
71
71
  end
72
72
 
73
73
  #Admin Panel
74
- scope :admin, path: (PluginRoutes.system_info['admin_path_name'] || 'admin') do
74
+ scope :admin, as: 'admin', path: PluginRoutes.system_info['admin_path_name'] do
75
75
  namespace 'plugins' do
76
76
  namespace '#{get_plugin_name}' do
77
77
  get 'index' => 'admin#index'
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "pluginTitle",
3
3
  "descr": "",
4
- "key": "pluginKey",
4
+ "key": "pluginKey", // must be the name of the folder of your plugin, sample: app/views/plugins/<my_plugin> ==> 'my_plugin'
5
5
  "helpers": [
6
6
  "Plugins::PluginClass::MainHelper"
7
7
  ],
@@ -11,6 +11,7 @@ module CamaleonCms
11
11
  copy_file "plugin_routes.rb", "lib/plugin_routes.rb"
12
12
  Dir.mkdir Rails.root.join("app", "apps").to_s unless Dir.exist?(Rails.root.join("app", "apps").to_s)
13
13
  directory("apps", "app/apps")
14
+ directory('../../../../app/apps/themes', 'app/apps/themes')
14
15
  append_to_file 'Gemfile' do
15
16
  "\n\n#################### Camaleon CMS include all gems for plugins and themes #################### \nrequire './lib/plugin_routes' \ninstance_eval(PluginRoutes.draw_gems)"
16
17
  end
@@ -4,10 +4,7 @@ module Themes::ThemeClass::MainHelper
4
4
  end
5
5
 
6
6
  def themeKey_settings(theme)
7
- # here your code on save settings for current site, by default params[:theme_fields] is auto saved into theme
8
- # Also, you can save your extra values added in admin/settings.html.erb
9
- # sample: theme.set_meta("my_key", params[:my_value])
10
- theme.set_field_values(params[:field_options])
7
+ # callback to save custom values of fields added in my_theme/views/admin/settings.html.erb
11
8
  end
12
9
 
13
10
  # callback called after theme installed
@@ -1,25 +1 @@
1
- <section class="section-white" id="home-view">
2
- <div class="panel panel-primary no-line contents">
3
- <div class="panel-heading"> Content </div>
4
- <div class="panel-body">
5
-
6
- <div class="row">
7
- <% current_site.the_post_types.decorate.each_with_index do |ptype, index| %>
8
- <%= raw "<div class='clearfix'></div>" if index%3 == 0 && index > 0 %>
9
- <div class="col-sm-6 col-md-4">
10
- <div class="thumbnail">
11
- <a href="<%= ptype.the_url %>">
12
- <img src="<%= ptype.the_thumb_url %>" alt="" style="height: 200px; width: 100%; display: block;">
13
- </a>
14
- <div class="caption">
15
- <h4 id="thumbnail-label"><a href="<%= ptype.the_url %>"><%= ptype.the_title %></a></h4><hr>
16
- <p><%= raw ptype.the_excerpt %></p>
17
- </div>
18
- </div>
19
- </div>
20
- <% end %>
21
- </div>
22
-
23
- </div>
24
- </div>
25
- </section>
1
+ <h1>Hello Camaleon CMS</h1>
@@ -1,23 +1,23 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <!-- META SECTION -->
5
- <title><%= current_site.the_title %></title>
6
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
8
- <meta name="viewport" content="width=device-width, initial-scale=1" />
9
- <!-- END META SECTION -->
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <!-- META SECTION -->
5
+ <title><%= current_site.the_title %></title>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
9
+ <!-- END META SECTION -->
10
10
 
11
- <%= stylesheet_link_tag theme_asset_path("css/main") %>
12
- <%= javascript_include_tag theme_asset_path("js/main.js") %>
13
- <%= raw the_head %>
14
- </head>
15
- <body>
11
+ <%= stylesheet_link_tag theme_asset_path("css/main") %>
12
+ <%= javascript_include_tag theme_asset_path("js/main.js") %>
13
+ <%= raw the_head %>
14
+ </head>
15
+ <body>
16
16
 
17
17
  <!-- container -->
18
18
  <div class="container">
19
19
  <!-- header -->
20
- <div class="navbar navbar-default">
20
+ <div class="navbar navbar-primary">
21
21
  <div class="navbar-header">
22
22
  <a id="logo" class="navbar-brand" href="<%= current_site.the_url %>"><%= image_tag current_site.the_logo, class: "img-responsive" %></a>
23
23
  <button data-target="#navbar-main" data-toggle="collapse" type="button" class="navbar-toggle">
@@ -40,7 +40,6 @@
40
40
  </ul>
41
41
  </li>
42
42
  <% else %>
43
-
44
43
  <li class="dropdown">
45
44
  <a id="login-user" class="dropdown-toggle" data-toggle="dropdown" href="#">Login / Register</a>
46
45
  <ul class="dropdown-menu">
@@ -66,5 +65,5 @@
66
65
  <!-- ./footer -->
67
66
  </div>
68
67
  <!-- ./container -->
69
- </body>
70
- </html>
68
+ </body>
69
+ </html>
data/lib/plugin_routes.rb CHANGED
@@ -65,7 +65,7 @@ class PluginRoutes
65
65
  class << self
66
66
  # return plugin information
67
67
  def plugin_info(plugin_key)
68
- self.all_plugins.each{|p| return p if p["key"] == plugin_key }
68
+ self.all_plugins.each{|p| return p if p["key"] == plugin_key || p['path'].split('/').last == plugin_key }
69
69
  nil
70
70
  end
71
71
 
@@ -168,14 +168,14 @@ class PluginRoutes
168
168
  end
169
169
 
170
170
  # all helpers of enabled plugins
171
- def self.plugin_helpers
171
+ def self.all_helpers
172
172
  r = cache_variable("plugins_helper")
173
173
  return r unless r.nil?
174
174
  res = []
175
- all_enabled_apps.each do |settings|
175
+ all_apps.each do |settings|
176
176
  res += settings["helpers"] if settings["helpers"].present?
177
177
  end
178
- cache_variable("plugins_helper", res)
178
+ cache_variable("plugins_helper", res.uniq)
179
179
  end
180
180
 
181
181
  # destroy plugin
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camaleon_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen Peredo Diaz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-23 00:00:00.000000000 Z
11
+ date: 2016-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '4.3'
167
+ - !ruby/object:Gem::Dependency
168
+ name: cama_contact_form
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 0.0.11
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: 0.0.11
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: protected_attributes
169
183
  requirement: !ruby/object:Gem::Requirement
@@ -211,32 +225,6 @@ files:
211
225
  - app/apps/plugins/attack/config/routes_admin.txt
212
226
  - app/apps/plugins/attack/models/attack.rb
213
227
  - app/apps/plugins/attack/views/admin/settings.html.erb
214
- - app/apps/plugins/contact_form/admin_forms_controller.rb
215
- - app/apps/plugins/contact_form/assets/css/admin/form-builder/formbuilder.css
216
- - app/apps/plugins/contact_form/assets/css/contact-form.css
217
- - app/apps/plugins/contact_form/assets/css/front/railsform.scss
218
- - app/apps/plugins/contact_form/assets/css/readme.txt
219
- - app/apps/plugins/contact_form/assets/js/contact_form.js
220
- - app/apps/plugins/contact_form/assets/js/form-builder/formbuilder.js
221
- - app/apps/plugins/contact_form/assets/js/form-builder/vendor.js
222
- - app/apps/plugins/contact_form/assets/js/readme.txt
223
- - app/apps/plugins/contact_form/config/config.json
224
- - app/apps/plugins/contact_form/config/custom_models.rb
225
- - app/apps/plugins/contact_form/config/locales/readme.txt
226
- - app/apps/plugins/contact_form/config/locales/translation.yml
227
- - app/apps/plugins/contact_form/config/routes_admin.txt
228
- - app/apps/plugins/contact_form/config/routes_front.txt
229
- - app/apps/plugins/contact_form/contact_form_helper.rb
230
- - app/apps/plugins/contact_form/contact_form_html_helper.rb
231
- - app/apps/plugins/contact_form/front_controller.rb
232
- - app/apps/plugins/contact_form/models/contact_form.rb
233
- - app/apps/plugins/contact_form/views/admin_forms/_form.html.erb
234
- - app/apps/plugins/contact_form/views/admin_forms/edit.html.erb
235
- - app/apps/plugins/contact_form/views/admin_forms/index.html.erb
236
- - app/apps/plugins/contact_form/views/admin_forms/responses.html.erb
237
- - app/apps/plugins/contact_form/views/contact_form/_email_content.html.erb
238
- - app/apps/plugins/contact_form/views/forms_shorcode.html.erb
239
- - app/apps/plugins/contact_form/views/front/index.html.erb
240
228
  - app/apps/plugins/front_cache/admin_controller.rb
241
229
  - app/apps/plugins/front_cache/config/config.json
242
230
  - app/apps/plugins/front_cache/config/initializer.rb
@@ -263,7 +251,6 @@ files:
263
251
  - app/apps/themes/camaleon_first/assets/js/modernizr.custom.js
264
252
  - app/apps/themes/camaleon_first/config/config.json
265
253
  - app/apps/themes/camaleon_first/main_helper.rb
266
- - app/apps/themes/camaleon_first/views/admin/settings.html.erb
267
254
  - app/apps/themes/camaleon_first/views/html_mailer/mailer.html.erb
268
255
  - app/apps/themes/camaleon_first/views/index.html.erb
269
256
  - app/apps/themes/camaleon_first/views/layouts/index.html.erb
@@ -316,13 +303,10 @@ files:
316
303
  - app/apps/themes/default/views/post_tag.html.erb
317
304
  - app/apps/themes/default/views/post_type.html.erb
318
305
  - app/apps/themes/default/views/search.html.erb
319
- - app/apps/themes/new/assets/css/bootstrap/bootstrap.min.css
320
306
  - app/apps/themes/new/assets/css/main.css
321
307
  - app/apps/themes/new/assets/css/styles.css.scss
322
308
  - app/apps/themes/new/assets/images/image.png
323
309
  - app/apps/themes/new/assets/js/main.js
324
- - app/apps/themes/new/assets/js/plugins/bootstrap/bootstrap.min.js
325
- - app/apps/themes/new/assets/js/plugins/jquery/jquery.min.js
326
310
  - app/apps/themes/new/config/config.json
327
311
  - app/apps/themes/new/custom_helper.rb
328
312
  - app/apps/themes/new/image.png
@@ -360,8 +344,8 @@ files:
360
344
  - app/assets/images/camaleon_cms/language/it.png
361
345
  - app/assets/images/camaleon_cms/language/nl.png
362
346
  - app/assets/images/camaleon_cms/language/pl.png
347
+ - app/assets/images/camaleon_cms/language/pt-BR.png
363
348
  - app/assets/images/camaleon_cms/language/pt.png
364
- - app/assets/images/camaleon_cms/language/pt_br.png
365
349
  - app/assets/images/camaleon_cms/language/ru.png
366
350
  - app/assets/images/camaleon_cms/language/zh.png
367
351
  - app/assets/images/camaleon_cms/loader.gif
@@ -395,7 +379,7 @@ files:
395
379
  - app/assets/javascripts/camaleon_cms/admin/jquery_validate/es.js
396
380
  - app/assets/javascripts/camaleon_cms/admin/jquery_validate/it.js
397
381
  - app/assets/javascripts/camaleon_cms/admin/jquery_validate/nl.js
398
- - app/assets/javascripts/camaleon_cms/admin/jquery_validate/pt_br.js
382
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/pt-BR.js
399
383
  - app/assets/javascripts/camaleon_cms/admin/login.js.coffee
400
384
  - app/assets/javascripts/camaleon_cms/admin/login_manifest.js
401
385
  - app/assets/javascripts/camaleon_cms/admin/lte/app.js
@@ -409,8 +393,8 @@ files:
409
393
  - app/assets/javascripts/camaleon_cms/admin/momentjs/ja.js
410
394
  - app/assets/javascripts/camaleon_cms/admin/momentjs/nl.js
411
395
  - app/assets/javascripts/camaleon_cms/admin/momentjs/pl.js
396
+ - app/assets/javascripts/camaleon_cms/admin/momentjs/pt-BR.js
412
397
  - app/assets/javascripts/camaleon_cms/admin/momentjs/pt.js
413
- - app/assets/javascripts/camaleon_cms/admin/momentjs/pt_br.js
414
398
  - app/assets/javascripts/camaleon_cms/admin/momentjs/ru.js
415
399
  - app/assets/javascripts/camaleon_cms/admin/momentjs/zh.js
416
400
  - app/assets/javascripts/camaleon_cms/admin/nav_menu.js.coffee
@@ -420,7 +404,7 @@ files:
420
404
  - app/assets/javascripts/camaleon_cms/admin/tinymce/langs/es.js
421
405
  - app/assets/javascripts/camaleon_cms/admin/tinymce/langs/it.js
422
406
  - app/assets/javascripts/camaleon_cms/admin/tinymce/langs/nl.js
423
- - app/assets/javascripts/camaleon_cms/admin/tinymce/langs/pt_br.js
407
+ - app/assets/javascripts/camaleon_cms/admin/tinymce/langs/pt-BR.js
424
408
  - app/assets/javascripts/camaleon_cms/admin/tinymce/langs/readme.md
425
409
  - app/assets/javascripts/camaleon_cms/admin/tinymce/plugins/filemanager/plugin.min.js
426
410
  - app/assets/javascripts/camaleon_cms/admin/uploader/_jquery.form.js
@@ -656,6 +640,7 @@ files:
656
640
  - app/views/camaleon_cms/admin/settings/custom_fields/fields/_numeric.html.erb
657
641
  - app/views/camaleon_cms/admin/settings/custom_fields/fields/_phone.html.erb
658
642
  - app/views/camaleon_cms/admin/settings/custom_fields/fields/_posts.html.erb
643
+ - app/views/camaleon_cms/admin/settings/custom_fields/fields/_private_file.html.erb
659
644
  - app/views/camaleon_cms/admin/settings/custom_fields/fields/_radio.html.erb
660
645
  - app/views/camaleon_cms/admin/settings/custom_fields/fields/_select.html.erb
661
646
  - app/views/camaleon_cms/admin/settings/custom_fields/fields/_select_eval.html.erb
@@ -674,6 +659,7 @@ files:
674
659
  - app/views/camaleon_cms/admin/settings/site.html.erb
675
660
  - app/views/camaleon_cms/admin/settings/sites/form.html.erb
676
661
  - app/views/camaleon_cms/admin/settings/sites/index.html.erb
662
+ - app/views/camaleon_cms/admin/settings/theme.html.erb
677
663
  - app/views/camaleon_cms/admin/user_roles/form.html.erb
678
664
  - app/views/camaleon_cms/admin/user_roles/index.html.erb
679
665
  - app/views/camaleon_cms/admin/users/form.html.erb
@@ -761,7 +747,7 @@ files:
761
747
  - config/locales/camaleon_cms/admin/it.yml
762
748
  - config/locales/camaleon_cms/admin/js.yml
763
749
  - config/locales/camaleon_cms/admin/nl.yml
764
- - config/locales/camaleon_cms/admin/pt_br.yml
750
+ - config/locales/camaleon_cms/admin/pt-BR.yml
765
751
  - config/locales/camaleon_cms/admin/ru.yml
766
752
  - config/locales/camaleon_cms/common.yml
767
753
  - config/locales/camaleon_cms/languages.yml
@@ -784,6 +770,8 @@ files:
784
770
  - db/migrate/20151212095328_add_confirm_token_to_users.rb
785
771
  - db/migrate/20160504155652_add_feature_to_posts.rb
786
772
  - db/migrate/20160504155653_move_first_name_of_users.rb
773
+ - db/migrate/20160606135421_improve_menus_structure.rb
774
+ - db/migrate/20160609121449_add_group_to_custom_field_values.rb
787
775
  - lib/camaleon_cms.rb
788
776
  - lib/camaleon_cms/engine.rb
789
777
  - lib/camaleon_cms/version.rb
@@ -815,16 +803,6 @@ files:
815
803
  - lib/generators/camaleon_cms/gem_plugin_template/app/views/plugins/my_plugin/layouts/readme.txt
816
804
  - lib/generators/camaleon_cms/gem_plugin_template/config/camaleon_plugin.json
817
805
  - lib/generators/camaleon_cms/gem_plugin_template/config/initializers/custom_models.rb
818
- - lib/generators/camaleon_cms/gem_theme_generator.rb
819
- - lib/generators/camaleon_cms/gem_theme_template/app/assets/images/themes/my_plugin/image.png
820
- - lib/generators/camaleon_cms/gem_theme_template/app/assets/javascripts/themes/my_plugin/main.js
821
- - lib/generators/camaleon_cms/gem_theme_template/app/assets/stylesheets/themes/my_plugin/main.css
822
- - lib/generators/camaleon_cms/gem_theme_template/app/helpers/themes/my_plugin/main_helper.rb
823
- - lib/generators/camaleon_cms/gem_theme_template/app/views/themes/my_plugin/admin/settings.html.erb
824
- - lib/generators/camaleon_cms/gem_theme_template/app/views/themes/my_plugin/index.html.erb
825
- - lib/generators/camaleon_cms/gem_theme_template/app/views/themes/my_plugin/layouts/index.html.erb
826
- - lib/generators/camaleon_cms/gem_theme_template/app/views/themes/my_plugin/partials/readme.txt
827
- - lib/generators/camaleon_cms/gem_theme_template/config/camaleon_theme.json
828
806
  - lib/generators/camaleon_cms/install_generator.rb
829
807
  - lib/generators/camaleon_cms/install_template/apps/plugins/readme.txt
830
808
  - lib/generators/camaleon_cms/install_template/apps/themes/readme.txt
@@ -871,4 +849,3 @@ signing_key:
871
849
  specification_version: 4
872
850
  summary: Camaleon is a cms for Ruby on Rails 4 as an alternative to wordpress.
873
851
  test_files: []
874
- has_rdoc: