camaleon_cms 1.1.0 → 2.0.1
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 +27 -60
- data/app/apps/plugins/attack/admin_controller.rb +1 -1
- data/app/apps/plugins/attack/attack_helper.rb +4 -4
- data/app/apps/plugins/attack/config/config.json +1 -1
- data/app/apps/plugins/attack/config/custom_models.rb +1 -1
- data/app/apps/plugins/attack/views/admin/settings.html.erb +2 -2
- data/app/apps/plugins/contact_form/admin_forms_controller.rb +8 -7
- data/app/apps/plugins/contact_form/config/custom_models.rb +1 -1
- data/app/apps/plugins/contact_form/contact_form_helper.rb +4 -5
- data/app/apps/plugins/contact_form/contact_form_html_helper.rb +2 -2
- data/app/apps/plugins/contact_form/front_controller.rb +1 -1
- data/app/apps/plugins/contact_form/views/admin_forms/_form.html.erb +5 -5
- data/app/apps/plugins/contact_form/views/admin_forms/edit.html.erb +19 -35
- data/app/apps/plugins/contact_form/views/admin_forms/index.html.erb +3 -3
- data/app/apps/plugins/contact_form/views/admin_forms/responses.html.erb +6 -13
- data/app/apps/plugins/contact_form/views/forms_shorcode.html.erb +1 -1
- data/app/apps/plugins/contact_form/views/front/index.html.erb +1 -1
- data/app/apps/plugins/front_cache/admin_controller.rb +1 -1
- data/app/apps/plugins/front_cache/config/initializer.rb +1 -1
- data/app/apps/plugins/front_cache/front_cache_helper.rb +37 -42
- data/app/apps/plugins/front_cache/views/admin/settings.html.erb +3 -3
- data/app/apps/plugins/visibility_post/config/config.json +1 -1
- data/app/apps/plugins/visibility_post/visibility_post_helper.rb +21 -23
- data/app/apps/themes/camaleon_first/assets/css/main.css +1 -1
- data/app/apps/themes/camaleon_first/assets/js/main.js +1 -1
- data/app/apps/themes/camaleon_first/views/admin/settings.html.erb +1 -1
- data/app/apps/themes/default/views/admin/settings.html.erb +1 -1
- data/app/apps/themes/default/views/category.html.erb +1 -1
- data/app/apps/themes/default/views/layouts/index.html.erb +7 -7
- data/app/apps/themes/default/views/partials/_comments.html.erb +1 -1
- data/app/apps/themes/default/views/partials/_forms.html.erb +2 -2
- data/app/apps/themes/default/views/partials/_search_form.html.erb +4 -4
- data/app/apps/themes/default/views/post_tag.html.erb +1 -1
- data/app/apps/themes/default/views/post_type.html.erb +1 -1
- data/app/apps/themes/default/views/search.html.erb +1 -1
- data/app/apps/themes/new/assets/js/main.js +0 -1
- data/app/apps/themes/new/views/admin/settings.html.erb +1 -1
- data/app/apps/themes/new/views/category.html.erb +1 -1
- data/app/apps/themes/new/views/layouts/_footer.html.erb +0 -1
- data/app/apps/themes/new/views/layouts/_header.html.erb +7 -7
- data/app/apps/themes/new/views/layouts/index.html.erb +0 -1
- data/app/apps/themes/new/views/partials/_comments.html.erb +1 -1
- data/app/apps/themes/new/views/partials/_forms.html.erb +2 -2
- data/app/apps/themes/new/views/partials/_search_form.html.erb +2 -3
- data/app/apps/themes/new/views/post_tag.html.erb +1 -1
- data/app/apps/themes/new/views/post_type.html.erb +1 -1
- data/app/apps/themes/new/views/search.html.erb +1 -1
- data/app/assets/fonts/{glyphicons-halflings-regular.eot → camaleon_cms/glyphicons-halflings-regular.eot} +0 -0
- data/app/assets/fonts/{glyphicons-halflings-regular.svg → camaleon_cms/glyphicons-halflings-regular.svg} +0 -0
- data/app/assets/fonts/{glyphicons-halflings-regular.ttf → camaleon_cms/glyphicons-halflings-regular.ttf} +0 -0
- data/app/assets/fonts/{glyphicons-halflings-regular.woff → camaleon_cms/glyphicons-halflings-regular.woff} +0 -0
- data/app/assets/images/camaleon_cms/admin/admin_spinner.gif +0 -0
- data/app/assets/images/{admin → camaleon_cms/admin}/glyphicons-halflings.png +0 -0
- data/app/assets/images/{admin → camaleon_cms/admin}/intro/menus.png +0 -0
- data/app/assets/images/{admin → camaleon_cms/admin}/no_image.jpg +0 -0
- data/app/assets/images/{bg-tree.jpeg → camaleon_cms/bg-tree.jpeg} +0 -0
- data/app/assets/images/{camaleon-dark.png → camaleon_cms/camaleon-dark.png} +0 -0
- data/app/assets/images/camaleon_cms/camaleon.png +0 -0
- data/app/assets/images/{category-icon.png → camaleon_cms/category-icon.png} +0 -0
- data/app/assets/images/camaleon_cms/favicon.ico +0 -0
- data/app/assets/images/{image-not-found.png → camaleon_cms/image-not-found.png} +0 -0
- data/app/assets/images/{language → camaleon_cms/language}/de.png +0 -0
- data/app/assets/images/{language → camaleon_cms/language}/en.png +0 -0
- data/app/assets/images/{language → camaleon_cms/language}/es.png +0 -0
- data/app/assets/images/{language → camaleon_cms/language}/fr.png +0 -0
- data/app/assets/images/{language → camaleon_cms/language}/it.png +0 -0
- data/app/assets/images/{language → camaleon_cms/language}/pt.png +0 -0
- data/app/assets/images/camaleon_cms/language/pt_br.png +0 -0
- data/app/assets/images/{language → camaleon_cms/language}/zh.png +0 -0
- data/app/assets/images/{loader.gif → camaleon_cms/loader.gif} +0 -0
- data/app/assets/images/{users → camaleon_cms/users}/no-image.jpg +0 -0
- data/app/assets/javascripts/{admin/actions.js → camaleon_cms/admin/_actions.js} +3 -5
- data/app/assets/javascripts/camaleon_cms/admin/_custom_fields.js +178 -0
- data/app/assets/javascripts/{admin/data.js → camaleon_cms/admin/_data.js} +4 -9
- data/app/assets/javascripts/{admin/i18n.js → camaleon_cms/admin/_i18n.js} +10 -4
- data/app/assets/javascripts/{admin/jquery-ui.min.js → camaleon_cms/admin/_jquery-ui.min.js} +0 -0
- data/app/assets/javascripts/camaleon_cms/admin/_jquery.slugify.js +67 -0
- data/app/assets/javascripts/{admin/jquery.tagsinput.min.js → camaleon_cms/admin/_jquery.tagsinput.min.js} +0 -0
- data/app/assets/javascripts/camaleon_cms/admin/_libraries.js +339 -0
- data/app/assets/javascripts/{admin/modal.js → camaleon_cms/admin/_modal.js} +42 -25
- data/app/assets/javascripts/camaleon_cms/admin/_post.js +303 -0
- data/app/assets/javascripts/{admin/translator.js → camaleon_cms/admin/_translator.js} +4 -3
- data/app/assets/javascripts/{admin/underscore.js → camaleon_cms/admin/_underscore.js} +0 -0
- data/app/assets/javascripts/camaleon_cms/admin/admin-basic-manifest.js +3 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/admin-manifest.js +23 -18
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/bootstrap-colorpicker.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/bootstrap-datepicker.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/bootstrap-datetimepicker.min.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/bootstrap-select.js +0 -0
- data/app/assets/javascripts/camaleon_cms/admin/custom_fields_form.js +69 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/form-builder/formbuilder.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/form-builder/vendor.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/form/cropper.min.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/form/jquery.form.js +0 -0
- data/app/assets/javascripts/{admin/introjs/intro.min.js → camaleon_cms/admin/introjs/_intro.min.js} +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/jquery-sieve.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/jquery.nestable.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/jquery.validate.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin/jquery_validate}/es.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin/jquery_validate}/it.js +0 -0
- data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/pt_br.js +74 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/login.js.coffee +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/login_manifest.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/lte/app.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/nav-menu.js +5 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/plugins.js +0 -0
- data/app/assets/javascripts/{admin/tageditor/jquery.caret.min.js → camaleon_cms/admin/tageditor/_jquery.caret.min.js} +0 -0
- data/app/assets/javascripts/{admin/tageditor/jquery.tag-editor.js → camaleon_cms/admin/tageditor/_jquery.tag-editor.js} +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/langs/en.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/langs/es.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/langs/it.js +0 -0
- data/app/assets/javascripts/camaleon_cms/admin/tinymce/langs/pt_br.js +219 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/langs/readme.md +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-cool.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-cry.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-embarassed.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-frown.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-innocent.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-kiss.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-laughing.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-sealed.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-smile.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-surprised.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-undecided.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-wink.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/emoticons/img/smiley-yell.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/filemanager/plugin.min.js +3 -4
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/plugins/visualblocks/css/visualblocks.css +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/skins/lightgray/content.min.css.scss +2 -2
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/skins/lightgray/fonts/tinymce-small.svg +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/skins/lightgray/fonts/tinymce.svg +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/skins/lightgray/img/object.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/themes/modern/theme.min.js +0 -0
- data/app/assets/javascripts/{admin → camaleon_cms/admin}/tinymce/tinymce.min.js +0 -0
- data/app/assets/javascripts/camaleon_cms/admin/uploader/_jquery.uploadfile.min.js +8 -0
- data/app/assets/javascripts/camaleon_cms/admin/uploader/_media_manager.js.coffee +161 -0
- data/app/assets/javascripts/camaleon_cms/admin/uploader/uploader_manifest.js +2 -0
- data/app/assets/javascripts/camaleon_cms/admin/user_profile.js +70 -0
- data/app/assets/javascripts/{bootstrap.min.js → camaleon_cms/bootstrap.min.js} +0 -0
- data/app/assets/javascripts/{gibberish-aes.js → camaleon_cms/gibberish-aes.js} +0 -0
- data/app/assets/stylesheets/camaleon_cms/admin/_custom_admin.css.scss +267 -0
- data/app/assets/stylesheets/{admin/jquery.tagsinput.css → camaleon_cms/admin/_jquery.tagsinput.css} +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/admin-basic-manifest.css +3 -3
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/admin-manifest.css +16 -8
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/bootstrap-datepicker.css.scss +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/bootstrap-datetimepicker.css.scss +1 -1
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/colorpicker.css.scss +4 -4
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/cropper/cropper.min.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/form-builder/formbuilder.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/img/bg.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/img/colorpicker/alpha.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/img/colorpicker/hue.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/img/colorpicker/saturation.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/img/girls-1.jpg +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/img/jquery/resize-icon.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/img/loading.gif +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/img/logo-small.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/img/logo.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/img/no_image.jpg +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/img/rormeleon-white.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/img/thumb_no_found.jpg +0 -0
- data/app/assets/stylesheets/{admin/introjs/introjs.min.css → camaleon_cms/admin/introjs/_introjs.min.css} +0 -0
- data/app/assets/stylesheets/{admin/jquery/jquery-ui.scss → camaleon_cms/admin/jquery/_jquery-ui.scss} +16 -16
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/jquery/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/jquery/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/jquery/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/jquery/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/jquery/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/jquery/images/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/jquery/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/jquery/images/ui-icons_888888_256x240.png +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/jquery/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/stylesheets/{admin/lte/admin.css.scss → camaleon_cms/admin/lte/_admin.css.scss} +4 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/lte/skins/skin-black-light.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/lte/skins/skin-black.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/lte/skins/skin-blue-light.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/lte/skins/skin-blue.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/lte/skins/skin-green-light.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/lte/skins/skin-green.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/lte/skins/skin-purple-light.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/lte/skins/skin-purple.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/lte/skins/skin-red-light.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/lte/skins/skin-red.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/lte/skins/skin-yellow-light.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/lte/skins/skin-yellow.css +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/nav-menu.css.scss +0 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/nestable/jquery.nestable.css +0 -0
- data/app/assets/stylesheets/{admin/tageditor/jquery.tag-editor.css.scss → camaleon_cms/admin/tageditor/_jquery.tag-editor.css.scss} +0 -0
- data/app/assets/stylesheets/camaleon_cms/admin/uploader/_uploadfile.css.scss +253 -0
- data/app/assets/stylesheets/{admin → camaleon_cms/admin}/widgets.css.scss +0 -0
- data/app/assets/stylesheets/camaleon_cms/bootstrap.min.css.scss +5 -0
- data/app/controllers/{admin → camaleon_cms/admin}/appearances/nav_menus_controller.rb +14 -11
- data/app/controllers/{admin → camaleon_cms/admin}/appearances/themes_controller.rb +4 -2
- data/app/controllers/{admin → camaleon_cms/admin}/appearances/widgets/assign_controller.rb +5 -5
- data/app/controllers/{admin → camaleon_cms/admin}/appearances/widgets/main_controller.rb +8 -6
- data/app/controllers/{admin → camaleon_cms/admin}/appearances/widgets/sidebar_controller.rb +9 -9
- data/app/controllers/{admin → camaleon_cms/admin}/categories_controller.rb +18 -10
- data/app/controllers/camaleon_cms/admin/comments_controller.rb +97 -0
- data/app/controllers/{admin → camaleon_cms/admin}/installers_controller.rb +10 -10
- data/app/controllers/camaleon_cms/admin/media_controller.rb +84 -0
- data/app/controllers/{admin → camaleon_cms/admin}/plugins_controller.rb +7 -6
- data/app/controllers/{admin → camaleon_cms/admin}/post_tags_controller.rb +18 -10
- data/app/controllers/{admin → camaleon_cms/admin}/posts/drafts_controller.rb +5 -5
- data/app/controllers/{admin → camaleon_cms/admin}/posts_controller.rb +40 -23
- data/app/controllers/{admin → camaleon_cms/admin}/sessions_controller.rb +45 -35
- data/app/controllers/{admin → camaleon_cms/admin}/settings/custom_fields_controller.rb +13 -12
- data/app/controllers/{admin → camaleon_cms/admin}/settings/post_types_controller.rb +14 -13
- data/app/controllers/{admin → camaleon_cms/admin}/settings/sites_controller.rb +17 -15
- data/app/controllers/{admin → camaleon_cms/admin}/settings_controller.rb +8 -5
- data/app/controllers/{admin → camaleon_cms/admin}/user_roles_controller.rb +12 -11
- data/app/controllers/{admin → camaleon_cms/admin}/users_controller.rb +42 -48
- data/app/controllers/{admin_controller.rb → camaleon_cms/admin_controller.rb} +28 -9
- data/app/controllers/{apps → camaleon_cms/apps}/plugins_admin_controller.rb +7 -3
- data/app/controllers/camaleon_cms/apps/plugins_front_controller.rb +38 -0
- data/app/controllers/{apps → camaleon_cms/apps}/themes_admin_controller.rb +1 -1
- data/app/controllers/{apps → camaleon_cms/apps}/themes_front_controller.rb +1 -1
- data/app/controllers/camaleon_cms/camaleon_controller.rb +99 -0
- data/app/controllers/{frontend_controller.rb → camaleon_cms/frontend_controller.rb} +56 -45
- data/app/controllers/concerns/{frontend_concern.rb → camaleon_cms/frontend_concern.rb} +8 -8
- data/app/decorators/{application_decorator.rb → camaleon_cms/application_decorator.rb} +5 -17
- data/app/decorators/{category_decorator.rb → camaleon_cms/category_decorator.rb} +8 -3
- data/app/decorators/{custom_field_decorator.rb → camaleon_cms/custom_field_decorator.rb} +1 -1
- data/app/decorators/{custom_fields_concern.rb → camaleon_cms/custom_fields_concern.rb} +4 -3
- data/app/decorators/{metas_decorator_methods.rb → camaleon_cms/metas_decorator_methods.rb} +1 -1
- data/app/decorators/{nav_menu_item_decorator.rb → camaleon_cms/nav_menu_item_decorator.rb} +2 -2
- data/app/decorators/{post_comment_decorator.rb → camaleon_cms/post_comment_decorator.rb} +3 -2
- data/app/decorators/{post_decorator.rb → camaleon_cms/post_decorator.rb} +61 -14
- data/app/decorators/{post_tag_decorator.rb → camaleon_cms/post_tag_decorator.rb} +8 -3
- data/app/decorators/{post_type_decorator.rb → camaleon_cms/post_type_decorator.rb} +29 -6
- data/app/decorators/{site_decorator.rb → camaleon_cms/site_decorator.rb} +24 -22
- data/app/decorators/{term_taxonomy_decorator.rb → camaleon_cms/term_taxonomy_decorator.rb} +15 -15
- data/app/decorators/{theme_decorator.rb → camaleon_cms/theme_decorator.rb} +1 -1
- data/app/decorators/{user_decorator.rb → camaleon_cms/user_decorator.rb} +23 -11
- data/app/decorators/{widget_decorator.rb → camaleon_cms/widget_decorator.rb} +2 -2
- data/app/helpers/{admin → camaleon_cms/admin}/application_helper.rb +17 -9
- data/app/helpers/{admin → camaleon_cms/admin}/breadcrumb_helper.rb +6 -20
- data/app/helpers/{admin → camaleon_cms/admin}/category_helper.rb +6 -3
- data/app/helpers/{admin → camaleon_cms/admin}/custom_fields_helper.rb +21 -20
- data/app/helpers/{admin → camaleon_cms/admin}/menus_helper.rb +26 -36
- data/app/helpers/{admin → camaleon_cms/admin}/post_type_helper.rb +4 -4
- data/app/helpers/{camaleon_helper.rb → camaleon_cms/camaleon_helper.rb} +23 -19
- data/app/helpers/{captcha_helper.rb → camaleon_cms/captcha_helper.rb} +21 -17
- data/app/helpers/camaleon_cms/comment_helper.rb +48 -0
- data/app/helpers/{content_helper.rb → camaleon_cms/content_helper.rb} +12 -10
- data/app/helpers/{frontend → camaleon_cms/frontend}/application_helper.rb +7 -7
- data/app/helpers/{frontend → camaleon_cms/frontend}/nav_menu_helper.rb +21 -34
- data/app/helpers/{frontend → camaleon_cms/frontend}/seo_helper.rb +5 -5
- data/app/helpers/{frontend → camaleon_cms/frontend}/site_helper.rb +17 -10
- data/app/helpers/{hooks_helper.rb → camaleon_cms/hooks_helper.rb} +1 -1
- data/app/helpers/camaleon_cms/html_helper.rb +106 -0
- data/app/helpers/{plugins_helper.rb → camaleon_cms/plugins_helper.rb} +49 -64
- data/app/helpers/{session_helper.rb → camaleon_cms/session_helper.rb} +29 -26
- data/app/helpers/{short_code_helper.rb → camaleon_cms/short_code_helper.rb} +50 -16
- data/app/helpers/{site_helper.rb → camaleon_cms/site_helper.rb} +14 -19
- data/app/helpers/{theme_helper.rb → camaleon_cms/theme_helper.rb} +37 -43
- data/app/helpers/camaleon_cms/uploader_helper.rb +366 -0
- data/app/helpers/{user_roles_helper.rb → camaleon_cms/user_roles_helper.rb} +3 -3
- data/app/mailers/{html_mailer.rb → camaleon_cms/html_mailer.rb} +7 -7
- data/app/models/{ability.rb → camaleon_cms/ability.rb} +3 -3
- data/app/models/{category.rb → camaleon_cms/category.rb} +15 -12
- data/app/models/{custom_field.rb → camaleon_cms/custom_field.rb} +8 -10
- data/app/models/{custom_field_group.rb → camaleon_cms/custom_field_group.rb} +12 -11
- data/app/models/{custom_fields_relationship.rb → camaleon_cms/custom_fields_relationship.rb} +4 -4
- data/app/models/{meta.rb → camaleon_cms/meta.rb} +2 -5
- data/app/models/{nav_menu.rb → camaleon_cms/nav_menu.rb} +14 -13
- data/app/models/{nav_menu_item.rb → camaleon_cms/nav_menu_item.rb} +18 -7
- data/app/models/{plugin.rb → camaleon_cms/plugin.rb} +3 -3
- data/app/models/{post.rb → camaleon_cms/post.rb} +57 -32
- data/app/models/{post_comment.rb → camaleon_cms/post_comment.rb} +10 -9
- data/app/models/{post_default.rb → camaleon_cms/post_default.rb} +24 -19
- data/app/models/{post_relationship.rb → camaleon_cms/post_relationship.rb} +5 -5
- data/app/models/{post_tag.rb → camaleon_cms/post_tag.rb} +4 -4
- data/app/models/{post_type.rb → camaleon_cms/post_type.rb} +49 -17
- data/app/models/{site.rb → camaleon_cms/site.rb} +38 -80
- data/app/models/{term_relationship.rb → camaleon_cms/term_relationship.rb} +6 -4
- data/app/models/camaleon_cms/term_taxonomy.rb +81 -0
- data/app/models/{theme.rb → camaleon_cms/theme.rb} +3 -3
- data/app/models/{user.rb → camaleon_cms/user.rb} +23 -37
- data/app/models/{user_relationship.rb → camaleon_cms/user_relationship.rb} +4 -4
- data/app/models/camaleon_cms/user_role.rb +140 -0
- data/app/models/{widget.rb → camaleon_cms/widget.rb} +1 -1
- data/app/models/{widget → camaleon_cms/widget}/assigned.rb +4 -4
- data/app/models/{widget → camaleon_cms/widget}/main.rb +5 -5
- data/app/models/{widget → camaleon_cms/widget}/sidebar.rb +3 -3
- data/app/models/concerns/{categories_tags_for_posts.rb → camaleon_cms/categories_tags_for_posts.rb} +3 -3
- data/app/models/concerns/{custom_fields_read.rb → camaleon_cms/custom_fields_read.rb} +10 -11
- data/app/models/concerns/camaleon_cms/metas.rb +135 -0
- data/app/views/camaleon_cms/404.html.erb +4 -0
- data/app/views/camaleon_cms/500.html.erb +4 -0
- data/app/views/{_flash_messages.html.erb → camaleon_cms/_flash_messages.html.erb} +0 -0
- data/app/views/camaleon_cms/admin/appearances/nav_menus/_custom_fields.html.erb +6 -0
- data/app/views/{admin → camaleon_cms/admin}/appearances/nav_menus/_custom_menus.html.erb +2 -2
- data/app/views/{admin → camaleon_cms/admin}/appearances/nav_menus/_external_menu.html.erb +3 -3
- data/app/views/camaleon_cms/admin/appearances/nav_menus/_menu_form.html.erb +36 -0
- data/app/views/{admin → camaleon_cms/admin}/appearances/nav_menus/_menu_list.html.erb +5 -5
- data/app/views/{admin → camaleon_cms/admin}/appearances/nav_menus/index.html.erb +8 -8
- data/app/views/{admin → camaleon_cms/admin}/appearances/themes/index.html.erb +7 -6
- data/app/views/{admin → camaleon_cms/admin}/appearances/themes/preview.html.erb +0 -0
- data/app/views/{admin → camaleon_cms/admin}/appearances/themes/theme_load_data.html.erb +1 -1
- data/app/views/{admin → camaleon_cms/admin}/appearances/widgets/assign/_form.html.erb +5 -5
- data/app/views/{admin → camaleon_cms/admin}/appearances/widgets/main/_sidebar.html.erb +4 -4
- data/app/views/camaleon_cms/admin/appearances/widgets/main/form.html.erb +27 -0
- data/app/views/camaleon_cms/admin/appearances/widgets/main/index.html.erb +41 -0
- data/app/views/{admin → camaleon_cms/admin}/appearances/widgets/sidebar/form.html.erb +5 -5
- data/app/views/camaleon_cms/admin/categories/_form.html.erb +42 -0
- data/app/views/{admin/settings/post_types → camaleon_cms/admin/categories}/edit.html.erb +1 -1
- data/app/views/{admin → camaleon_cms/admin}/categories/index.html.erb +16 -26
- data/app/views/camaleon_cms/admin/comments/form.html.erb +12 -0
- data/app/views/camaleon_cms/admin/comments/form_answer.html.erb +12 -0
- data/app/views/camaleon_cms/admin/comments/index.html.erb +21 -0
- data/app/views/camaleon_cms/admin/comments/list.html.erb +36 -0
- data/app/views/{admin/dashboard/index.html.erb → camaleon_cms/admin/dashboard.html.erb} +2 -2
- data/app/views/{admin → camaleon_cms/admin}/installers/form.html.erb +6 -6
- data/app/views/camaleon_cms/admin/installers/welcome.html.erb +8 -0
- data/app/views/camaleon_cms/admin/media/_files_list.html.erb +7 -0
- data/app/views/camaleon_cms/admin/media/_render_file_item.html.erb +27 -0
- data/app/views/camaleon_cms/admin/media/_render_folder_item.html.erb +13 -0
- data/app/views/camaleon_cms/admin/media/index.html.erb +25 -0
- data/app/views/{admin → camaleon_cms/admin}/plugins/_plugins_list.html.erb +10 -10
- data/app/views/{admin → camaleon_cms/admin}/plugins/index.html.erb +10 -6
- data/app/views/{admin → camaleon_cms/admin}/post_tags/_form.html.erb +8 -14
- data/app/views/{admin → camaleon_cms/admin}/post_tags/edit.html.erb +2 -2
- data/app/views/camaleon_cms/admin/post_tags/index.html.erb +58 -0
- data/app/views/camaleon_cms/admin/posts/_filter_posts.html.erb +5 -0
- data/app/views/{admin → camaleon_cms/admin}/posts/_sidebar.html.erb +34 -36
- data/app/views/camaleon_cms/admin/posts/form.html.erb +97 -0
- data/app/views/{admin → camaleon_cms/admin}/posts/index.html.erb +34 -31
- data/app/views/{admin → camaleon_cms/admin}/posts/show.html.erb +1 -1
- data/app/views/camaleon_cms/admin/search.html.erb +68 -0
- data/app/views/camaleon_cms/admin/sessions/forgot.html.erb +44 -0
- data/app/views/camaleon_cms/admin/sessions/login.html.erb +49 -0
- data/app/views/camaleon_cms/admin/sessions/register.html.erb +63 -0
- data/app/views/camaleon_cms/admin/settings/_configuration_settings.html.erb +35 -0
- data/app/views/camaleon_cms/admin/settings/_email_settings.html.erb +33 -0
- data/app/views/camaleon_cms/admin/settings/_file_system_settings.html.erb +23 -0
- data/app/views/camaleon_cms/admin/settings/_seo_settings.html.erb +22 -0
- data/app/views/{admin/settings/custom_fields/get_items.html.erb → camaleon_cms/admin/settings/custom_fields/_get_items.html.erb} +19 -39
- data/app/views/{admin → camaleon_cms/admin}/settings/custom_fields/_meta_data.html.erb +2 -2
- data/app/views/{admin → camaleon_cms/admin}/settings/custom_fields/_render.html.erb +25 -31
- data/app/views/{admin/settings/custom_fields/fields/audio.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_audio.html.erb} +1 -1
- data/app/views/{admin/settings/custom_fields/fields/checkbox.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_checkbox.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/checkboxes.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_checkboxes.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/colorpicker.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_colorpicker.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/date.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_date.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/editor.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_editor.html.erb} +0 -1
- data/app/views/{admin/settings/custom_fields/fields/email.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_email.html.erb} +0 -0
- data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_field_attrs.html.erb +8 -0
- data/app/views/{admin/settings/custom_fields/fields/file.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_file.html.erb} +1 -1
- data/app/views/{admin/settings/custom_fields/fields/image.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_image.html.erb} +1 -1
- data/app/views/{admin/settings/custom_fields/fields/numeric.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_numeric.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/phone.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_phone.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/posts.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_posts.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/radio.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_radio.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/select.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_select.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/select_eval.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_select_eval.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/text_area.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_text_area.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/text_box.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_text_box.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/url.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_url.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/users.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_users.html.erb} +0 -0
- data/app/views/{admin/settings/custom_fields/fields/video.html.erb → camaleon_cms/admin/settings/custom_fields/fields/_video.html.erb} +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/form.html.erb +137 -0
- data/app/views/{admin → camaleon_cms/admin}/settings/custom_fields/index.html.erb +18 -14
- data/app/views/{admin → camaleon_cms/admin}/settings/languages.html.erb +7 -7
- data/app/views/camaleon_cms/admin/settings/post_types/_form.html.erb +134 -0
- data/app/views/{admin/categories → camaleon_cms/admin/settings/post_types}/edit.html.erb +2 -2
- data/app/views/camaleon_cms/admin/settings/post_types/index.html.erb +54 -0
- data/app/views/camaleon_cms/admin/settings/shortcodes.html.erb +37 -0
- data/app/views/camaleon_cms/admin/settings/site.html.erb +112 -0
- data/app/views/{admin → camaleon_cms/admin}/settings/sites/form.html.erb +9 -9
- data/app/views/camaleon_cms/admin/settings/sites/index.html.erb +58 -0
- data/app/views/camaleon_cms/admin/user_roles/form.html.erb +160 -0
- data/app/views/camaleon_cms/admin/user_roles/index.html.erb +51 -0
- data/app/views/camaleon_cms/admin/users/form.html.erb +233 -0
- data/app/views/camaleon_cms/admin/users/index.html.erb +55 -0
- data/app/views/camaleon_cms/admin/users/profile.html.erb +1 -0
- data/app/views/{admin → camaleon_cms/admin}/users/profile/_activity.html.erb +0 -0
- data/app/views/{admin → camaleon_cms/admin}/users/profile/_settings.html.erb +0 -0
- data/app/views/camaleon_cms/default_theme/admin/settings.html.erb +1 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/category.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/category.rss.builder +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/audio.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/checkbox.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/checkboxes.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/colorpicker.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/date.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/editor.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/email.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/field_attrs.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/file.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/image.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/numeric.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/phone.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/posts.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/radio.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/select.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/select_eval.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/text_area.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/text_box.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/url.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/users.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/custom_fields/video.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/index.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/layouts/_footer.html.erb +0 -1
- data/app/views/{default_theme → camaleon_cms/default_theme}/layouts/_header.html.erb +7 -7
- data/app/views/{default_theme → camaleon_cms/default_theme}/layouts/index.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/partials/_breadcrumb.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/partials/_categories_list.html.erb +0 -0
- data/app/views/camaleon_cms/default_theme/partials/_comments.html.erb +33 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/partials/_comments_list.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/partials/_flash_messages.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/partials/_forms.html.erb +2 -2
- data/app/views/{default_theme → camaleon_cms/default_theme}/partials/_post_list_item.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/partials/_render_custom_field.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/partials/_search_form.html.erb +2 -4
- data/app/views/{default_theme → camaleon_cms/default_theme}/partials/_sidebar.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/post_tag.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/post_tag.rss.builder +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/post_type.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/post_type.rss.builder +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/profile.html.erb +0 -0
- data/app/views/camaleon_cms/default_theme/robots.text.erb +1 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/rss.rss.builder +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/search.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/single.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/single.rss.builder +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/sitemap.html.erb +0 -0
- data/app/views/{default_theme → camaleon_cms/default_theme}/sitemap.xml.builder +0 -0
- data/app/views/{html_mailer → camaleon_cms/html_mailer}/mailer.html.erb +0 -0
- data/app/views/{shortcode_templates → camaleon_cms/shortcode_templates}/widget.html.erb +1 -1
- data/app/views/layouts/camaleon_cms/admin.html.erb +49 -0
- data/app/views/layouts/camaleon_cms/admin/_ajax.html.erb +6 -0
- data/app/views/layouts/{admin → camaleon_cms/admin}/_flash_messages.html.erb +9 -0
- data/app/views/layouts/{admin → camaleon_cms/admin}/_footer.html.erb +0 -0
- data/app/views/layouts/{admin → camaleon_cms/admin}/_form_error.html.erb +1 -1
- data/app/views/layouts/{admin → camaleon_cms/admin}/_header.html.erb +11 -11
- data/app/views/layouts/camaleon_cms/admin/_sidebar.html.erb +19 -0
- data/app/views/layouts/{admin → camaleon_cms/admin}/installer.html.erb +5 -5
- data/app/views/layouts/{application.html.erb → camaleon_cms/application.html.erb} +0 -0
- data/app/views/layouts/{login.html.erb → camaleon_cms/login.html.erb} +5 -4
- data/app/views/layouts/{mailer.html.erb → camaleon_cms/mailer.html.erb} +0 -0
- data/config/initializers/action_view.rb +31 -0
- data/config/initializers/active_record_extension.rb +52 -2
- data/config/initializers/assets.rb +0 -18
- data/config/initializers/custom_initializers.rb +7 -0
- data/config/locales/camaleon_cms/admin/en.yml +648 -0
- data/config/locales/camaleon_cms/admin/es.yml +597 -0
- data/config/locales/camaleon_cms/admin/it.yml +607 -0
- data/config/locales/camaleon_cms/admin/js.yml +127 -0
- data/config/locales/camaleon_cms/admin/pt_br.yml +610 -0
- data/config/locales/camaleon_cms/common.yml +193 -0
- data/config/locales/{languages.yml → camaleon_cms/languages.yml} +0 -0
- data/config/locales/{routes.yml → camaleon_cms/routes.yml} +8 -0
- data/config/locales/{pt.yml → pt-BR.yml} +1 -1
- data/config/routes.rb +8 -24
- data/config/routes/admin.rb +114 -98
- data/config/routes/frontend.rb +39 -27
- data/config/system.json +5 -3
- data/db/migrate/20150611161134_post_table_into_utf8.rb +15 -15
- data/db/migrate/20150926095310_rename_column_posts.rb +4 -4
- data/lib/camaleon_cms/engine.rb +6 -9
- data/lib/camaleon_cms/version.rb +1 -1
- data/lib/ext/string.rb +10 -45
- data/lib/ext/translator.rb +3 -2
- data/lib/generators/camaleon_cms/gem_plugin_generator.rb +90 -83
- data/lib/generators/camaleon_cms/gem_plugin_template/app/controllers/plugins/my_plugin/admin_controller.rb +1 -1
- data/lib/generators/camaleon_cms/gem_plugin_template/app/controllers/plugins/my_plugin/front_controller.rb +1 -1
- data/lib/generators/camaleon_cms/gem_plugin_template/app/views/plugins/my_plugin/admin/index.html.erb +9 -2
- data/lib/generators/camaleon_cms/gem_theme_generator.rb +97 -0
- data/lib/generators/{ctheme_template/app/apps/themes/my_theme/assets/images → camaleon_cms/gem_theme_template/app/assets/images/themes/my_plugin}/image.png +0 -0
- data/lib/generators/{ctheme_template/app/apps/themes/my_theme/assets/js → camaleon_cms/gem_theme_template/app/assets/javascripts/themes/my_plugin}/main.js +1 -1
- data/lib/generators/{ctheme_template/app/apps/themes/my_theme/assets/css → camaleon_cms/gem_theme_template/app/assets/stylesheets/themes/my_plugin}/main.css +1 -1
- data/lib/generators/camaleon_cms/gem_theme_template/app/helpers/themes/my_plugin/main_helper.rb +26 -0
- data/lib/generators/{ctheme_template/app/apps/themes/my_theme/views → camaleon_cms/gem_theme_template/app/views/themes/my_plugin}/admin/settings.html.erb +1 -1
- data/lib/generators/{ctheme_template/app/apps/themes/my_theme/views → camaleon_cms/gem_theme_template/app/views/themes/my_plugin}/index.html.erb +0 -0
- data/lib/generators/camaleon_cms/gem_theme_template/app/views/themes/my_plugin/layouts/index.html.erb +71 -0
- data/lib/generators/{ctheme_template/app/apps/themes/my_theme/views → camaleon_cms/gem_theme_template/app/views/themes/my_plugin}/partials/readme.txt +0 -0
- data/lib/generators/camaleon_cms/gem_theme_template/config/camaleon_theme.json +14 -0
- data/lib/generators/camaleon_cms/install_template/system.json +4 -2
- data/lib/generators/camaleon_cms/theme_generator.rb +71 -0
- data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/assets/css/main.css +12 -0
- data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/assets/images/image.png +0 -0
- data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/assets/js/main.js +14 -0
- data/lib/generators/{ctheme_template → camaleon_cms/theme_template}/app/apps/themes/my_theme/config/config.json +0 -0
- data/lib/generators/{ctheme_template → camaleon_cms/theme_template}/app/apps/themes/my_theme/main_helper.rb +0 -0
- data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/views/admin/settings.html.erb +4 -0
- data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/views/index.html.erb +25 -0
- data/lib/generators/{ctheme_template → camaleon_cms/theme_template}/app/apps/themes/my_theme/views/layouts/index.html.erb +8 -8
- data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/views/partials/readme.txt +1 -0
- data/lib/plugin_routes.rb +59 -28
- data/lib/tasks/camaleon_cms/rspec_test.rake +16 -0
- metadata +458 -548
- data/app/apps/plugins/contact_form/views/admin_forms/manual.html.erb +0 -59
- data/app/apps/themes/new/assets/js/plugins/modal_elfinder.js +0 -29
- data/app/assets/javascripts/admin/admin-basic-manifest.js +0 -3
- data/app/assets/javascripts/admin/custom_fields.js +0 -167
- data/app/assets/javascripts/admin/elfinder-manifest.js +0 -7
- data/app/assets/javascripts/admin/elfinder/elfinder.full.js +0 -12646
- data/app/assets/javascripts/admin/elfinder/i18n/elfinder.es.js +0 -294
- data/app/assets/javascripts/admin/elfinder/i18n/elfinder.fr.js +0 -298
- data/app/assets/javascripts/admin/elfinder/i18n/elfinder.it.js +0 -366
- data/app/assets/javascripts/admin/elfinder/proxy/elFinderSupportVer1.js +0 -338
- data/app/assets/javascripts/admin/elfinder/upload_elfinder.js +0 -237
- data/app/assets/javascripts/admin/jquery.slugify.js +0 -65
- data/app/assets/javascripts/admin/libraries.js +0 -266
- data/app/assets/javascripts/admin/post.js +0 -273
- data/app/assets/javascripts/admin/widgets.js +0 -54
- data/app/assets/javascripts/elfinder_front.js +0 -85
- data/app/assets/stylesheets/admin/custom_admin.css.scss +0 -193
- data/app/assets/stylesheets/admin/elfinder-manifest.css +0 -6
- data/app/assets/stylesheets/admin/elfinder/elfinder-theme.scss +0 -191
- data/app/assets/stylesheets/admin/elfinder/elfinder.css +0 -1922
- data/app/assets/stylesheets/admin/elfinder/images/arrows-active.png +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/arrows-normal.png +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/crop.gif +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/dialogs.png +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/icons-big.png +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/icons-small.png +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/logo.png +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/progress.gif +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/quicklook-bg.png +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/quicklook-icons.png +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/resize.png +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/spinner-mini.gif +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/toolbar.png +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/stylesheets/admin/elfinder/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/stylesheets/bootstrap.min.css.scss +0 -5
- data/app/controllers/admin/appearances_controller.rb +0 -13
- data/app/controllers/admin/comments_controller.rb +0 -113
- data/app/controllers/admin/media_controller.rb +0 -53
- data/app/controllers/api/api_controller.rb +0 -31
- data/app/controllers/api/v1/category_controller.rb +0 -15
- data/app/controllers/api/v1/contact_form_controller.rb +0 -55
- data/app/controllers/api/v1/page_controller.rb +0 -8
- data/app/controllers/api/v1/post_controller.rb +0 -8
- data/app/controllers/apps/plugins_front_controller.rb +0 -20
- data/app/controllers/camaleon_controller.rb +0 -116
- data/app/helpers/html_helper.rb +0 -118
- data/app/helpers/uploader_helper.rb +0 -214
- data/app/models/concerns/metas.rb +0 -136
- data/app/models/grid_template.rb +0 -15
- data/app/models/term_taxonomy.rb +0 -157
- data/app/models/user_role.rb +0 -139
- data/app/serializers/api/base_serializer.rb +0 -9
- data/app/serializers/api/v1/category_serializer.rb +0 -8
- data/app/views/admin/appearances/nav_menus/_custom_fields.html.erb +0 -6
- data/app/views/admin/appearances/nav_menus/_menu_form.html.erb +0 -32
- data/app/views/admin/appearances/widgets/main/form.html.erb +0 -27
- data/app/views/admin/appearances/widgets/main/index.html.erb +0 -69
- data/app/views/admin/categories/_form.html.erb +0 -42
- data/app/views/admin/comments/form.html.erb +0 -52
- data/app/views/admin/comments/index.html.erb +0 -41
- data/app/views/admin/comments/reply.html.erb +0 -196
- data/app/views/admin/installers/welcome.html.erb +0 -8
- data/app/views/admin/media/iframe.html.erb +0 -33
- data/app/views/admin/media/index.html.erb +0 -19
- data/app/views/admin/post_tags/index.html.erb +0 -74
- data/app/views/admin/posts/_filter_posts.html.erb +0 -6
- data/app/views/admin/posts/form.html.erb +0 -103
- data/app/views/admin/sessions/forgot.html.erb +0 -45
- data/app/views/admin/sessions/login.html.erb +0 -49
- data/app/views/admin/sessions/register.html.erb +0 -62
- data/app/views/admin/settings/custom_fields/fields/field_attrs.html.erb +0 -8
- data/app/views/admin/settings/custom_fields/form.html.erb +0 -248
- data/app/views/admin/settings/post_types/_form.html.erb +0 -93
- data/app/views/admin/settings/post_types/index.html.erb +0 -72
- data/app/views/admin/settings/site.html.erb +0 -188
- data/app/views/admin/settings/sites/index.html.erb +0 -55
- data/app/views/admin/taxonomy/_form.html.erb +0 -62
- data/app/views/admin/taxonomy/edit.html.erb +0 -18
- data/app/views/admin/taxonomy/index.html.erb +0 -79
- data/app/views/admin/user_roles/form.html.erb +0 -167
- data/app/views/admin/user_roles/index.html.erb +0 -48
- data/app/views/admin/users/form.html.erb +0 -306
- data/app/views/admin/users/index.html.erb +0 -53
- data/app/views/admin/users/profile.html.erb +0 -118
- data/app/views/admin/users/profile_edit.html.erb +0 -312
- data/app/views/default_theme/admin/settings.html.erb +0 -1
- data/app/views/default_theme/partials/_comments.html.erb +0 -33
- data/app/views/default_theme/robots.text.erb +0 -1
- data/app/views/layouts/admin.html.erb +0 -56
- data/app/views/layouts/admin/_ajax.html.erb +0 -2
- data/app/views/layouts/admin/_sidebar.html.erb +0 -22
- data/app/views/shortcode_templates/form.html.erb +0 -1
- data/config/initializers/cache_helper.rb +0 -17
- data/config/initializers/doorkeeper.rb +0 -128
- data/config/initializers/elfinder.rb +0 -63
- data/config/initializers/page_caching.rb +0 -42
- data/config/initializers/rufus_cron.rb +0 -33
- data/config/initializers/swagger.rb +0 -18
- data/config/locales/admin/en.yml +0 -618
- data/config/locales/admin/es.yml +0 -584
- data/config/locales/admin/it.yml +0 -605
- data/config/locales/admin/js.yml +0 -118
- data/config/locales/common.yml +0 -189
- data/config/locales/doorkeeper.en.yml +0 -123
- data/db/migrate/20150930115030_doorkeeper_configuration.rb +0 -45
- data/lib/generators/camaleon_cms/install_template/apps/plugins/readme.txt +0 -1
- data/lib/generators/camaleon_cms/install_template/apps/themes/readme.txt +0 -1
- data/lib/generators/cplugin_generator.rb +0 -82
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/admin_controller.rb +0 -8
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/assets/css/readme.txt +0 -1
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/assets/images/readme.txt +0 -1
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/assets/js/readme.txt +0 -1
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/config/config.json +0 -21
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/config/locales/readme.txt +0 -1
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/config/routes_admin.txt +0 -1
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/config/routes_front.txt +0 -1
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/front_controller.rb +0 -8
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/main_helper.rb +0 -22
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/models/my_plugin.rb +0 -7
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/views/admin/index.html.erb +0 -2
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/views/front/index.html.erb +0 -2
- data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/views/layouts/readme.txt +0 -2
- data/lib/generators/ctheme_generator.rb +0 -65
- data/lib/tasks/camaleon_cms_tasks.rake +0 -23
- data/lib/tasks/precompile_overrides.rake +0 -6
data/config/routes/frontend.rb
CHANGED
@@ -1,35 +1,47 @@
|
|
1
1
|
Rails.application.routes.draw do
|
2
|
-
scope "
|
3
|
-
|
4
|
-
|
5
|
-
controller :frontend do
|
6
|
-
PluginRoutes.all_locales.split("|").each do |_l|
|
7
|
-
get "#{I18n.t("routes.group", default: "group", locale: _l)}/:post_type_id-:title" => :post_type, as: "post_type_#{_l}", constraints: {post_type_id: /[0-9]+/}
|
8
|
-
get "#{I18n.t("routes.category", default: "category", locale: _l)}/:category_id-:title" => :category, as: "category_#{_l}", constraints: {category_id: /[0-9]+/}
|
9
|
-
get "#{I18n.t("routes.tag", default: "tag", locale: _l)}/:post_tag_id-:title" => :post_tag, as: "post_tag_#{_l}", constraints: {post_tag_id: /[0-9]+/}
|
10
|
-
get "#{I18n.t("routes.profile", default: "profile", locale: _l)}/:user_id-:user_name" => :profile, constraints: {user_id: /[0-9]+/}, as: "profile_#{_l}"
|
11
|
-
get "#{I18n.t("routes.search", default: "search", locale: _l)}" => :search, as: "search_#{_l}"
|
12
|
-
end
|
2
|
+
scope PluginRoutes.system_info["relative_url_root"], as: "cama" do
|
3
|
+
scope "(:locale)", locale: /#{PluginRoutes.all_locales}/, :defaults => { } do
|
4
|
+
root 'camaleon_cms/frontend#index'
|
13
5
|
|
14
|
-
|
15
|
-
|
16
|
-
|
6
|
+
controller "camaleon_cms/frontend" do
|
7
|
+
PluginRoutes.all_locales.split("|").each do |_l|
|
8
|
+
get "#{I18n.t("routes.group", default: "group", locale: _l)}/:post_type_id-:title" => :post_type, as: "post_type_#{_l}", constraints: {post_type_id: /[0-9]+/}
|
9
|
+
get "#{I18n.t("routes.group", default: "group", locale: _l)}/:post_type_id-:title/:slug" => :post, as: "post_of_post_type_#{_l}", constraints: {post_type_id: /[0-9]+/}
|
17
10
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
post 'save_form' => :save_form, as: :save_form
|
11
|
+
get "#{I18n.t("routes.category", default: "category", locale: _l)}/:category_id-:title" => :category, as: "category_#{_l}", constraints: {category_id: /[0-9]+/}
|
12
|
+
get "#{I18n.t("routes.category", default: "category", locale: _l)}/:category_id-:title/:slug" => :post, as: "post_of_category_#{_l}", constraints: {category_id: /[0-9]+/}
|
13
|
+
get ":post_type_title/#{I18n.t("routes.category", default: "category", locale: _l)}/:category_id-:title/:slug" => :post, as: "post_of_category_post_type_#{_l}", constraints:{ post_type_title: /(?!(#{PluginRoutes.all_locales}))[\w]+/, category_id: /[0-9]+/ }
|
22
14
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
15
|
+
get "#{I18n.t("routes.tag", default: "tag", locale: _l)}/:post_tag_id-:title" => :post_tag, as: "post_tag_#{_l}", constraints: {post_tag_id: /[0-9]+/}
|
16
|
+
get "#{I18n.t("routes.tag", default: "tag", locale: _l)}/:post_tag_id-:title/:slug" => :post, as: "post_of_tag_#{_l}", constraints: {post_tag_id: /[0-9]+/}
|
17
|
+
|
18
|
+
get "#{I18n.t("routes.profile", default: "profile", locale: _l)}/:user_id-:user_name" => :profile, constraints: {user_id: /[0-9]+/}, as: "profile_#{_l}"
|
19
|
+
get "#{I18n.t("routes.search", default: "search", locale: _l)}" => :search, as: "search_#{_l}"
|
20
|
+
end
|
29
21
|
|
30
|
-
|
22
|
+
get "profile/:user_id-:user_name" => :profile, as: :profile, constraints: {user_id: /[0-9]+/}
|
23
|
+
get 'search' => :search, as: :search
|
24
|
+
get ':post_type_title/:slug' => :post, as: :post_of_posttype, constraints:{ post_type_title: /(?!(#{PluginRoutes.all_locales}))[\w]+/ }
|
25
|
+
|
26
|
+
post 'save_comment/:post_id' => :save_comment, as: :save_comment
|
27
|
+
post 'save_form' => :save_form, as: :save_form
|
28
|
+
|
29
|
+
# sitemap
|
30
|
+
get "sitemap" => :sitemap, as: :sitemap, defaults: { format: :xml }
|
31
|
+
get "robots" => :robots, as: :robots, defaults: { format: :txt }
|
32
|
+
get "rss", defaults: { format: "rss" }
|
33
|
+
get "ajax"
|
34
|
+
end
|
31
35
|
|
32
|
-
|
33
|
-
|
36
|
+
get ":slug" => 'camaleon_cms/frontend#post', format: true, :as => :post1, defaults: { format: :html }, constraints: { slug: /(?!admin)[a-zA-Z0-9\._=\s\-]+/}
|
37
|
+
get ":slug" => 'camaleon_cms/frontend#post', :as => :post, constraints: { slug: /(?!admin)[a-zA-Z0-9\._=\s\-]+/}
|
38
|
+
end
|
34
39
|
end
|
40
|
+
|
41
|
+
scope PluginRoutes.system_info["relative_url_root"] do
|
42
|
+
scope "(:locale)", locale: /#{PluginRoutes.all_locales}/, :defaults => { } do
|
43
|
+
instance_eval(PluginRoutes.load("front"))
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
35
47
|
end
|
data/config/system.json
CHANGED
@@ -3,11 +3,13 @@
|
|
3
3
|
"hooks": { }, // system hooks
|
4
4
|
//"skip_format_url": true, // enable or disable .html extension in the urls.
|
5
5
|
"default_plugins": ["front_cache", "contact_form", "attack"], // Default plugins installed for each new site
|
6
|
-
"available_languages": ["es", "en", "fr", "zh", "de", "it", "
|
7
|
-
"admin_available_languages": ["en", "es", "it"], //Available languages for the admin panel
|
6
|
+
"available_languages": ["es", "en", "fr", "zh", "de", "it", "pt_br"], // Available languages for frontend panel, here all locales: https://github.com/svenfuchs/rails-i18n
|
7
|
+
"admin_available_languages": ["en", "es", "it", "pt_br"], //Available languages for the admin panel
|
8
8
|
"base_domain": "localhost:3000", // primary domain
|
9
9
|
"default_user_role": "client", // default user role for all new users
|
10
|
-
"users_share_sites": true //(boolean) true: permit to share users between sites, false: All users are assigned for an unique site.
|
10
|
+
"users_share_sites": true, //(boolean) true: permit to share users between sites, false: All users are assigned for an unique site.
|
11
|
+
"db_prefix": "", // prefix name for database tables
|
12
|
+
"relative_url_root": "" // URL prefix, for example to get http://localhost:3000/blog/, this should be "blog"
|
11
13
|
}
|
12
14
|
|
13
15
|
// Note: after any change in this file, you need to restart your server to apply changes.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class PostTableIntoUtf8 < ActiveRecord::Migration
|
2
2
|
def change
|
3
|
-
create_table "users" do |t|
|
3
|
+
create_table "#{PluginRoutes.static_system_info["db_prefix"]}users" do |t|
|
4
4
|
t.string "username", index: true
|
5
5
|
t.string "role", default: "client", index: true
|
6
6
|
t.string "email", index: true
|
@@ -13,11 +13,11 @@ class PostTableIntoUtf8 < ActiveRecord::Migration
|
|
13
13
|
t.datetime "last_login_at"
|
14
14
|
|
15
15
|
# t.integer "site_id", default: -1, index: true
|
16
|
-
t.timestamps
|
16
|
+
t.timestamps null: false
|
17
17
|
t.belongs_to :site, index: true, default: -1#, foreign_key: true
|
18
18
|
end
|
19
19
|
|
20
|
-
create_table "term_taxonomy" do |t|
|
20
|
+
create_table "#{PluginRoutes.static_system_info["db_prefix"]}term_taxonomy" do |t|
|
21
21
|
t.string "taxonomy", index: true
|
22
22
|
t.text "description", limit: 1073741823
|
23
23
|
t.integer "parent_id", index: true
|
@@ -28,11 +28,11 @@ class PostTableIntoUtf8 < ActiveRecord::Migration
|
|
28
28
|
t.integer "term_order", index: true
|
29
29
|
t.string "status"
|
30
30
|
|
31
|
-
t.timestamps
|
31
|
+
t.timestamps null: false
|
32
32
|
t.belongs_to :user, index: true#, foreign_key: true
|
33
33
|
end
|
34
34
|
|
35
|
-
create_table "posts" do |t|
|
35
|
+
create_table "#{PluginRoutes.static_system_info["db_prefix"]}posts" do |t|
|
36
36
|
t.string "title"
|
37
37
|
t.string "slug", index: true
|
38
38
|
t.text "content", limit: 1073741823
|
@@ -45,17 +45,17 @@ class PostTableIntoUtf8 < ActiveRecord::Migration
|
|
45
45
|
t.text "visibility_value"
|
46
46
|
t.string "post_class", default: "Post", index: true
|
47
47
|
|
48
|
-
t.timestamps
|
48
|
+
t.timestamps null: false
|
49
49
|
t.belongs_to :user, index: true#, foreign_key: true
|
50
50
|
end
|
51
51
|
|
52
|
-
create_table "term_relationships" do |t|
|
52
|
+
create_table "#{PluginRoutes.static_system_info["db_prefix"]}term_relationships" do |t|
|
53
53
|
t.integer "objectid", index: true
|
54
54
|
t.integer "term_order", index: true
|
55
55
|
t.belongs_to :term_taxonomy, index: true
|
56
56
|
end
|
57
57
|
|
58
|
-
create_table "user_relationships" do |t|
|
58
|
+
create_table "#{PluginRoutes.static_system_info["db_prefix"]}user_relationships" do |t|
|
59
59
|
t.integer "term_order"
|
60
60
|
t.integer "active", default: 1
|
61
61
|
|
@@ -63,7 +63,7 @@ class PostTableIntoUtf8 < ActiveRecord::Migration
|
|
63
63
|
t.belongs_to :user, index: true
|
64
64
|
end
|
65
65
|
|
66
|
-
create_table "comments" do |t|
|
66
|
+
create_table "#{PluginRoutes.static_system_info["db_prefix"]}comments" do |t|
|
67
67
|
t.string "author"
|
68
68
|
t.string "author_email"
|
69
69
|
t.string "author_url"
|
@@ -75,10 +75,10 @@ class PostTableIntoUtf8 < ActiveRecord::Migration
|
|
75
75
|
t.integer "comment_parent", index: true
|
76
76
|
t.belongs_to :post, index: true#, foreign_key: true
|
77
77
|
t.belongs_to :user, index: true#, foreign_key: true
|
78
|
-
t.timestamps
|
78
|
+
t.timestamps null: false
|
79
79
|
end
|
80
80
|
|
81
|
-
create_table "custom_fields" do |t|
|
81
|
+
create_table "#{PluginRoutes.static_system_info["db_prefix"]}custom_fields" do |t|
|
82
82
|
t.string "object_class", index: true
|
83
83
|
t.string "name"
|
84
84
|
t.string "slug", index: true
|
@@ -91,7 +91,7 @@ class PostTableIntoUtf8 < ActiveRecord::Migration
|
|
91
91
|
t.string "status"
|
92
92
|
end
|
93
93
|
|
94
|
-
create_table "custom_fields_relationships" do |t|
|
94
|
+
create_table "#{PluginRoutes.static_system_info["db_prefix"]}custom_fields_relationships" do |t|
|
95
95
|
t.integer "objectid", index: true
|
96
96
|
t.integer "custom_field_id", index: true
|
97
97
|
t.integer "term_order"
|
@@ -100,7 +100,7 @@ class PostTableIntoUtf8 < ActiveRecord::Migration
|
|
100
100
|
t.string "custom_field_slug", index: true
|
101
101
|
end
|
102
102
|
|
103
|
-
create_table "metas" do |t|
|
103
|
+
create_table "#{PluginRoutes.static_system_info["db_prefix"]}metas" do |t|
|
104
104
|
t.string "key", index: true
|
105
105
|
t.text "value", limit: 1073741823
|
106
106
|
t.integer "objectid", index: true
|
@@ -108,8 +108,8 @@ class PostTableIntoUtf8 < ActiveRecord::Migration
|
|
108
108
|
end
|
109
109
|
|
110
110
|
if ActiveRecord::Base.connection.adapter_name.downcase.include?("mysql")
|
111
|
-
ActiveRecord::Base.connection.execute "ALTER TABLE posts CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" rescue nil
|
112
|
-
ActiveRecord::Base.connection.execute "ALTER TABLE custom_fields_relationships CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" rescue nil
|
111
|
+
ActiveRecord::Base.connection.execute "ALTER TABLE #{PluginRoutes.static_system_info["db_prefix"]}posts CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" rescue nil
|
112
|
+
ActiveRecord::Base.connection.execute "ALTER TABLE #{PluginRoutes.static_system_info["db_prefix"]}custom_fields_relationships CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" rescue nil
|
113
113
|
end
|
114
114
|
end
|
115
115
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# change post structure to optimize query speed
|
2
2
|
class RenameColumnPosts < ActiveRecord::Migration
|
3
3
|
def change
|
4
|
-
remove_column
|
5
|
-
add_column
|
6
|
-
add_column
|
7
|
-
Post.all.each do |post|
|
4
|
+
remove_column "#{PluginRoutes.static_system_info["db_prefix"]}posts", :comment_count
|
5
|
+
add_column "#{PluginRoutes.static_system_info["db_prefix"]}posts", :post_order, :integer, default: 0
|
6
|
+
add_column "#{PluginRoutes.static_system_info["db_prefix"]}posts", :taxonomy_id, :integer, default: nil, index: true
|
7
|
+
CamaleonCms::Post.all.each do |post|
|
8
8
|
begin
|
9
9
|
post_id = post.get_post_type_depre.id
|
10
10
|
post.update_column("taxonomy_id", post_id)
|
data/lib/camaleon_cms/engine.rb
CHANGED
@@ -1,21 +1,15 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require 'actionpack/page_caching'
|
3
2
|
require 'bcrypt'
|
4
3
|
require 'cancancan'
|
5
4
|
require 'draper'
|
6
|
-
require 'dynamic_sitemaps'
|
7
|
-
require 'el_finder'
|
8
5
|
require 'meta-tags'
|
9
6
|
require 'mini_magick'
|
10
7
|
require 'mobu'
|
11
8
|
require 'protected_attributes'
|
12
|
-
require 'rufus-scheduler'
|
13
9
|
require 'will_paginate'
|
14
10
|
require 'will_paginate-bootstrap'
|
15
|
-
require '
|
16
|
-
require '
|
17
|
-
require 'swagger/docs'
|
18
|
-
require 'active_model_serializers'
|
11
|
+
require 'breadcrumbs_on_rails'
|
12
|
+
require 'fog'
|
19
13
|
|
20
14
|
$camaleon_engine_dir = File.expand_path("../../../", __FILE__)
|
21
15
|
require File.join($camaleon_engine_dir, "lib", "plugin_routes").to_s
|
@@ -27,7 +21,7 @@ module CamaleonCms
|
|
27
21
|
app.console do
|
28
22
|
puts "******** Camaleon CMS: To use custom models and helpers of installed plugins, write this: ********"
|
29
23
|
puts "- include SiteHelper"
|
30
|
-
puts "- site_console_switch(Site.first.decorate)"
|
24
|
+
puts "- site_console_switch(CamaleonCms::Site.first.decorate)"
|
31
25
|
end
|
32
26
|
end
|
33
27
|
end
|
@@ -45,6 +39,9 @@ module CamaleonCms
|
|
45
39
|
app.config.assets.paths << File.join($camaleon_engine_dir, 'app', 'assets', 'fonts')
|
46
40
|
app.config.encoding = "utf-8"
|
47
41
|
|
42
|
+
# add prefix url, like: http://localhost.com/blog/
|
43
|
+
# config.action_controller.relative_url_root = PluginRoutes.system_info["relative_url_root"] if PluginRoutes.system_info["relative_url_root"].present?
|
44
|
+
|
48
45
|
#multiple route files
|
49
46
|
app.routes_reloader.paths.push(File.join(engine_dir, "config", "routes", "admin.rb"))
|
50
47
|
app.routes_reloader.paths.push(File.join(engine_dir, "config", "routes", "frontend.rb"))
|
data/lib/camaleon_cms/version.rb
CHANGED
data/lib/ext/string.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
class String
|
2
|
-
|
3
|
-
|
4
2
|
def to_bool
|
5
3
|
return true if self == true || self =~ (/(true|t|yes|y|1)$/i)
|
6
4
|
return false if self == false || self.blank? || self =~ (/(false|f|no|n|0)$/i)
|
@@ -43,6 +41,7 @@ class String
|
|
43
41
|
def split_bar
|
44
42
|
self.split(',').map{|us_id| us_id.gsub('__','')}.uniq
|
45
43
|
end
|
44
|
+
|
46
45
|
def include_bar?(uid)
|
47
46
|
self.include?("__#{uid}__")
|
48
47
|
end
|
@@ -74,33 +73,8 @@ class String
|
|
74
73
|
quantity += tmp.slice(quantity, tmp.length).to_s.index(" ").nil? ? tmp.length : tmp.slice(quantity, tmp.length).to_s.index(" ")
|
75
74
|
tmp.slice(0, quantity)
|
76
75
|
end
|
77
|
-
|
78
|
-
def strip_stopwords(language = "es")
|
79
|
-
if language == "en"
|
80
|
-
words = ["a", "about", "above", "above", "across", "after", "afterwards", "again", "against", "all", "almost", "alone", "along", "already", "also","although","always","am","among", "amongst", "amoungst", "amount", "an", "and", "another", "any","anyhow","anyone","anything","anyway", "anywhere", "are", "around", "as", "at", "back","be","became", "because","become","becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "bill", "both", "bottom","but", "by", "call", "can", "cannot", "cant", "co", "con", "could", "couldnt", "cry", "de", "describe", "detail", "do", "done", "down", "due", "during", "each", "eg", "eight", "either", "eleven","else", "elsewhere", "empty", "enough", "etc", "even", "ever", "every", "everyone", "everything", "everywhere", "except", "few", "fifteen", "fify", "fill", "find", "fire", "first", "five", "for", "former", "formerly", "forty", "found", "four", "from", "front", "full", "further", "get", "give", "go", "had", "has", "hasnt", "have", "he", "hence", "her", "here", "hereafter", "hereby", "herein", "hereupon", "hers", "herself", "him", "himself", "his", "how", "however", "hundred", "ie", "if", "in", "inc", "indeed", "interest", "into", "is", "it", "its", "itself", "keep", "last", "latter", "latterly", "least", "less", "ltd", "made", "many", "may", "me", "meanwhile", "might", "mill", "mine", "more", "moreover", "most", "mostly", "move", "much", "must", "my", "myself", "name", "namely", "neither", "never", "nevertheless", "next", "nine", "no", "nobody", "none", "noone", "nor", "not", "nothing", "now", "nowhere", "of", "off", "often", "on", "once", "one", "only", "onto", "or", "other", "others", "otherwise", "our", "ours", "ourselves", "out", "over", "own","part", "per", "perhaps", "please", "put", "rather", "re", "same", "see", "seem", "seemed", "seeming", "seems", "serious", "several", "she", "should", "show", "side", "since", "sincere", "six", "sixty", "so", "some", "somehow", "someone", "something", "sometime", "sometimes", "somewhere", "still", "such", "system", "take", "ten", "than", "that", "the", "their", "them", "themselves", "then", "thence", "there", "thereafter", "thereby", "therefore", "therein", "thereupon", "these", "they", "thickv", "thin", "third", "this", "those", "though", "three", "through", "throughout", "thru", "thus", "to", "together", "too", "top", "toward", "towards", "twelve", "twenty", "two", "un", "under", "until", "up", "upon", "us", "very", "via", "was", "we", "well", "were", "what", "whatever", "when", "whence", "whenever", "where", "whereafter", "whereas", "whereby", "wherein", "whereupon", "wherever", "whether", "which", "while", "whither", "who", "whoever", "whole", "whom", "whose", "why", "will", "with", "within", "without", "would", "yet", "you", "your", "yours", "yourself", "yourselves", "the"]
|
81
|
-
else
|
82
|
-
words = ["un", "una", "unas", "unos", "uno", "sobre", "todo", "tambien", "tras", "otro", "algun", "alguno", "alguna", "algunos", "algunas", "ser", "es", "soy", "eres", "somos", "sois", "estoy", "esta", "estamos", "estais", "estan", "como", "en", "para", "atras", "porque", "por", "que", "estado", "estaba", "ante", "antes", "siendo", "ambos", "pero", "por", "poder", "puede", "puedo", "podemos", "podeis", "pueden", "fui", "fue", "fuimos", "fueron", "hacer", "hago", "hace", "hacemos", "haceis", "hacen", "cada", "fin", "incluso", "primero", "desde", "conseguir", "consigo", "consigue", "consigues", "conseguimos", "consiguen", "ir", "voy", "va", "vamos", "vais", "van", "vaya", "gueno", "ha", "tener", "tengo", "tiene", "tenemos", "teneis", "tienen", "el", "la", "lo", "las", "los", "su", "aqui", "mio", "tuyo", "ellos", "ellas", "nos", "nosotros", "vosotros", "vosotras", "si", "dentro", "solo", "solamente", "saber", "sabes", "sabe", "sabemos", "sabeis", "saben", "ultimo", "largo", "bastante", "haces", "muchos", "aquellos", "aquellas", "sus", "entonces", "tiempo", "verdad", "verdadero", "verdadera", "cierto", "ciertos", "cierta", "ciertas", "intentar", "intento", "intenta", "intentas", "intentamos", "intentais", "intentan", "dos", "bajo", "arriba", "encima", "usar", "uso", "usas", "usa", "usamos", "usais", "usan", "emplear", "empleo", "empleas", "emplean", "ampleamos", "empleais", "valor", "muy", "era", "eras", "eramos", "eran", "modo", "bien", "cual", "cuando", "donde", "mientras", "quien", "con", "entre", "sin", "trabajo", "trabajar", "trabajas", "trabaja", "trabajamos", "trabajais", "trabajan", "podria", "podrias", "podriamos", "podrian", "podriais", "yo", "aquel"]
|
83
|
-
end
|
84
|
-
|
85
|
-
tmp_self = self.strip
|
86
|
-
res = tmp_self.split(" ").delete_if { |s| words.include?(s) }
|
87
|
-
return tmp_self if res.blank?
|
88
|
-
return res.uniq.join(" ")
|
89
|
-
end
|
90
|
-
def strip_stopwords2(language = "es")
|
91
|
-
if language == "en"
|
92
|
-
words = ["a", "about", "above", "above", "across", "after", "afterwards", "again", "against", "all", "almost", "alone", "along", "already", "also","although","always","am","among", "amongst", "amoungst", "amount", "an", "and", "another", "any","anyhow","anyone","anything","anyway", "anywhere", "are", "around", "as", "at", "back","be","became", "because","become","becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "bill", "both", "bottom","but", "by", "call", "can", "cannot", "cant", "co", "con", "could", "couldnt", "cry", "de", "describe", "detail", "do", "done", "down", "due", "during", "each", "eg", "eight", "either", "eleven","else", "elsewhere", "empty", "enough", "etc", "even", "ever", "every", "everyone", "everything", "everywhere", "except", "few", "fifteen", "fify", "fill", "find", "fire", "first", "five", "for", "former", "formerly", "forty", "found", "four", "from", "front", "full", "further", "get", "give", "go", "had", "has", "hasnt", "have", "he", "hence", "her", "here", "hereafter", "hereby", "herein", "hereupon", "hers", "herself", "him", "himself", "his", "how", "however", "hundred", "ie", "if", "in", "inc", "indeed", "interest", "into", "is", "it", "its", "itself", "keep", "last", "latter", "latterly", "least", "less", "ltd", "made", "many", "may", "me", "meanwhile", "might", "mill", "mine", "more", "moreover", "most", "mostly", "move", "much", "must", "my", "myself", "name", "namely", "neither", "never", "nevertheless", "next", "nine", "no", "nobody", "none", "noone", "nor", "not", "nothing", "now", "nowhere", "of", "off", "often", "on", "once", "one", "only", "onto", "or", "other", "others", "otherwise", "our", "ours", "ourselves", "out", "over", "own","part", "per", "perhaps", "please", "put", "rather", "re", "same", "see", "seem", "seemed", "seeming", "seems", "serious", "several", "she", "should", "show", "side", "since", "sincere", "six", "sixty", "so", "some", "somehow", "someone", "something", "sometime", "sometimes", "somewhere", "still", "such", "system", "take", "ten", "than", "that", "the", "their", "them", "themselves", "then", "thence", "there", "thereafter", "thereby", "therefore", "therein", "thereupon", "these", "they", "thickv", "thin", "third", "this", "those", "though", "three", "through", "throughout", "thru", "thus", "to", "together", "too", "top", "toward", "towards", "twelve", "twenty", "two", "un", "under", "until", "up", "upon", "us", "very", "via", "was", "we", "well", "were", "what", "whatever", "when", "whence", "whenever", "where", "whereafter", "whereas", "whereby", "wherein", "whereupon", "wherever", "whether", "which", "while", "whither", "who", "whoever", "whole", "whom", "whose", "why", "will", "with", "within", "without", "would", "yet", "you", "your", "yours", "yourself", "yourselves", "the"]
|
93
|
-
else
|
94
|
-
words = ["de","la","lo","del","un", "una", "unas", "unos", "uno", "sobre", "todo", "tambien", "tras", "otro", "algun", "alguno", "alguna", "algunos", "algunas", "ser", "es", "soy", "eres", "somos", "sois", "estoy", "esta", "estamos", "estais", "estan", "como", "en", "para", "atras", "porque", "por", "que", "estado", "estaba", "ante", "antes", "siendo", "ambos", "pero", "por", "poder", "puede", "puedo", "podemos", "podeis", "pueden", "fui", "fue", "fuimos", "fueron", "hacer", "hago", "hace", "hacemos", "haceis", "hacen", "cada", "fin", "incluso", "primero", "desde", "conseguir", "consigo", "consigue", "consigues", "conseguimos", "consiguen", "ir", "voy", "va", "vamos", "vais", "van", "vaya", "gueno", "ha", "tener", "tengo", "tiene", "tenemos", "teneis", "tienen", "el", "la", "lo", "las", "los", "su", "aqui", "mio", "tuyo", "ellos", "ellas", "nos", "nosotros", "vosotros", "vosotras", "si", "dentro", "solo", "solamente", "saber", "sabes", "sabe", "sabemos", "sabeis", "saben", "ultimo", "largo", "bastante", "haces", "muchos", "aquellos", "aquellas", "sus", "entonces", "tiempo", "verdad", "verdadero", "verdadera", "cierto", "ciertos", "cierta", "ciertas", "intentar", "intento", "intenta", "intentas", "intentamos", "intentais", "intentan", "dos", "bajo", "arriba", "encima", "usar", "uso", "usas", "usa", "usamos", "usais", "usan", "emplear", "empleo", "empleas", "emplean", "ampleamos", "empleais", "valor", "muy", "era", "eras", "eramos", "eran", "modo", "bien", "cual", "cuando", "donde", "mientras", "quien", "con", "entre", "sin", "trabajo", "trabajar", "trabajas", "trabaja", "trabajamos", "trabajais", "trabajan", "podria", "podrias", "podriamos", "podrian", "podriais", "yo", "aquel"]
|
95
|
-
end
|
96
|
-
|
97
|
-
tmp_self = self.strip
|
98
|
-
res = tmp_self.split(" ").delete_if { |s| words.include?(s) }
|
99
|
-
return tmp_self if res.blank?
|
100
|
-
return res.uniq.join(" ")
|
101
|
-
end
|
102
|
-
|
103
76
|
|
77
|
+
# parse string into slug format
|
104
78
|
def slug
|
105
79
|
#strip the string
|
106
80
|
ret = self.strip
|
@@ -120,23 +94,7 @@ class String
|
|
120
94
|
|
121
95
|
#strip off leading/trailing underscore
|
122
96
|
ret.gsub! /\A[_\.]+|[_\.]+\z/,""
|
123
|
-
|
124
|
-
return ret
|
125
|
-
end
|
126
|
-
|
127
|
-
# generate combinations
|
128
|
-
# generate alternative queries
|
129
|
-
def to_alt_query(qty_combination = 2, min_length = 2)
|
130
|
-
s = self.strip_stopwords("es").gsub(/\*|\+|-|~/, " ")
|
131
|
-
r = s.split(" ").clean_empty.uniq
|
132
|
-
r = r.delete_if {|s| s.size < 3 }
|
133
|
-
return s if r.size < min_length
|
134
|
-
|
135
|
-
res = []
|
136
|
-
r.combination(qty_combination).to_a.each do |i|
|
137
|
-
res << "(\"+#{i.join("+")}\")"
|
138
|
-
end
|
139
|
-
res.join(" ")
|
97
|
+
ret
|
140
98
|
end
|
141
99
|
|
142
100
|
# from a string path, this function get the filename
|
@@ -162,4 +120,11 @@ class String
|
|
162
120
|
"#{h}#{":#{uri.port}" unless [80, 443].include?(uri.port)}"
|
163
121
|
end
|
164
122
|
|
123
|
+
# return cleaned model class name
|
124
|
+
# remove decorate
|
125
|
+
# remove Cama prefix
|
126
|
+
def parseCamaClass
|
127
|
+
self.gsub("Decorator","").gsub("CamaleonCms::","")
|
128
|
+
end
|
129
|
+
|
165
130
|
end
|
data/lib/ext/translator.rb
CHANGED
@@ -50,8 +50,9 @@ 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})/) do |lang|
|
54
|
-
|
53
|
+
t.match(/^<!--:([\w]{2,5})/) do |lang|
|
54
|
+
lt = lang[1].sub("--", "")
|
55
|
+
translations_per_locale[lt.to_sym] = t.gsub(/<!--:#{lt}-->(.*)/, '\1')
|
55
56
|
end
|
56
57
|
end
|
57
58
|
translations_per_locale
|
@@ -8,93 +8,100 @@ module CamaleonCms
|
|
8
8
|
desc "This generator create all basic gem plugin structure."
|
9
9
|
|
10
10
|
def create_initializer_file
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
"
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
namespace '#{get_plugin_name}' do
|
71
|
-
get 'index' => 'admin#index'
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
# main routes
|
77
|
-
#scope '#{get_plugin_name}', module: 'plugins/#{get_plugin_name}/', as: '#{get_plugin_name}' do
|
78
|
-
# Here my routes for main routes
|
79
|
-
#end
|
80
|
-
end"
|
11
|
+
plugin_dir = Rails.root.join("apps", "plugins", get_plugin_name).to_s
|
12
|
+
if behavior == :revoke
|
13
|
+
FileUtils.rm_r(plugin_dir)
|
14
|
+
append_to_file Rails.root.join("Gemfile") do
|
15
|
+
"\n\ngem '#{get_plugin_name}', path: '#{plugin_dir}/'"
|
16
|
+
end
|
17
|
+
else
|
18
|
+
plugin_app = File.join($camaleon_engine_dir, "lib", "generators", "camaleon_cms", "gem_plugin_#{get_plugin_name}")
|
19
|
+
FileUtils.rm_r(plugin_app) if Dir.exist?(plugin_app)
|
20
|
+
|
21
|
+
FileUtils.mkdir_p(plugin_dir)
|
22
|
+
system("cd #{Rails.root}; rails plugin new apps/plugins/#{get_plugin_name} --full")
|
23
|
+
|
24
|
+
FileUtils.cp_r(File.join($camaleon_engine_dir, "lib", "generators", "camaleon_cms", "gem_plugin_template"), plugin_app)
|
25
|
+
|
26
|
+
# tmp copy
|
27
|
+
helper_path = File.join(plugin_app, "app", "helpers", "plugins", get_plugin_name)
|
28
|
+
model_path = File.join(plugin_app, "app", "models", "plugins", get_plugin_name)
|
29
|
+
views_path = File.join(plugin_app, "app", "views", "plugins", get_plugin_name)
|
30
|
+
controller_path = File.join(plugin_app, "app", "controllers", "plugins", get_plugin_name)
|
31
|
+
FileUtils.mv(File.join(plugin_app, "app", "controllers", "plugins", "my_plugin"), controller_path) rescue nil
|
32
|
+
FileUtils.mv(File.join(plugin_app, "app", "helpers", "plugins", "my_plugin"), helper_path) rescue nil
|
33
|
+
FileUtils.mv(File.join(plugin_app, "app", "models", "plugins", "my_plugin"), model_path) rescue nil
|
34
|
+
FileUtils.mv(File.join(plugin_app, "app", "views", "plugins", "my_plugin"), views_path) rescue nil
|
35
|
+
FileUtils.mv(File.join(plugin_app, "app", "assets", "images", "plugins", "my_plugin"), File.join(plugin_app, "app", "assets", "images", "plugins", get_plugin_name)) rescue nil
|
36
|
+
FileUtils.mv(File.join(plugin_app, "app", "assets", "javascripts", "plugins", "my_plugin"), File.join(plugin_app, "app", "assets", "javascripts", "plugins", get_plugin_name)) rescue nil
|
37
|
+
FileUtils.mv(File.join(plugin_app, "app", "assets", "stylesheets", "plugins", "my_plugin"), File.join(plugin_app, "app", "assets", "stylesheets", "plugins", get_plugin_name)) rescue nil
|
38
|
+
|
39
|
+
# configuration
|
40
|
+
t = fix_text(File.read(File.join(plugin_app, "config", "camaleon_plugin.json")))
|
41
|
+
File.open(File.join(plugin_app, "config", "camaleon_plugin.json"), "w"){|f| f << t }
|
42
|
+
|
43
|
+
# helper
|
44
|
+
t = fix_text(File.read(File.join(helper_path, "main_helper.rb")))
|
45
|
+
File.open(File.join(helper_path, "main_helper.rb"), "w"){|f| f << t }
|
46
|
+
|
47
|
+
# controllers
|
48
|
+
t = fix_text(File.read(File.join(controller_path, "admin_controller.rb")))
|
49
|
+
File.open(File.join(controller_path, "admin_controller.rb"), "w"){|f| f << t }
|
50
|
+
t = fix_text(File.read(File.join(controller_path, "front_controller.rb")))
|
51
|
+
File.open(File.join(controller_path, "front_controller.rb"), "w"){|f| f << t }
|
52
|
+
|
53
|
+
# models
|
54
|
+
model_file = File.join(model_path, "my_plugin.rb")
|
55
|
+
t = fix_text(File.read(model_file))
|
56
|
+
File.open(model_file, "w"){|f| f << t }
|
57
|
+
FileUtils.mv(model_file, File.join(File.dirname(model_file), "#{get_plugin_name}.rb")) rescue nil
|
58
|
+
|
59
|
+
|
60
|
+
directory(plugin_app, plugin_dir)
|
61
|
+
gsub_file File.join(plugin_dir, "config", "routes.rb"), "end" do
|
62
|
+
"
|
63
|
+
scope PluginRoutes.system_info[\"relative_url_root\"] do
|
64
|
+
scope '(:locale)', locale: /\#{PluginRoutes.all_locales}/, :defaults => { } do
|
65
|
+
# frontend
|
66
|
+
namespace :plugins do
|
67
|
+
namespace '#{get_plugin_name}' do
|
68
|
+
get 'index' => 'front#index'
|
69
|
+
end
|
81
70
|
end
|
71
|
+
end
|
82
72
|
|
83
|
-
|
84
|
-
|
73
|
+
#Admin Panel
|
74
|
+
scope 'admin', as: 'admin' do
|
75
|
+
namespace 'plugins' do
|
76
|
+
namespace '#{get_plugin_name}' do
|
77
|
+
get 'index' => 'admin#index'
|
78
|
+
end
|
85
79
|
end
|
80
|
+
end
|
86
81
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
82
|
+
# main routes
|
83
|
+
#scope '#{get_plugin_name}', module: 'plugins/#{get_plugin_name}/', as: '#{get_plugin_name}' do
|
84
|
+
# Here my routes for main routes
|
85
|
+
#end
|
86
|
+
end
|
87
|
+
end"
|
88
|
+
end
|
89
|
+
|
90
|
+
append_to_file Rails.root.join("Gemfile") do
|
91
|
+
"\n\ngem '#{get_plugin_name}', path: '#{plugin_dir}/'"
|
92
|
+
end
|
93
|
+
|
94
|
+
# destroy non used files
|
95
|
+
FileUtils.rm_r(plugin_app)
|
96
|
+
FileUtils.rm_r(File.join(plugin_dir, "app", "assets", "images", get_plugin_name))
|
97
|
+
FileUtils.rm_r(File.join(plugin_dir, "app", "assets", "javascripts", get_plugin_name))
|
98
|
+
FileUtils.rm_r(File.join(plugin_dir, "app", "assets", "stylesheets", get_plugin_name))
|
99
|
+
|
100
|
+
# remove TODO text from gem
|
101
|
+
gemspec_file = File.join(plugin_dir, "#{get_plugin_name}.gemspec")
|
102
|
+
t = File.read(gemspec_file).gsub("TODO", "")
|
103
|
+
File.open(gemspec_file, "w"){|f| f << t }
|
104
|
+
end
|
98
105
|
end
|
99
106
|
|
100
107
|
def fix_text(text = "")
|