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.
- checksums.yaml +4 -4
- data/README.md +7 -4
- data/app/apps/plugins/attack/attack_helper.rb +3 -0
- data/app/apps/plugins/attack/config/custom_models.rb +4 -2
- data/app/apps/plugins/attack/config/locales/translation.yml +19 -0
- data/app/apps/plugins/attack/models/attack.rb +1 -1
- data/app/apps/plugins/front_cache/config/initializer.rb +4 -2
- data/app/apps/plugins/front_cache/config/locales/translation.yml +19 -0
- data/app/apps/themes/camaleon_first/main_helper.rb +1 -3
- data/app/apps/themes/default/views/admin/settings.html.erb +0 -1
- data/app/apps/themes/default/views/layouts/index.html.erb +5 -5
- data/app/apps/themes/new/assets/css/main.css +1 -1
- data/app/apps/themes/new/assets/js/main.js +1 -1
- data/app/apps/themes/new/views/admin/settings.html.erb +1 -1
- data/app/assets/images/camaleon_cms/language/{pt_br.png → pt-BR.png} +0 -0
- data/app/assets/javascripts/camaleon_cms/admin/_custom_fields.js +105 -51
- data/app/assets/javascripts/camaleon_cms/admin/_libraries.js +4 -2
- data/app/assets/javascripts/camaleon_cms/admin/_translator.js +2 -2
- data/app/assets/javascripts/camaleon_cms/admin/custom_fields_form.js +9 -7
- data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/{pt_br.js → pt-BR.js} +0 -0
- data/app/assets/javascripts/camaleon_cms/admin/momentjs/{pt_br.js → pt-BR.js} +1 -1
- data/app/assets/javascripts/camaleon_cms/admin/nav_menu.js.coffee +15 -1
- data/app/assets/javascripts/camaleon_cms/admin/tinymce/langs/{pt_br.js → pt-BR.js} +1 -1
- data/app/assets/javascripts/camaleon_cms/admin/uploader/_media_manager.js.coffee +24 -12
- data/app/assets/stylesheets/camaleon_cms/admin/_custom_admin.css.scss +9 -0
- data/app/assets/stylesheets/camaleon_cms/admin/lte/_admin.css.scss +1 -1
- data/app/controllers/camaleon_cms/admin/appearances/nav_menus_controller.rb +13 -6
- data/app/controllers/camaleon_cms/admin/appearances/themes_controller.rb +1 -1
- data/app/controllers/camaleon_cms/admin/appearances/widgets/assign_controller.rb +1 -1
- data/app/controllers/camaleon_cms/admin/appearances/widgets/main_controller.rb +1 -1
- data/app/controllers/camaleon_cms/admin/appearances/widgets/sidebar_controller.rb +1 -1
- data/app/controllers/camaleon_cms/admin/comments_controller.rb +1 -1
- data/app/controllers/camaleon_cms/admin/media_controller.rb +15 -5
- data/app/controllers/camaleon_cms/admin/plugins_controller.rb +1 -1
- data/app/controllers/camaleon_cms/admin/settings/custom_fields_controller.rb +14 -8
- data/app/controllers/camaleon_cms/admin/settings_controller.rb +22 -7
- data/app/controllers/camaleon_cms/admin/user_roles_controller.rb +1 -1
- data/app/controllers/camaleon_cms/admin/users_controller.rb +1 -1
- data/app/controllers/camaleon_cms/apps/plugins_admin_controller.rb +4 -1
- data/app/controllers/camaleon_cms/apps/plugins_front_controller.rb +5 -10
- data/app/controllers/camaleon_cms/apps/themes_front_controller.rb +1 -4
- data/app/controllers/camaleon_cms/camaleon_controller.rb +4 -13
- data/app/controllers/camaleon_cms/frontend_controller.rb +15 -9
- data/app/controllers/concerns/camaleon_cms/frontend_concern.rb +17 -8
- data/app/decorators/camaleon_cms/application_decorator.rb +3 -3
- data/app/decorators/camaleon_cms/custom_fields_concern.rb +21 -6
- data/app/decorators/camaleon_cms/post_comment_decorator.rb +21 -0
- data/app/decorators/camaleon_cms/site_decorator.rb +5 -5
- data/app/decorators/camaleon_cms/theme_decorator.rb +10 -0
- data/app/decorators/camaleon_cms/user_decorator.rb +2 -2
- data/app/helpers/camaleon_cms/admin/custom_fields_helper.rb +24 -2
- data/app/helpers/camaleon_cms/admin/menus_helper.rb +13 -12
- data/app/helpers/camaleon_cms/frontend/application_helper.rb +1 -1
- data/app/helpers/camaleon_cms/frontend/nav_menu_helper.rb +7 -6
- data/app/helpers/camaleon_cms/plugins_helper.rb +20 -18
- data/app/helpers/camaleon_cms/site_helper.rb +1 -20
- data/app/helpers/camaleon_cms/theme_helper.rb +1 -1
- data/app/helpers/camaleon_cms/uploader_helper.rb +25 -20
- data/app/helpers/camaleon_cms/user_roles_helper.rb +6 -1
- data/app/mailers/camaleon_cms/html_mailer.rb +2 -1
- data/app/models/camaleon_cms/ability.rb +3 -26
- data/app/models/camaleon_cms/custom_field.rb +2 -1
- data/app/models/camaleon_cms/custom_field_group.rb +23 -22
- data/app/models/camaleon_cms/custom_fields_relationship.rb +1 -1
- data/app/models/camaleon_cms/nav_menu.rb +1 -1
- data/app/models/camaleon_cms/nav_menu_item.rb +12 -19
- data/app/models/camaleon_cms/post.rb +1 -1
- data/app/models/camaleon_cms/post_comment.rb +3 -1
- data/app/models/camaleon_cms/post_default.rb +1 -1
- data/app/models/camaleon_cms/post_type.rb +5 -4
- data/app/models/camaleon_cms/site.rb +12 -0
- data/app/models/camaleon_cms/term_taxonomy.rb +1 -1
- data/app/models/camaleon_cms/user_role.rb +5 -1
- data/app/models/concerns/camaleon_cms/custom_fields_read.rb +99 -49
- data/app/uploaders/camaleon_cms_aws_uploader.rb +1 -1
- data/app/uploaders/camaleon_cms_local_uploader.rb +19 -3
- data/app/uploaders/camaleon_cms_uploader.rb +13 -6
- data/app/views/camaleon_cms/admin/appearances/nav_menus/_custom_menus.html.erb +9 -2
- data/app/views/camaleon_cms/admin/appearances/nav_menus/_form.html.erb +1 -1
- data/app/views/camaleon_cms/admin/appearances/nav_menus/_menu_items.html.erb +2 -2
- data/app/views/camaleon_cms/admin/appearances/themes/index.html.erb +1 -3
- data/app/views/camaleon_cms/admin/media/_render_file_item.html.erb +1 -0
- data/app/views/camaleon_cms/admin/media/index.html.erb +3 -3
- data/app/views/camaleon_cms/admin/posts/_sidebar.html.erb +1 -1
- data/app/views/camaleon_cms/admin/posts/form.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/_configuration_settings.html.erb +4 -0
- data/app/views/camaleon_cms/admin/settings/custom_fields/_get_items.html.erb +6 -6
- data/app/views/camaleon_cms/admin/settings/custom_fields/_meta_data.html.erb +0 -9
- data/app/views/camaleon_cms/admin/settings/custom_fields/_render.html.erb +39 -55
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_audio.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_checkbox.html.erb +2 -2
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_checkboxes.html.erb +3 -3
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_colorpicker.html.erb +3 -3
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_date.html.erb +3 -3
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_editor.html.erb +2 -2
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_email.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_field_attrs.html.erb +3 -3
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_file.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_image.html.erb +2 -2
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_numeric.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_phone.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_posts.html.erb +3 -3
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_private_file.html.erb +4 -0
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_radio.html.erb +3 -3
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_select.html.erb +3 -3
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_select_eval.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_text_area.html.erb +2 -2
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_text_box.html.erb +2 -2
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_url.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_users.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_video.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/form.html.erb +8 -0
- data/app/views/camaleon_cms/admin/settings/site.html.erb +1 -20
- data/app/views/camaleon_cms/admin/settings/theme.html.erb +20 -0
- data/app/views/camaleon_cms/admin/user_roles/form.html.erb +2 -2
- data/app/views/camaleon_cms/default_theme/admin/settings.html.erb +0 -1
- data/app/views/camaleon_cms/default_theme/partials/_comments.html.erb +0 -2
- data/app/views/camaleon_cms/default_theme/partials/_search_form.html.erb +1 -1
- data/app/views/camaleon_cms/default_theme/partials/_sidebar.html.erb +3 -3
- data/app/views/layouts/camaleon_cms/admin/_footer.html.erb +1 -1
- data/config/initializers/action_view.rb +12 -7
- data/config/initializers/custom_initializers.rb +6 -12
- data/config/locales/camaleon_cms/admin/en.yml +1 -0
- data/config/locales/camaleon_cms/admin/es.yml +4 -0
- data/config/locales/camaleon_cms/admin/it.yml +1 -24
- data/config/locales/camaleon_cms/admin/js.yml +41 -0
- data/config/locales/camaleon_cms/admin/{pt_br.yml → pt-BR.yml} +48 -18
- data/config/locales/camaleon_cms/common.yml +66 -0
- data/config/locales/camaleon_cms/languages.yml +13 -0
- data/config/locales/camaleon_cms/routes.yml +2 -2
- data/config/routes/admin.rb +3 -0
- data/config/system.json +3 -3
- data/db/migrate/20160606135421_improve_menus_structure.rb +7 -0
- data/db/migrate/20160609121449_add_group_to_custom_field_values.rb +5 -0
- data/lib/camaleon_cms/engine.rb +4 -3
- data/lib/camaleon_cms/version.rb +1 -1
- data/lib/ext/string.rb +20 -0
- data/lib/ext/translator.rb +2 -2
- data/lib/generators/camaleon_cms/gem_plugin_generator.rb +1 -1
- data/lib/generators/camaleon_cms/gem_plugin_template/config/camaleon_plugin.json +1 -1
- data/lib/generators/camaleon_cms/install_generator.rb +1 -0
- data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/main_helper.rb +1 -4
- data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/views/index.html.erb +1 -25
- data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/views/layouts/index.html.erb +17 -18
- data/lib/plugin_routes.rb +4 -4
- metadata +25 -48
- data/app/apps/plugins/contact_form/admin_forms_controller.rb +0 -85
- data/app/apps/plugins/contact_form/assets/css/admin/form-builder/formbuilder.css +0 -70
- data/app/apps/plugins/contact_form/assets/css/contact-form.css +0 -8
- data/app/apps/plugins/contact_form/assets/css/front/railsform.scss +0 -94
- data/app/apps/plugins/contact_form/assets/css/readme.txt +0 -1
- data/app/apps/plugins/contact_form/assets/js/contact_form.js +0 -2
- data/app/apps/plugins/contact_form/assets/js/form-builder/formbuilder.js +0 -1271
- data/app/apps/plugins/contact_form/assets/js/form-builder/vendor.js +0 -3072
- data/app/apps/plugins/contact_form/assets/js/readme.txt +0 -1
- data/app/apps/plugins/contact_form/config/config.json +0 -35
- data/app/apps/plugins/contact_form/config/custom_models.rb +0 -3
- data/app/apps/plugins/contact_form/config/locales/readme.txt +0 -1
- data/app/apps/plugins/contact_form/config/locales/translation.yml +0 -315
- data/app/apps/plugins/contact_form/config/routes_admin.txt +0 -4
- data/app/apps/plugins/contact_form/config/routes_front.txt +0 -2
- data/app/apps/plugins/contact_form/contact_form_helper.rb +0 -154
- data/app/apps/plugins/contact_form/contact_form_html_helper.rb +0 -140
- data/app/apps/plugins/contact_form/front_controller.rb +0 -50
- data/app/apps/plugins/contact_form/models/contact_form.rb +0 -26
- data/app/apps/plugins/contact_form/views/admin_forms/_form.html.erb +0 -33
- data/app/apps/plugins/contact_form/views/admin_forms/edit.html.erb +0 -338
- data/app/apps/plugins/contact_form/views/admin_forms/index.html.erb +0 -65
- data/app/apps/plugins/contact_form/views/admin_forms/responses.html.erb +0 -60
- data/app/apps/plugins/contact_form/views/contact_form/_email_content.html.erb +0 -26
- data/app/apps/plugins/contact_form/views/forms_shorcode.html.erb +0 -28
- data/app/apps/plugins/contact_form/views/front/index.html.erb +0 -3
- data/app/apps/themes/camaleon_first/views/admin/settings.html.erb +0 -4
- data/app/apps/themes/new/assets/css/bootstrap/bootstrap.min.css +0 -6735
- data/app/apps/themes/new/assets/js/plugins/bootstrap/bootstrap.min.js +0 -6
- data/app/apps/themes/new/assets/js/plugins/jquery/jquery.min.js +0 -4
- data/lib/generators/camaleon_cms/gem_theme_generator.rb +0 -97
- data/lib/generators/camaleon_cms/gem_theme_template/app/assets/images/themes/my_plugin/image.png +0 -0
- data/lib/generators/camaleon_cms/gem_theme_template/app/assets/javascripts/themes/my_plugin/main.js +0 -14
- data/lib/generators/camaleon_cms/gem_theme_template/app/assets/stylesheets/themes/my_plugin/main.css +0 -13
- data/lib/generators/camaleon_cms/gem_theme_template/app/helpers/themes/my_plugin/main_helper.rb +0 -26
- data/lib/generators/camaleon_cms/gem_theme_template/app/views/themes/my_plugin/admin/settings.html.erb +0 -4
- data/lib/generators/camaleon_cms/gem_theme_template/app/views/themes/my_plugin/index.html.erb +0 -25
- data/lib/generators/camaleon_cms/gem_theme_template/app/views/themes/my_plugin/layouts/index.html.erb +0 -70
- data/lib/generators/camaleon_cms/gem_theme_template/app/views/themes/my_plugin/partials/readme.txt +0 -1
- 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)"
|
data/config/routes/admin.rb
CHANGED
@@ -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", "
|
6
|
-
"available_languages": ["es", "en", "fr", "zh", "de", "it", "
|
7
|
-
"admin_available_languages": ["en", "es", "it", "
|
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
|
data/lib/camaleon_cms/engine.rb
CHANGED
@@ -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:
|
25
|
-
puts "- include CamaleonCms::SiteHelper"
|
26
|
-
puts "-
|
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
|
data/lib/camaleon_cms/version.rb
CHANGED
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
|
data/lib/ext/translator.rb
CHANGED
@@ -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:
|
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'
|
@@ -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
|
-
#
|
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
|
data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/views/index.html.erb
CHANGED
@@ -1,25 +1 @@
|
|
1
|
-
<
|
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
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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-
|
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
|
-
|
70
|
-
|
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.
|
171
|
+
def self.all_helpers
|
172
172
|
r = cache_variable("plugins_helper")
|
173
173
|
return r unless r.nil?
|
174
174
|
res = []
|
175
|
-
|
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.
|
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-
|
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/
|
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/
|
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/
|
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:
|