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
@@ -1 +0,0 @@
1
- Here all your js labraries
@@ -1,35 +0,0 @@
1
- {
2
- "title": "Contact Form",
3
- "descr": "Please check documentation <a href='http://camaleon.tuzitio.com/store/plugins/4'>here.</a>",
4
- "version": "0.1",
5
- "key": "contact_form",
6
- "helpers": [
7
- "Plugins::ContactForm::ContactFormHelper",
8
- "Plugins::ContactForm::ContactFormHtmlHelper"
9
- ],
10
- "options": [
11
-
12
- ],
13
- "hooks": {
14
- "admin_before_load": [
15
- "contact_form_admin_before_load"
16
- ],
17
- "on_destroy": [
18
- "contact_form_on_destroy"
19
- ],
20
- "on_active": [
21
- "contact_form_on_active"
22
- ],
23
- "on_inactive": [
24
- "contact_form_on_inactive"
25
- ],
26
- "app_before_load":
27
- ["contact_form_app_before_load"],
28
- "front_before_load":
29
- ["contact_form_front_before_load"],
30
- "on_export": ["contact_form_on_export"],
31
- "on_import": ["contact_form_on_import"]
32
- //here you can add all your hooks (read documentation)
33
- },
34
- "enabled": true
35
- }
@@ -1,3 +0,0 @@
1
- CamaleonCms::Site.class_eval do
2
- has_many :contact_forms, :class_name => "Plugins::ContactForm::Models::ContactForm", foreign_key: :site_id, dependent: :destroy
3
- end
@@ -1 +0,0 @@
1
- Here all your plugin locales
@@ -1,315 +0,0 @@
1
- en:
2
- recaptcha:
3
- errors:
4
- incorrect-captcha-sol: 'Oh! Its error with reCAPTCHA!'
5
- plugin:
6
- contact_form:
7
- actions: 'Actions'
8
- add_form: 'Add Form'
9
- add_field: 'Add Field'
10
- add_new_field: 'Add New Field'
11
- add_option: 'Add Option'
12
- body: 'Body'
13
- body_value: 'This e-mail was send from contact form.'
14
- button:
15
- back: 'Back'
16
- submit: 'Submit'
17
- captcha: 'Captcha'
18
- created_at: 'Created_at'
19
- custom_class: 'Custom Class'
20
- copy_shortcode_post: 'Copy shortcode to post:'
21
- count: 'Count'
22
- contact_form: 'Contact Form'
23
- default: 'Default'
24
- description: 'Description'
25
- delete: 'Delete'
26
- duplicate_field: 'Duplicate Field'
27
- edit: 'Edit'
28
- edit_field: 'Edit Field'
29
- error_captcha: 'Oh! Its error with CAPTCHA!'
30
- form_settings_email: 'Form Settings Email'
31
- form_settings_messages: 'Form Settings Messages'
32
- include_lank: 'Include blank'
33
- include_other: 'Include other'
34
- message:
35
- save: 'The contact form has been created.'
36
- delete: 'The contact form has been deleted.'
37
- msg_data_found_list: 'No data found in the list'
38
- msg_delete: 'Are you sure?'
39
- lbl_message_has_been_success: 'Your message has been sent successfully.'
40
- msg_message_has_been_sent_success_tank_you: 'Your message has been sent successfully. Thank you very much.'
41
- lbl_failed_sending_message: 'Failed sending the message.'
42
- msg_failed_sending_message_please_contact_admin: 'Failed sending the message. Please try again later or contact administrator by other means.'
43
- lbl_there_was_validation_error: 'There was a validation error.'
44
- msg_there_was_validation_error_please_confirm_submit_form: 'There was a validation error. Please confirm the fields and submit the form again.'
45
- lbl_shipment_considered_spam: 'Shipment is considered spam.'
46
- msg_falied_sending_message_please_contact_admin: 'Failed sending the message. Please try again later or contact administrator by other means.'
47
- lbl_you_must_accept_all_terms: 'You must accept all terms.'
48
- msg_please_accept_terms_conditions_contiue: 'Please accept the terms and conditions to continue.'
49
- lbl_you_must_complete_all_fields: 'You must complete all fields.'
50
- msg_please_fill_the_required_field: 'Please fill in the required field.'
51
- lbl_there_field_user_input_longer_maximum_allowed_length: 'There is a field that the user input is longer than the maximum allowed length.'
52
- mgs_this_input_too_long: 'This input is too long.'
53
- lbl_there_field_user_input_shorter_minimum_allowed_length: 'There is a field that the user input is shorter than the minimum allowed length.'
54
- mgs_this_input_too_short: 'This input is too short.'
55
- lbl_the_code_entered_did_not_match_the_captcha: 'The code you entered did not match the CAPTCHA.'
56
- msg_the_entered_code_incorrect: 'The entered code is incorrect.'
57
- lbl_the_entered_number_format_invalid: 'The entered number format is invalid.'
58
- msg_the_numeric_format_seems_invalid: 'The numeric format seems invalid.'
59
- lbl_the_number_entered_less_allowable_limit: 'The number entered is less than the allowable limit.'
60
- msg_number_too_samll: 'Number too small.'
61
- lbl_the_number_entered_greater_than_allowable_limit: 'The number entered is greater than the allowable limit.'
62
- msg_number_too_large: 'Number too large.'
63
- lbl_the_email_is_invalid: 'The e-mail entered is invalid.'
64
- msg_the_email_address_appears_invalid: 'The e-mail address appears invalid.'
65
- lbl_url_invalid: 'The URL entered is invalid.'
66
- msg_url_appearse_invalid: 'The URL appears invalid.'
67
- lbl_phone_invalid: 'The phone number entered is invalid.'
68
- msg_phone_appearse_invalid: 'The phone number appears invalid.'
69
- lbl_have_not_correct_answer: 'Have not entered the correct answer to the riddle.'
70
- msg_answer_not_correct: 'The answer is not correct.'
71
- lbl_date_format_invalid: 'The date format entered is invalid.'
72
- msg_date_appears_invalid: 'The date format appears invalid.'
73
- lbl_date_is_earlier_allowable_limit: 'The entered date is earlier than the allowable limit.'
74
- msg_date_early: 'Date too early.'
75
- lbl_date_later_than_allowable_limit: 'The entered date is later than the allowable limit.'
76
- msg_date_too_late: 'Date too late.'
77
- lbl_file_upload_failed_some_reason: 'The file upload failed for some reason.'
78
- msg_failed_upload_file: 'Failed to upload the file.'
79
- lbl_upload_file_not_valid_format: 'The uploaded file is not in a valid format.'
80
- msg_invalid_file_format: 'Invalid file format.'
81
- lbl_uploaded_file_too_large: 'The uploaded file is too large'
82
- msg_file_too_large: 'This file is too large.'
83
- lbl_file_upload_failed_rails_error: 'The file upload failed for Rails error.'
84
- msg_failed_upload_file_was_error: 'Failed to upload the file. There was an error.'
85
- msg_add_longer_description_field: 'Add a longer description to this field'
86
- label: 'Label'
87
- label_required: 'Required Label'
88
- placeholder_required: 'Required Placeholder'
89
- list: 'List'
90
- list_responses: 'List Responses'
91
- name: 'Name'
92
- name_button: 'Name Button'
93
- options: 'Options'
94
- remove_field: 'Remove Field'
95
- remove_option: 'Remove Option'
96
- required: 'Required'
97
- slug: 'Slug'
98
- shortcode: 'Shortcode'
99
- subject: 'Subject'
100
- title_plugin: 'Contact Form'
101
- title_panel:
102
- form_details: 'Form Details'
103
- to: 'To'
104
- untitled: 'Untitled'
105
- upload_file: 'Upload File'
106
- es:
107
- recaptcha:
108
- errors:
109
- incorrect-captcha-sol: 'Oh! Es error con el CAPTCHA!'
110
- plugin:
111
- contact_form:
112
- actions: 'Acciones'
113
- add_form: 'Añadir Formulario'
114
- add_field: 'Añadir Campo'
115
- add_new_field: 'Añadir Nuevo Campo'
116
- add_option: 'Añadir Opcion'
117
- body: 'Cuerpo'
118
- body_value: 'Esta dirección de correo electrónico enviado a través del formulario de contacto de Sitio.'
119
- button:
120
- back: 'Atras'
121
- submit: 'Enviar'
122
- captcha: 'Captcha'
123
- created_at: 'Fecha de Creación'
124
- custom_class: 'Clase Personalizada'
125
- copy_shortcode_post: 'Copiar código corto a articulo:'
126
- count: 'Cantidad'
127
- contact_form: 'Formulario de Contacto '
128
- default: 'defecto'
129
- description: 'Descripción'
130
- delete: 'Eliminar'
131
- duplicate_field: 'Duplicar Campo'
132
- edit: 'Editar'
133
- edit_field: 'Editar Campo'
134
- error_captcha: 'Oh! Es error con el CAPTCHA!'
135
- form_settings_email: 'Ajustes Email del Formulario'
136
- form_settings_messages: 'Ajustes Mensajes del Formulario '
137
- include_lank: 'Incluir blanco'
138
- include_other: 'Incluir otro'
139
- message:
140
- save: 'El formulario de contacto ha sido creado.'
141
- delete: 'El formulario de contacto ha sido eliminado.'
142
- msg_data_found_list: 'No se encuentran en la lista de datos'
143
- msg_delete: 'Esta seguro?'
144
- lbl_message_has_been_success: 'Tu mensaje se ha sido enviado exitosamente.'
145
- msg_message_has_been_sent_success_tank_you: 'Tu mensaje se ha sido enviado exitosamente. Muchas gracias.'
146
- lbl_failed_sending_message: 'No se pudo enviar el mensaje.'
147
- msg_failed_sending_message_please_contact_admin: 'No se pudo enviar el mensaje. Inténtelo más tarde o póngase en contacto con el administrador por otros medios.'
148
- lbl_there_was_validation_error: 'Hubo un error de validación.'
149
- msg_there_was_validation_error_please_confirm_submit_form: 'Hubo un error de validación. Por favor, confirme los campos y enviar el formulario de nuevo.'
150
- lbl_shipment_considered_spam: 'El envío se considera spam.'
151
- msg_falied_sending_message_please_contact_admin: 'No se pudo enviar el mensaje. Inténtelo más tarde o póngase en contacto con el administrador por otros medios.'
152
- lbl_you_must_accept_all_terms: 'Debes aceptar todos los términos.'
153
- msg_please_accept_terms_conditions_contiue: 'Por favor, acepte los términos y condiciones para continuar.'
154
- lbl_you_must_complete_all_fields: 'Debes completar todos los campos.'
155
- msg_please_fill_the_required_field: 'Por favor complete el campo requerido.'
156
- lbl_there_field_user_input_longer_maximum_allowed_length: 'Hay un campo que la entrada del usuario es más largo que la longitud máxima permitida.'
157
- mgs_this_input_too_long: 'Esta entrada es demasiado larga.'
158
- lbl_there_field_user_input_shorter_minimum_allowed_length: 'Hay un campo que la entrada del usuario es más corto que el mínimo permitido longitud.'
159
- mgs_this_input_too_short: 'Esta entrada es demasiado corto.'
160
- lbl_the_code_entered_did_not_match_the_captcha: 'El código que ha introducido no coincide con el CAPTCHA.'
161
- msg_the_entered_code_incorrect: 'El código introducido es incorrecto.'
162
- lbl_the_entered_number_format_invalid: 'El formato del número introducido no es válido.'
163
- msg_the_numeric_format_seems_invalid: 'El formato numérico parece válido.'
164
- lbl_the_number_entered_less_allowable_limit: 'El número introducido es menor que el límite permitido.'
165
- msg_number_too_samll: 'Número demasiado pequeño.'
166
- lbl_the_number_entered_greater_than_allowable_limit: 'El número introducido es mayor que el límite permitido.'
167
- msg_number_too_large: 'Número demasiado grande.'
168
- lbl_the_email_is_invalid: 'El e-mail introducido no es válido.'
169
- msg_the_email_address_appears_invalid: 'La dirección de correo electrónico no es válido.'
170
- lbl_url_invalid: 'La URL introducida no es válida.'
171
- msg_url_appearse_invalid: 'La URL no es válido.'
172
- lbl_phone_invalid: 'El número de teléfono introducido no es válido.'
173
- msg_phone_appearse_invalid: 'El número de teléfono no es válido.'
174
- lbl_have_not_correct_answer: 'No han entrado en la respuesta correcta al enigma.'
175
- msg_answer_not_correct: 'La respuesta no es correcta.'
176
- lbl_date_format_invalid: 'El formato de la fecha introducida no es válida.'
177
- msg_date_appears_invalid: 'El formato de fecha no es válido.'
178
- lbl_date_is_earlier_allowable_limit: 'La fecha introducida es anterior al límite permitido.'
179
- msg_date_early: 'Fecha demasiado pronto.'
180
- lbl_date_later_than_allowable_limit: 'La fecha introducida es posterior al límite permitido.'
181
- msg_date_too_late: 'Fecha demasiado tarde.'
182
- lbl_file_upload_failed_some_reason: 'La carga de archivos falló por alguna razón.'
183
- msg_failed_upload_file: 'Error al cargar el archivo.'
184
- lbl_upload_file_not_valid_format: 'El archivo subido no es un formato válido.'
185
- msg_invalid_file_format: 'Formato de archivo no válido.'
186
- lbl_uploaded_file_too_large: 'El archivo subido es demasiado grande.'
187
- msg_file_too_large: 'Este archivo es demasiado grande.'
188
- lbl_file_upload_failed_rails_error: 'La carga de archivos ha fallado por error Rails.'
189
- msg_failed_upload_file_was_error: 'Error al cargar el archivo. Hubo un error.'
190
- msg_add_longer_description_field: 'Agregar una descripcion en este campo'
191
- label: 'Etiqueta'
192
- label_required: 'Etiqueta Requerida'
193
- placeholder_required: 'Placeholder Requerido'
194
- list: 'Lista'
195
- list_responses: 'Lista de Respuestas'
196
- name: 'Nombre'
197
- name_button: 'Nombre de Boton'
198
- options: 'Opciones'
199
- remove_field: 'Remover Campo'
200
- remove_option: 'Remover Opcion'
201
- required: 'Requerido'
202
- slug: 'Código'
203
- shortcode: 'Código Corto'
204
- subject: 'Asunto'
205
- title_plugin: 'Formulario de Contacto'
206
- title_panel:
207
- form_details: 'Detalle Formulario'
208
- to: 'Para'
209
- untitled: 'Sin Título'
210
- upload_file: 'Subir Archivo'
211
- nl:
212
- recaptcha:
213
- errors:
214
- incorrect-captcha-sol: 'Oh! Er heeft zich een fout voorgedaan met reCAPTCHA!'
215
- plugin:
216
- contact_form:
217
- actions: 'Acties'
218
- add_form: 'Formulier aanmaken'
219
- add_field: 'Veld toevoegen'
220
- add_new_field: 'Veld toevoegen'
221
- add_option: 'Optie toevoegen'
222
- body: 'Body'
223
- body_value: 'Deze mail is verstuurd door het contactformulier.'
224
- button:
225
- back: 'Terug'
226
- submit: 'Verstuur'
227
- captcha: 'Captcha'
228
- created_at: 'Aangemaakt op'
229
- custom_class: 'Aangepaste CSS class'
230
- copy_shortcode_post: 'kopieer shortcode naar post:'
231
- count: 'Tel'
232
- contact_form: 'Contactformulieren'
233
- default: 'Standaard'
234
- description: 'Omschrijving'
235
- delete: 'Verwijder'
236
- duplicate_field: 'Dubbel Veld'
237
- edit: 'Bewerk'
238
- edit_field: 'Veld bewerken'
239
- error_captcha: 'Oh! Er heeft zich een fout voorgedaan met CAPTCHA!'
240
- form_settings_email: 'Formulier e-mail instellingen'
241
- form_settings_messages: 'Formulier berichtgeving instellingen'
242
- include_lank: 'Lege toevoegen'
243
- include_other: 'Andere toevoegen'
244
- message:
245
- save: 'Het contactformulier is gemaakt.'
246
- delete: 'Het contactformulier is verwijderd.'
247
- msg_data_found_list: 'Geen Contactformulieren gevonden.'
248
- msg_delete: 'Weet je het zeker?'
249
- lbl_message_has_been_success: 'Uw bericht is verzonden.'
250
- msg_message_has_been_sent_success_tank_you: 'Uw bericht is verzonden. Veel dank.'
251
- lbl_failed_sending_message: 'Het is niet gelkukt om het bericht te versturen '
252
- msg_failed_sending_message_please_contact_admin: 'Bericht is niet verstuurd. Probeer het later opnieuw of neem contact met de beheerder op een andere manier.'
253
- lbl_there_was_validation_error: 'There was a validation error.'
254
- msg_there_was_validation_error_please_confirm_submit_form: 'Er was een validatie fout. Kunt u bevestigen dat de velden goed zijn ingevuld? en verzend het formulier opnieuw.'
255
- lbl_shipment_considered_spam: 'Zending wordt beschouwd als spam.'
256
- msg_falied_sending_message_please_contact_admin: 'Bericht versturen mislukt. Probeer het later opnieuw of neem contact met de beheerder op een andere manier.'
257
- lbl_you_must_accept_all_terms: 'U dient alle voorwaarden te accepteren.'
258
- msg_please_accept_terms_conditions_contiue: 'Accepteer de voorwaarden om door te gaan.'
259
- lbl_you_must_complete_all_fields: 'U moet alle velden invullen.'
260
- msg_please_fill_the_required_field: 'Vul alsjeblieft het verplichte veld in'
261
- lbl_there_field_user_input_longer_maximum_allowed_length: 'Er is een veld dat de gebruikersinvoer is langer dan de maximaal toegestane lengte.'
262
- mgs_this_input_too_long: 'De invoer is te lang.'
263
- lbl_there_field_user_input_shorter_minimum_allowed_length: 'Er is een veld dat de gebruikersinvoer korter is dan de minimaal toegestane lengte.'
264
- mgs_this_input_too_short: 'De invoer is te kort.'
265
- lbl_the_code_entered_did_not_match_the_captcha: 'De code matcht niet met de CAPTCHA.'
266
- msg_the_entered_code_incorrect: 'De ingevoerde code is onjuist.'
267
- lbl_the_entered_number_format_invalid: 'Het ingevoerde nummer formaat is ongeldig.'
268
- msg_the_numeric_format_seems_invalid: 'De numerieke indeling lijkt ongeldig.'
269
- lbl_the_number_entered_less_allowable_limit: 'Het ingevoerde nummer is minder dan de toegestane limiet.'
270
- msg_number_too_samll: 'Nummer te klein.'
271
- lbl_the_number_entered_greater_than_allowable_limit: 'Het ingevoerde nummer is groter dan de toegestane limiet.'
272
- msg_number_too_large: 'Nummer te groot'
273
- lbl_the_email_is_invalid: 'Het ingevoerde e-mailadres is ongeldig.'
274
- msg_the_email_address_appears_invalid: 'Het e-mailadres is ongeldig.'
275
- lbl_url_invalid: 'De ingevoerde URL is ongeldig.'
276
- msg_url_appearse_invalid: 'De URL is ongeldig.'
277
- lbl_phone_invalid: 'Het telefoonnummer is ongeldig.'
278
- msg_phone_appearse_invalid: 'Het telefoonnummer is ongeldig.'
279
- lbl_have_not_correct_answer: 'U heeft het juiste antwoord op het raadsel niet ingevoerd.'
280
- msg_answer_not_correct: 'Het antwoord is niet correct.'
281
- lbl_date_format_invalid: 'De opgegeven datumnotatie is ongeldig.'
282
- msg_date_appears_invalid: 'De datumnotatie is ongeldig.'
283
- lbl_date_is_earlier_allowable_limit: 'De ingevoerde datum is eerder dan de toegestane limiet.'
284
- msg_date_early: 'Datom is te vroeg.'
285
- lbl_date_later_than_allowable_limit: 'De ingevoerde datum is late dan de toegestane limiet.'
286
- msg_date_too_late: 'Datum is te laat.'
287
- lbl_file_upload_failed_some_reason: 'De bestandsupload is mislukt om een onbekende reden.'
288
- msg_failed_upload_file: 'Bestandsupload mislukt'
289
- lbl_upload_file_not_valid_format: 'Het geüploade bestand is niet in een geldig formaat.'
290
- msg_invalid_file_format: 'Onjuist bestandsformaat'
291
- lbl_uploaded_file_too_large: 'Het geuploade bestand is te groot'
292
- msg_file_too_large: 'Bestand is te groot.'
293
- lbl_file_upload_failed_rails_error: 'De besandsupload is mistlukt door een Rails fout.'
294
- msg_failed_upload_file_was_error: 'FDe besandsupload is mistlukt er wast een fout.'
295
- msg_add_longer_description_field: 'Voeg een langere beschrijving voor dit veld.'
296
- label: 'Label'
297
- label_required: 'Verplicht label'
298
- placeholder_required: 'Verplichte placeholder'
299
- list: 'Overzicht'
300
- list_responses: 'Overzicht reacties'
301
- name: 'Naam'
302
- name_button: 'Knop naam'
303
- options: 'Opties'
304
- remove_field: 'Verwijder veld'
305
- remove_option: 'Verwijder optie'
306
- required: 'Verplicht'
307
- slug: 'Slug'
308
- shortcode: 'Shortcode'
309
- subject: 'Onderwerp'
310
- title_plugin: 'Contactformulier'
311
- title_panel:
312
- form_details: 'Formulier Details'
313
- to: 'Naar'
314
- untitled: 'Naamloos'
315
- upload_file: 'Bestand uploaden'
@@ -1,4 +0,0 @@
1
- get 'handbook' => "admin_forms#manual"
2
- resources :admin_forms do
3
- get 'responses'
4
- end
@@ -1,2 +0,0 @@
1
- get 'index' => "front#index"
2
- post 'save_form' => "front#save_form"
@@ -1,154 +0,0 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
- module Plugins::ContactForm::ContactFormHelper
10
- def self.included(klass)
11
- klass.helper_method :get_plugin_form rescue ""
12
- end
13
-
14
- def get_plugin_form
15
- plugin = current_plugin
16
- end
17
-
18
- def contact_form_on_export(args)
19
- args[:obj][:plugins][self_plugin_key] = JSON.parse(current_site.contact_forms.to_json(:include => [:responses]))
20
- end
21
-
22
- def contact_form_on_import(args)
23
- plugins = args[:data][:plugins]
24
- if plugins[self_plugin_key.to_sym].present?
25
- plugins[self_plugin_key.to_sym].each do |contact|
26
- unless current_site.contact_forms.where(slug: contact[:slug]).first.present?
27
- sba_data = ActionController::Parameters.new(contact)
28
- contact_new = current_site.contact_forms.new(sba_data.permit(:name, :slug, :count, :description, :value, :settings))
29
- if contact_new.save!
30
- if contact[:get_field_groups] # save group fields
31
- save_field_group(contact_new, contact[:get_field_groups])
32
- end
33
- save_field_values(contact_new, contact[:field_values])
34
-
35
- if contact[:responses].present? # saving responses for this contact
36
- contact[:responses].each do |response|
37
- sba_data = ActionController::Parameters.new(response)
38
- contact_new.responses.create!(sba_data.permit(:name, :slug, :count, :description, :value, :settings))
39
- end
40
- end
41
- args[:messages] << "Saved Plugin Contact Form: #{contact_new.name}"
42
- end
43
- end
44
- end
45
- end
46
- end
47
-
48
- # here all actions on plugin destroying
49
- # plugin: plugin model
50
- def contact_form_on_destroy(plugin)
51
- ActiveRecord::Base.connection.execute('DROP TABLE plugins_contact_forms;');
52
- end
53
-
54
- # here all actions on going to active
55
- # you can run sql commands like this:
56
- # results = ActiveRecord::Base.connection.execute(query);
57
- # plugin: plugin model
58
- def contact_form_on_active(plugin)
59
- unless ActiveRecord::Base.connection.table_exists? 'plugins_contact_forms'
60
-
61
- ActiveRecord::Base.connection.create_table :plugins_contact_forms do |t|
62
- t.integer :site_id, :count, :parent_id
63
- t.string :name, :slug
64
- t.text :description, :value, :settings
65
- t.timestamps
66
- end
67
- end
68
- end
69
-
70
- # here all actions on going to inactive
71
- # plugin: plugin model
72
- def contact_form_on_inactive(plugin)
73
-
74
- end
75
-
76
- def contact_form_admin_before_load
77
- admin_menu_append_menu_item("settings", {icon: "envelope-o", title: t('plugin.contact_form.contact_form'), url: admin_plugins_contact_form_admin_forms_path, datas: "data-intro='This plugin permit you to create you contact forms with desired fields and paste your short_code in any content.' data-position='right'"})
78
- end
79
-
80
- def contact_form_app_before_load
81
- shortcode_add('forms', plugin_view("forms_shorcode"), "This is a shortocode for contact form to permit you to put your contact form in any content. Sample: [forms slug='key-for-my-form']")
82
- end
83
-
84
- def contact_form_front_before_load
85
-
86
- end
87
-
88
- def perform_save_form(form, values, fields, settings, success, errors)
89
- attachments = []
90
- if validate_to_save_form(values, fields, settings, errors)
91
- values[:fields].each do |f|
92
- cid = f[:cid].to_sym
93
- if f[:field_type] == 'file'
94
- res = upload_file(fields[cid], {maximum: 5.megabytes, folder: 'contact_form'})
95
- if res[:error].present?
96
- errors << res[:error]
97
- else
98
- attachments << res['file']
99
- end
100
- end
101
- end
102
-
103
- new_settings = {"fields" => fields, "created_at" => Time.now.strftime("%Y-%m-%d %H:%M:%S").to_s}.to_json
104
- form_new = current_site.contact_forms.new(name: "response-#{Time.now}", description: form.description, settings: fix_meta_value(new_settings), site_id: form.site_id, parent_id: form.id)
105
-
106
- if form_new.save
107
- fields_data = convert_form_values(values[:fields], fields)
108
- content = render_to_string(partial: plugin_view('contact_form/email_content'), layout: false, locals: {file_attachments: attachments, fields: fields_data})
109
- cama_send_email(settings[:railscf_mail][:to], settings[:railscf_mail][:subject], {attachments: attachments, content: content, extra_data: {fields: fields_data}})
110
- success << settings[:railscf_message][:mail_sent_ok]
111
- else
112
- errors << settings[:railscf_message][:mail_sent_ng]
113
- end
114
- end
115
- end
116
-
117
- def validate_to_save_form(values, fields, settings, errors)
118
- validate = true
119
- values[:fields].each do |f|
120
- cid = f[:cid].to_sym
121
- label = f[:label].to_sym
122
-
123
- case f[:field_type].to_s
124
- when 'text', 'website', 'paragraph', 'textarea', 'email', 'radio', 'checkboxes', 'dropdown', 'file'
125
- if f[:required] && !fields[cid].present?
126
- errors << "#{label}: #{settings[:railscf_message][:invalid_required]}"
127
- validate = false
128
- end
129
- if f[:field_type].to_s == "email"
130
- if !fields[cid].match(/@/)
131
- errors << "#{label}: #{settings[:railscf_message][:invalid_email]}"
132
- validate = false
133
- end
134
- end
135
- when 'captcha'
136
- unless cama_captcha_verified?
137
- errors << "#{label}: #{settings[:railscf_message][:captcha_not_match]}"
138
- validate = false
139
- end
140
- end
141
- end
142
- validate
143
- end
144
-
145
- def fix_meta_value(value)
146
- if (value.is_a?(Array) || value.is_a?(Hash))
147
- value = value.to_json
148
- elsif value.is_a?(String)
149
- value = value.to_var
150
- end
151
- value
152
- end
153
-
154
- end