keppler 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +6 -0
- data/README.md +43 -0
- data/Rakefile +2 -0
- data/bin/console +15 -0
- data/bin/keppler +5 -0
- data/bin/setup +7 -0
- data/installer/core/Gemfile +113 -0
- data/installer/core/Guardfile +18 -0
- data/installer/core/README.md +87 -0
- data/installer/core/Rakefile +6 -0
- data/installer/core/_config.yml +1 -0
- data/installer/core/app/assets/images/admin/favicon.png +0 -0
- data/installer/core/app/assets/images/admin/logo.png +0 -0
- data/installer/core/app/assets/images/admin/logo2.png +0 -0
- data/installer/core/app/assets/images/admin/profile-menu.jpg +0 -0
- data/installer/core/app/assets/images/admin/search.png +0 -0
- data/installer/core/app/assets/images/admin/slice-icon-orange.png +0 -0
- data/installer/core/app/assets/images/admin/slice-icon.png +0 -0
- data/installer/core/app/assets/images/admin/slice.png +0 -0
- data/installer/core/app/assets/images/admin/slice_white.png +0 -0
- data/installer/core/app/assets/images/admin/space.png +0 -0
- data/installer/core/app/assets/images/app/Home_Keppler.png +0 -0
- data/installer/core/app/assets/images/app/Home_Keppler2.png +0 -0
- data/installer/core/app/assets/images/app/keppler-front.png +0 -0
- data/installer/core/app/assets/images/app/slice-front.png +0 -0
- data/installer/core/app/assets/javascripts/admin/application.coffee +15 -0
- data/installer/core/app/assets/javascripts/admin/dropdown_top.js +7 -0
- data/installer/core/app/assets/javascripts/admin/file_upload.coffee +21 -0
- data/installer/core/app/assets/javascripts/admin/img_preview.js +18 -0
- data/installer/core/app/assets/javascripts/admin/main.coffee +42 -0
- data/installer/core/app/assets/javascripts/admin/notification.js +11 -0
- data/installer/core/app/assets/javascripts/admin/preview_template.js +21 -0
- data/installer/core/app/assets/javascripts/admin/sidebar.js +20 -0
- data/installer/core/app/assets/javascripts/admin/sort.coffee +8 -0
- data/installer/core/app/assets/javascripts/app/application.js.coffee +5 -0
- data/installer/core/app/assets/javascripts/app/front.js +129 -0
- data/installer/core/app/assets/javascripts/app/google_analytics.js.coffee +5 -0
- data/installer/core/app/assets/javascripts/ckeditor/config.js +130 -0
- data/installer/core/app/assets/javascripts/keppler_ga_dashboard/view-selector2.js +196 -0
- data/installer/core/app/assets/javascripts/vue_admin/index.js +87 -0
- data/installer/core/app/assets/stylesheets/admin/application.scss +43 -0
- data/installer/core/app/assets/stylesheets/admin/components/layouts/_footer.scss +5 -0
- data/installer/core/app/assets/stylesheets/admin/components/layouts/_settings.scss +35 -0
- data/installer/core/app/assets/stylesheets/admin/components/module/_show.scss +0 -0
- data/installer/core/app/assets/stylesheets/admin/components/navigation/_navbar.scss +79 -0
- data/installer/core/app/assets/stylesheets/admin/components/navigation/_sidebar.scss +91 -0
- data/installer/core/app/assets/stylesheets/admin/components/paginator/_paginator.scss +53 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_devise.scss +162 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_files.scss +83 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_form.scss +163 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_header.scss +34 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_index.scss +331 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_listing.scss +29 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_navbar.scss +36 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_pageslide.scss +125 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_preloader.scss +283 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_search.scss +220 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_show.scss +17 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_sidebar.scss +64 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_switchs.scss +47 -0
- data/installer/core/app/assets/stylesheets/admin/pages/_themes.scss +74 -0
- data/installer/core/app/assets/stylesheets/admin/utils/_base.scss +66 -0
- data/installer/core/app/assets/stylesheets/admin/utils/_mixins.scss +26 -0
- data/installer/core/app/assets/stylesheets/admin/utils/_theme.scss +94 -0
- data/installer/core/app/assets/stylesheets/admin/utils/_variables.scss +79 -0
- data/installer/core/app/assets/stylesheets/app/application.scss +29 -0
- data/installer/core/app/assets/stylesheets/app/base/_base_project.scss +17 -0
- data/installer/core/app/assets/stylesheets/app/base/_typography.scss +1 -0
- data/installer/core/app/assets/stylesheets/app/components/_buttons.scss +0 -0
- data/installer/core/app/assets/stylesheets/app/components/_inputs.scss +0 -0
- data/installer/core/app/assets/stylesheets/app/components/_navbar.scss +21 -0
- data/installer/core/app/assets/stylesheets/app/layout/_container.scss +0 -0
- data/installer/core/app/assets/stylesheets/app/layout/_footer.scss +15 -0
- data/installer/core/app/assets/stylesheets/app/layout/_header.scss +0 -0
- data/installer/core/app/assets/stylesheets/app/pages/_front.sass +58 -0
- data/installer/core/app/assets/stylesheets/app/plugins/_bootstrap_override.scss +37 -0
- data/installer/core/app/assets/stylesheets/app/plugins/_font_awesome.scss +2 -0
- data/installer/core/app/assets/stylesheets/app/plugins/_keppler.scss +54 -0
- data/installer/core/app/assets/stylesheets/app/plugins/_npogress.scss +2 -0
- data/installer/core/app/assets/stylesheets/app/utils/_mixins.scss +18 -0
- data/installer/core/app/assets/stylesheets/app/utils/_variables.scss +28 -0
- data/installer/core/app/assets/stylesheets/errors/application.scss +3 -0
- data/installer/core/app/assets/stylesheets/errors/errors.scss +120 -0
- data/installer/core/app/assets/stylesheets/vendor/admin-lte/_skin-blue.scss +141 -0
- data/installer/core/app/controllers/admin/admin_controller.rb +72 -0
- data/installer/core/app/controllers/admin/customizes_controller.rb +109 -0
- data/installer/core/app/controllers/admin/meta_tags_controller.rb +124 -0
- data/installer/core/app/controllers/admin/scripts_controller.rb +131 -0
- data/installer/core/app/controllers/admin/settings_controller.rb +111 -0
- data/installer/core/app/controllers/admin/users_controller.rb +119 -0
- data/installer/core/app/controllers/app/app_controller.rb +23 -0
- data/installer/core/app/controllers/app/front_controller.rb +10 -0
- data/installer/core/app/controllers/application_controller.rb +96 -0
- data/installer/core/app/controllers/devise/sessions_controller.rb +104 -0
- data/installer/core/app/controllers/errors_controller.rb +28 -0
- data/installer/core/app/helpers/admin_helper.rb +117 -0
- data/installer/core/app/helpers/application_helper.rb +21 -0
- data/installer/core/app/helpers/customizes_helper.rb +2 -0
- data/installer/core/app/helpers/fronts_helper.rb +2 -0
- data/installer/core/app/helpers/scaffolds_helper.rb +2 -0
- data/installer/core/app/inputs/checkbox_material_input.rb +75 -0
- data/installer/core/app/inputs/file_material_input.rb +33 -0
- data/installer/core/app/mailers/application_mailer.rb +28 -0
- data/installer/core/app/models/appearance.rb +5 -0
- data/installer/core/app/models/application_record.rb +3 -0
- data/installer/core/app/models/concerns/activity_history.rb +9 -0
- data/installer/core/app/models/concerns/clone_record.rb +12 -0
- data/installer/core/app/models/customize.rb +154 -0
- data/installer/core/app/models/front.rb +2 -0
- data/installer/core/app/models/google_analytics_setting.rb +4 -0
- data/installer/core/app/models/meta_tag.rb +41 -0
- data/installer/core/app/models/role.rb +11 -0
- data/installer/core/app/models/script.rb +30 -0
- data/installer/core/app/models/setting.rb +17 -0
- data/installer/core/app/models/smtp_setting.rb +5 -0
- data/installer/core/app/models/social_account.rb +4 -0
- data/installer/core/app/models/user.rb +44 -0
- data/installer/core/app/policies/application_policy.rb +16 -0
- data/installer/core/app/policies/controller_policy.rb +53 -0
- data/installer/core/app/policies/customize_policy.rb +9 -0
- data/installer/core/app/policies/meta_tag_policy.rb +9 -0
- data/installer/core/app/policies/script_policy.rb +9 -0
- data/installer/core/app/policies/setting_policy.rb +9 -0
- data/installer/core/app/policies/user_policy.rb +17 -0
- data/installer/core/app/uploaders/attachment_uploader.rb +44 -0
- data/installer/core/app/uploaders/ckeditor_attachment_file_uploader.rb +36 -0
- data/installer/core/app/uploaders/ckeditor_picture_uploader.rb +47 -0
- data/installer/core/app/uploaders/template_uploader.rb +44 -0
- data/installer/core/app/views/admin/customizes/_description.html.haml +13 -0
- data/installer/core/app/views/admin/customizes/_form.html.haml +33 -0
- data/installer/core/app/views/admin/customizes/_listing.html.haml +15 -0
- data/installer/core/app/views/admin/customizes/_switch_default_template.html.haml +16 -0
- data/installer/core/app/views/admin/customizes/_switch_template.html.haml +22 -0
- data/installer/core/app/views/admin/customizes/index.html.haml +38 -0
- data/installer/core/app/views/admin/customizes/new.html.haml +4 -0
- data/installer/core/app/views/admin/layouts/_footer.html.haml +8 -0
- data/installer/core/app/views/admin/layouts/_head.html.haml +8 -0
- data/installer/core/app/views/admin/layouts/_header.html.haml +7 -0
- data/installer/core/app/views/admin/layouts/_listing_preloader.haml +5 -0
- data/installer/core/app/views/admin/layouts/_messages.html.haml +4 -0
- data/installer/core/app/views/admin/layouts/_navigation.html.haml +46 -0
- data/installer/core/app/views/admin/layouts/_preloader.html.haml +9 -0
- data/installer/core/app/views/admin/layouts/_search.html.haml +8 -0
- data/installer/core/app/views/admin/layouts/_sidebar.html.haml +63 -0
- data/installer/core/app/views/admin/layouts/application.html.haml +23 -0
- data/installer/core/app/views/admin/layouts/index/remote_messages.js.haml +9 -0
- data/installer/core/app/views/admin/meta_tags/_description.html.haml +13 -0
- data/installer/core/app/views/admin/meta_tags/_form.html.haml +57 -0
- data/installer/core/app/views/admin/meta_tags/_index_show.html.haml +26 -0
- data/installer/core/app/views/admin/meta_tags/_listing.html.haml +39 -0
- data/installer/core/app/views/admin/meta_tags/edit.html.haml +2 -0
- data/installer/core/app/views/admin/meta_tags/index.html.haml +80 -0
- data/installer/core/app/views/admin/meta_tags/new.html.haml +2 -0
- data/installer/core/app/views/admin/meta_tags/reload.js.haml +5 -0
- data/installer/core/app/views/admin/meta_tags/show.html.haml +29 -0
- data/installer/core/app/views/admin/meta_tags/show.js.haml +4 -0
- data/installer/core/app/views/admin/scripts/_description.html.haml +13 -0
- data/installer/core/app/views/admin/scripts/_form.html.haml +31 -0
- data/installer/core/app/views/admin/scripts/_index_show.html.haml +26 -0
- data/installer/core/app/views/admin/scripts/_listing.html.haml +42 -0
- data/installer/core/app/views/admin/scripts/edit.html.haml +1 -0
- data/installer/core/app/views/admin/scripts/index.html.haml +82 -0
- data/installer/core/app/views/admin/scripts/new.html.haml +1 -0
- data/installer/core/app/views/admin/scripts/reload.js.haml +5 -0
- data/installer/core/app/views/admin/scripts/show.html.haml +29 -0
- data/installer/core/app/views/admin/scripts/show.js.haml +4 -0
- data/installer/core/app/views/admin/settings/_form.html.haml +9 -0
- data/installer/core/app/views/admin/settings/components/_preview.html.haml +30 -0
- data/installer/core/app/views/admin/settings/edit.html.haml +4 -0
- data/installer/core/app/views/admin/settings/fields/_appearance.html.haml +62 -0
- data/installer/core/app/views/admin/settings/fields/_basic_information.html.haml +48 -0
- data/installer/core/app/views/admin/settings/fields/_email_setting.html.haml +17 -0
- data/installer/core/app/views/admin/settings/fields/_google_analytics_setting.html.haml +28 -0
- data/installer/core/app/views/admin/settings/fields/_social_accounts.html.haml +42 -0
- data/installer/core/app/views/admin/users/_description.html.haml +13 -0
- data/installer/core/app/views/admin/users/_form.html.haml +59 -0
- data/installer/core/app/views/admin/users/_index_show.html.haml +24 -0
- data/installer/core/app/views/admin/users/_listing.html.haml +49 -0
- data/installer/core/app/views/admin/users/edit.html.haml +1 -0
- data/installer/core/app/views/admin/users/index.html.haml +72 -0
- data/installer/core/app/views/admin/users/new.html.haml +1 -0
- data/installer/core/app/views/admin/users/reload.js.haml +5 -0
- data/installer/core/app/views/admin/users/show.html.haml +36 -0
- data/installer/core/app/views/admin/users/show.js.haml +4 -0
- data/installer/core/app/views/app/front/index.html.haml +180 -0
- data/installer/core/app/views/app/layouts/_footer.html.haml +3 -0
- data/installer/core/app/views/app/layouts/_google_analytics.html.haml +14 -0
- data/installer/core/app/views/app/layouts/_head.html.haml +22 -0
- data/installer/core/app/views/app/layouts/_messages.html.haml +6 -0
- data/installer/core/app/views/app/layouts/_meta_tags.html.haml +9 -0
- data/installer/core/app/views/app/layouts/_navigation.html.haml +13 -0
- data/installer/core/app/views/app/layouts/_navigation_links.html.haml +6 -0
- data/installer/core/app/views/app/layouts/application.html.haml +10 -0
- data/installer/core/app/views/application_mailer/testing.html.haml +1 -0
- data/installer/core/app/views/devise/mailer/reset_password_instructions.html.haml +6 -0
- data/installer/core/app/views/devise/passwords/edit.html.haml +27 -0
- data/installer/core/app/views/devise/passwords/new.html.haml +22 -0
- data/installer/core/app/views/devise/registrations/edit.html.erb +48 -0
- data/installer/core/app/views/devise/registrations/new.html.erb +19 -0
- data/installer/core/app/views/devise/sessions/new.html.haml +30 -0
- data/installer/core/app/views/errors/internal_server_error.html.haml +7 -0
- data/installer/core/app/views/errors/not_authorized.html.haml +7 -0
- data/installer/core/app/views/errors/not_found.html.haml +7 -0
- data/installer/core/app/views/errors/unprocessable.html.haml +7 -0
- data/installer/core/app/views/kaminari/_first_page.html.haml +11 -0
- data/installer/core/app/views/kaminari/_gap.html.haml +8 -0
- data/installer/core/app/views/kaminari/_last_page.html.haml +11 -0
- data/installer/core/app/views/kaminari/_next_page.html.haml +11 -0
- data/installer/core/app/views/kaminari/_page.html.haml +10 -0
- data/installer/core/app/views/kaminari/_paginator.html.haml +18 -0
- data/installer/core/app/views/kaminari/_prev_page.html.haml +11 -0
- data/installer/core/app/views/keppler_ga_dashboard/dashboard/analytics.html.haml +600 -0
- data/installer/core/app/views/layouts/errors/_head.html.haml +3 -0
- data/installer/core/app/views/layouts/errors/application.html.haml +11 -0
- data/installer/core/app/views/layouts/mailers/mailer.html.haml +3 -0
- data/installer/core/app/views/layouts/mailers/mailer.text.haml +1 -0
- data/installer/core/app/views/layouts/templates/application.html.haml +1 -0
- data/installer/core/app/views/public_activity/layout/_create.html.haml +45 -0
- data/installer/core/app/views/public_activity/layout/_destroy.html.haml +15 -0
- data/installer/core/app/views/public_activity/layout/_update.html.haml +45 -0
- data/installer/core/app/views/public_activity/session/_create.html.haml +13 -0
- data/installer/core/app/views/public_activity/session/_destroy.html.haml +13 -0
- data/installer/core/app/views/templates/kaminari/_first_page.html.haml +9 -0
- data/installer/core/app/views/templates/kaminari/_gap.html.haml +8 -0
- data/installer/core/app/views/templates/kaminari/_last_page.html.haml +9 -0
- data/installer/core/app/views/templates/kaminari/_next_page.html.haml +9 -0
- data/installer/core/app/views/templates/kaminari/_page.html.haml +10 -0
- data/installer/core/app/views/templates/kaminari/_paginator.html.haml +18 -0
- data/installer/core/app/views/templates/kaminari/_prev_page.html.haml +9 -0
- data/installer/core/bin/bundle +3 -0
- data/installer/core/bin/rails +4 -0
- data/installer/core/bin/rake +4 -0
- data/installer/core/bin/setup +29 -0
- data/installer/core/bin/spring +15 -0
- data/installer/core/config.ru +4 -0
- data/installer/core/config/application.rb +46 -0
- data/installer/core/config/boot.rb +7 -0
- data/installer/core/config/database.yml +25 -0
- data/installer/core/config/environment.rb +10 -0
- data/installer/core/config/environments/development.rb +57 -0
- data/installer/core/config/environments/production.rb +105 -0
- data/installer/core/config/environments/test.rb +44 -0
- data/installer/core/config/gaAuth/gauth_key.p12 +0 -0
- data/installer/core/config/initializers/assets.rb +14 -0
- data/installer/core/config/initializers/cookies_serializer.rb +3 -0
- data/installer/core/config/initializers/date_formats.rb +2 -0
- data/installer/core/config/initializers/devise.rb +259 -0
- data/installer/core/config/initializers/filter_parameter_logging.rb +5 -0
- data/installer/core/config/initializers/inflections.rb +16 -0
- data/installer/core/config/initializers/keppler_configuration.rb +9 -0
- data/installer/core/config/initializers/mime_types.rb +6 -0
- data/installer/core/config/initializers/paginate_kaminari_configuration.rb +12 -0
- data/installer/core/config/initializers/rolify.rb +10 -0
- data/installer/core/config/initializers/route_traslator.rb +3 -0
- data/installer/core/config/initializers/session_store.rb +5 -0
- data/installer/core/config/initializers/simple_form.rb +170 -0
- data/installer/core/config/initializers/simple_form_bootstrap.rb +155 -0
- data/installer/core/config/initializers/time_formats.rb +2 -0
- data/installer/core/config/initializers/wrap_parameters.rb +15 -0
- data/installer/core/config/locales/devise.en.yml +61 -0
- data/installer/core/config/locales/devise.es.yml +62 -0
- data/installer/core/config/locales/en.yml +380 -0
- data/installer/core/config/locales/es.yml +420 -0
- data/installer/core/config/locales/routes.en.yml +4 -0
- data/installer/core/config/locales/routes.es.yml +5 -0
- data/installer/core/config/locales/simple_form.en.yml +45 -0
- data/installer/core/config/locales/simple_form.es.yml +95 -0
- data/installer/core/config/locales/social_share_button.es.yml +10 -0
- data/installer/core/config/menu.yml +53 -0
- data/installer/core/config/puma.rb +56 -0
- data/installer/core/config/routes.rb +94 -0
- data/installer/core/config/sitemap.rb +27 -0
- data/installer/core/config/spring.rb +6 -0
- data/installer/core/db/migrate/20140812203549_devise_create_users.rb +50 -0
- data/installer/core/db/migrate/20140812210925_rolify_create_roles.rb +19 -0
- data/installer/core/db/migrate/20151221173228_create_activities.rb +23 -0
- data/installer/core/db/migrate/20160122201215_create_settings.rb +15 -0
- data/installer/core/db/migrate/20160126141856_create_smtp_settings.rb +14 -0
- data/installer/core/db/migrate/20160128131802_create_scripts.rb +11 -0
- data/installer/core/db/migrate/20160128151351_create_google_analytics_settings.rb +12 -0
- data/installer/core/db/migrate/20160128193740_create_social_accounts.rb +25 -0
- data/installer/core/db/migrate/20160201134918_create_meta_tags.rb +13 -0
- data/installer/core/db/migrate/20160201210520_create_appearances.rb +11 -0
- data/installer/core/db/migrate/20170603145521_create_customizes.rb +10 -0
- data/installer/core/db/migrate/20171225023933_create_scaffolds.rb +10 -0
- data/installer/core/db/schema.rb +172 -0
- data/installer/core/db/seeds.rb +45 -0
- data/installer/core/lib/generators/keppler_front/keppler_front_generator.rb +139 -0
- data/installer/core/lib/generators/keppler_front/templates/controllers/controller.rb +17 -0
- data/installer/core/lib/generators/keppler_front/templates/views/template.html.haml +180 -0
- data/installer/core/lib/generators/keppler_relation/keppler_relation_generator.rb +219 -0
- data/installer/core/lib/generators/keppler_scaffold/keppler_scaffold_generator.rb +240 -0
- data/installer/core/lib/generators/keppler_scaffold/templates/controllers/controller.rb +143 -0
- data/installer/core/lib/generators/keppler_scaffold/templates/models/model.rb +41 -0
- data/installer/core/lib/generators/keppler_scaffold/templates/policies/policy.rb +9 -0
- data/installer/core/lib/generators/keppler_scaffold/templates/views/_description.html.haml +13 -0
- data/installer/core/lib/generators/keppler_scaffold/templates/views/_form.html.haml +60 -0
- data/installer/core/lib/generators/keppler_scaffold/templates/views/_index_show.html.haml +24 -0
- data/installer/core/lib/generators/keppler_scaffold/templates/views/_listing.html.haml +64 -0
- data/installer/core/lib/generators/keppler_scaffold/templates/views/edit.html.haml +1 -0
- data/installer/core/lib/generators/keppler_scaffold/templates/views/index.html.haml +97 -0
- data/installer/core/lib/generators/keppler_scaffold/templates/views/new.html.haml +1 -0
- data/installer/core/lib/generators/keppler_scaffold/templates/views/reload.js.haml +5 -0
- data/installer/core/lib/generators/keppler_scaffold/templates/views/show.html.haml +65 -0
- data/installer/core/lib/generators/keppler_scaffold/templates/views/show.js.haml +4 -0
- data/installer/core/lib/keppler_configuration.rb +12 -0
- data/installer/core/lib/templates/haml/scaffold/_form.html.haml +10 -0
- data/installer/core/plugins/keppler_ga_dashboard/Gemfile +15 -0
- data/installer/core/plugins/keppler_ga_dashboard/MIT-LICENSE +20 -0
- data/installer/core/plugins/keppler_ga_dashboard/README.md +51 -0
- data/installer/core/plugins/keppler_ga_dashboard/Rakefile +37 -0
- data/installer/core/plugins/keppler_ga_dashboard/app/assets/javascripts/keppler_ga_dashboard/active-users.js +64 -0
- data/installer/core/plugins/keppler_ga_dashboard/app/assets/javascripts/keppler_ga_dashboard/active-users.js.map +1 -0
- data/installer/core/plugins/keppler_ga_dashboard/app/assets/javascripts/keppler_ga_dashboard/dashboard.coffee +13 -0
- data/installer/core/plugins/keppler_ga_dashboard/app/assets/javascripts/keppler_ga_dashboard/date-range-selector.js +2 -0
- data/installer/core/plugins/keppler_ga_dashboard/app/assets/javascripts/keppler_ga_dashboard/date-range-selector.js.map +1 -0
- data/installer/core/plugins/keppler_ga_dashboard/app/assets/javascripts/keppler_ga_dashboard/view-selector2.js +196 -0
- data/installer/core/plugins/keppler_ga_dashboard/app/assets/javascripts/keppler_ga_dashboard/view-selector2.js.map +1 -0
- data/installer/core/plugins/keppler_ga_dashboard/app/assets/stylesheets/dashboard.scss +83 -0
- data/installer/core/plugins/keppler_ga_dashboard/app/controllers/keppler_ga_dashboard/dashboard_controller.rb +48 -0
- data/installer/core/plugins/keppler_ga_dashboard/app/helpers/keppler_ga_dashboard/application_helper.rb +4 -0
- data/installer/core/plugins/keppler_ga_dashboard/app/helpers/keppler_ga_dashboard/dashboard_helper.rb +14 -0
- data/installer/core/plugins/keppler_ga_dashboard/app/views/keppler_ga_dashboard/dashboard/analytics.html.haml +359 -0
- data/installer/core/plugins/keppler_ga_dashboard/bin/rails +12 -0
- data/installer/core/plugins/keppler_ga_dashboard/config/menu.yml +6 -0
- data/installer/core/plugins/keppler_ga_dashboard/config/routes.rb +3 -0
- data/installer/core/plugins/keppler_ga_dashboard/keppler_ga_dashboard.gemspec +22 -0
- data/installer/core/plugins/keppler_ga_dashboard/lib/keppler_ga_dashboard.rb +10 -0
- data/installer/core/plugins/keppler_ga_dashboard/lib/keppler_ga_dashboard/engine.rb +5 -0
- data/installer/core/plugins/keppler_ga_dashboard/lib/keppler_ga_dashboard/tasks/install.rb +58 -0
- data/installer/core/plugins/keppler_ga_dashboard/lib/keppler_ga_dashboard/version.rb +3 -0
- data/installer/core/plugins/keppler_ga_dashboard/lib/tasks/keppler_ga_dashboard_tasks.rake +13 -0
- data/installer/core/public/favicon.ico +0 -0
- data/installer/core/public/humans.txt +20 -0
- data/installer/core/public/robots.txt +5 -0
- data/installer/core/test/controllers/admin_controller_test.rb +11 -0
- data/installer/core/test/controllers/errors_controller_test.rb +24 -0
- data/installer/core/test/controllers/frontend_controller_test.rb +9 -0
- data/installer/core/test/controllers/fronts_controller_test.rb +49 -0
- data/installer/core/test/controllers/meta_tags_controller_test.rb +49 -0
- data/installer/core/test/controllers/scaffolds_controller_test.rb +49 -0
- data/installer/core/test/controllers/scripts_controller_test.rb +49 -0
- data/installer/core/test/controllers/settings_controller_test.rb +49 -0
- data/installer/core/test/controllers/users_controller_test.rb +18 -0
- data/installer/core/test/fixtures/appearances.yml +11 -0
- data/installer/core/test/fixtures/caches.yml +7 -0
- data/installer/core/test/fixtures/fronts.yml +7 -0
- data/installer/core/test/fixtures/google_adwords.yml +13 -0
- data/installer/core/test/fixtures/google_analytics_settings.yml +13 -0
- data/installer/core/test/fixtures/meta_tags.yml +13 -0
- data/installer/core/test/fixtures/roles.yml +11 -0
- data/installer/core/test/fixtures/scaffolds.yml +9 -0
- data/installer/core/test/fixtures/scripts.yml +11 -0
- data/installer/core/test/fixtures/settings.yml +13 -0
- data/installer/core/test/fixtures/smtp_settings.yml +17 -0
- data/installer/core/test/fixtures/social_accounts.yml +39 -0
- data/installer/core/test/fixtures/users.yml +10 -0
- data/installer/core/test/helpers/admin_helper_test.rb +4 -0
- data/installer/core/test/helpers/frontend_helper_test.rb +4 -0
- data/installer/core/test/mailers/application_mailer_test.rb +7 -0
- data/installer/core/test/mailers/previews/application_mailer_preview.rb +4 -0
- data/installer/core/test/models/apparence_test.rb +7 -0
- data/installer/core/test/models/cache_test.rb +7 -0
- data/installer/core/test/models/front_test.rb +7 -0
- data/installer/core/test/models/google_analytics_setting_test.rb +7 -0
- data/installer/core/test/models/meta_tag_test.rb +7 -0
- data/installer/core/test/models/role_test.rb +7 -0
- data/installer/core/test/models/scaffold_test.rb +7 -0
- data/installer/core/test/models/script_test.rb +7 -0
- data/installer/core/test/models/setting_test.rb +7 -0
- data/installer/core/test/models/smtp_setting_test.rb +7 -0
- data/installer/core/test/models/social_account_test.rb +7 -0
- data/installer/core/test/models/user_test.rb +7 -0
- data/installer/core/test/test_helper.rb +16 -0
- data/installer/core/vendor/assets/javascripts/bounce.min.js +5 -0
- data/installer/db_conf/conf.yml +50 -0
- data/installer/lib/conf.rb +31 -0
- data/installer/lib/scaffold.rb +10 -0
- data/installer/run.sh +19 -0
- data/installer/scripts/bin.sh +61 -0
- data/lib/keppler.rb +7 -0
- data/lib/keppler/cli.rb +12 -0
- data/lib/keppler/cli/generate.rb +19 -0
- data/lib/keppler/version.rb +3 -0
- metadata +497 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
<% if namespaced? -%>
|
2
|
+
require_dependency "<%= namespaced_file_path %>/application_controller"
|
3
|
+
<% end -%>
|
4
|
+
<% module_namespacing do -%>
|
5
|
+
module App
|
6
|
+
# <%= controller_class_name %>Controller
|
7
|
+
class FrontController < AppController
|
8
|
+
layout 'layouts/templates/application'
|
9
|
+
|
10
|
+
<%- attributes.each do |attribute| -%>
|
11
|
+
def <%= attribute.name %>
|
12
|
+
end
|
13
|
+
|
14
|
+
<%- end -%>
|
15
|
+
end
|
16
|
+
end
|
17
|
+
<% end -%>
|
@@ -0,0 +1,180 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%header
|
4
|
+
= render 'app/layouts/head'
|
5
|
+
%body
|
6
|
+
%header
|
7
|
+
= #render 'app/layouts/navigation'
|
8
|
+
%main#keppler{:role => "main"}
|
9
|
+
= #render 'app/layouts/messages'
|
10
|
+
.front
|
11
|
+
.front-logo
|
12
|
+
= image_tag "app/keppler-front.png", class: "img-responsive"
|
13
|
+
|
14
|
+
.front-social
|
15
|
+
%ul
|
16
|
+
%li
|
17
|
+
= link_to "https://twitter.com/slicegroupxyz", target: '_blank' do
|
18
|
+
= icon 'twitter'
|
19
|
+
%li
|
20
|
+
= link_to "https://www.facebook.com/slicegroupxyz/", target: '_blank' do
|
21
|
+
= icon 'facebook'
|
22
|
+
%li
|
23
|
+
= link_to "https://www.instagram.com/slicegroupxyz/", target: '_blank' do
|
24
|
+
= icon 'instagram'
|
25
|
+
%li
|
26
|
+
= link_to "https://github.com/SliceDevelopers", target: '_blank' do
|
27
|
+
= icon 'github'
|
28
|
+
.mouse-scroll
|
29
|
+
.mouse
|
30
|
+
.scroll
|
31
|
+
%footer.front-footer
|
32
|
+
= render 'app/layouts/footer'
|
33
|
+
|
34
|
+
|
35
|
+
%section#documentation
|
36
|
+
%h3 KEPPLER ADMIN
|
37
|
+
|
38
|
+
%p
|
39
|
+
KEPPLER ADMIN es una entorno de desarrollo que cuenta con una base de
|
40
|
+
gemas ya integradas, de tal forma que acelerará el desarrollo de
|
41
|
+
aplicaciones de vanguardia bajo la plataforma de Ruby on Rails.
|
42
|
+
|
43
|
+
%h3 Características
|
44
|
+
|
45
|
+
%ul
|
46
|
+
%li
|
47
|
+
Base de datos por defecto MySQL
|
48
|
+
%li
|
49
|
+
Integración para autenticación de usuarios con
|
50
|
+
= link_to 'Devise', 'https://github.com/plataformatec/devise', target: '_blank'
|
51
|
+
%li
|
52
|
+
Integración para roles de usuarios con
|
53
|
+
= link_to 'Rolify', 'https://github.com/RolifyCommunity/rolify', target: '_blank'
|
54
|
+
%li
|
55
|
+
Integración para autorizaciones con
|
56
|
+
= link_to 'CanCanCan', 'https://github.com/CanCanCommunity/cancancan', target: '_blank'
|
57
|
+
%li
|
58
|
+
Inegración para el manejo de de paginación con
|
59
|
+
= link_to 'Kaminari', 'https://github.com/amatsuda/kaminari', target: '_blank'
|
60
|
+
%li
|
61
|
+
Integración para helpers de formularios con
|
62
|
+
= link_to 'SimpleForm', 'https://github.com/RolifyCommunity/rolify', target: '_blank'
|
63
|
+
%li
|
64
|
+
Integración para búsquedas full-text con
|
65
|
+
= link_to 'Ransack', 'https://github.com/activerecord-hackery/ransack', target: '_blank'
|
66
|
+
%li
|
67
|
+
Integración con framework fronte-end para el administrativo con
|
68
|
+
= link_to 'Materialize', 'http://materializecss.com/', target: '_blank'
|
69
|
+
%li
|
70
|
+
Integración con framework javascript
|
71
|
+
= link_to 'AngularJs', 'https://angularjs.org/', target: '_blank'
|
72
|
+
%li
|
73
|
+
Integración sitemap dinamicos con
|
74
|
+
= link_to 'sitemap_generator', 'https://github.com/kjvarga/sitemap_generator', target: '_blank'
|
75
|
+
|
76
|
+
%h3 Instalación
|
77
|
+
|
78
|
+
%pre
|
79
|
+
%code.shell
|
80
|
+
git clone git@github.com:SliceDevelopers/keppler_admin.git
|
81
|
+
bundle install
|
82
|
+
|
83
|
+
%p
|
84
|
+
Luego debe configurar el archivo
|
85
|
+
%pre
|
86
|
+
%code.ruby
|
87
|
+
config/secrets.yml
|
88
|
+
= link_to '[ver archivo]', 'https://github.com/inyxtech/Keppler-CMS/blob/master/config/secrets.yml.example'
|
89
|
+
de esta manera puede añadir los parámetros de configuración de su base de datos y poder realizar migraciones.
|
90
|
+
|
91
|
+
%pre
|
92
|
+
%code.shell
|
93
|
+
rake db:create
|
94
|
+
rake db:migrate
|
95
|
+
rake db:seed
|
96
|
+
|
97
|
+
%h3 SimpleForm con Materialize
|
98
|
+
|
99
|
+
%p
|
100
|
+
Se ofrece una integración por defecto entre SimpleForm y Materialize, usted tiene la posibilidad de cambiar su funcionalidad en
|
101
|
+
%pre
|
102
|
+
%code.ruby
|
103
|
+
config/initializers/simple_form_materialize.rb
|
104
|
+
|
105
|
+
|
106
|
+
%p Aquí algunos ejemplos para la creación de inputs:
|
107
|
+
|
108
|
+
%pre
|
109
|
+
%code.haml
|
110
|
+
:preserve
|
111
|
+
# inputs de tipo text
|
112
|
+
= f.input :name
|
113
|
+
|
114
|
+
# inputs de tipo boolean
|
115
|
+
= f.input :public, as: :checkbox_material
|
116
|
+
|
117
|
+
# inputs de tipo textarea
|
118
|
+
= f.input :description, input_html: { class: "materialize-textarea" }
|
119
|
+
|
120
|
+
# inputs de tipo file
|
121
|
+
= f.input :image, :as => :file_material, label: false, wrapper_html: { class: "file-field" }
|
122
|
+
|
123
|
+
# inputs de tipo select
|
124
|
+
= f.input :role_ids, collection: Role.all, label: false, include_blank: "Selecione un rol"
|
125
|
+
|
126
|
+
# inputs de tipo radio buttons
|
127
|
+
= f.collection_radio_buttons :option, [['vegan', 'vegan'] ,['vegetarian', 'vegetarian']],:first, :last
|
128
|
+
|
129
|
+
# inputs de tipo check_boxes
|
130
|
+
= f.collection_check_boxes :options, [['vegan', 'vegan'] ,['vegetarian', 'vegetarian']],:first, :last
|
131
|
+
|
132
|
+
# inputs de tipo date
|
133
|
+
= f.input :date, input_html: {class: "datepicker"}
|
134
|
+
|
135
|
+
%strong
|
136
|
+
Nota:
|
137
|
+
%p
|
138
|
+
Puede revisar la documentación de
|
139
|
+
= link_to 'Materialize', 'http://materializecss.com/'
|
140
|
+
para agregar nuevas integraciones para sus formularios a través de los
|
141
|
+
= link_to 'Wrappers', 'https://github.com/plataformatec/simple_form/wiki/Custom-Wrappers'
|
142
|
+
de simpleform.
|
143
|
+
|
144
|
+
|
145
|
+
%h3 Keppler scaffolds
|
146
|
+
|
147
|
+
%p
|
148
|
+
Keppler ofrece la posibilidad de realizar tareas de scaffolds
|
149
|
+
totalmente configurados para adaptarse de una vez al administrativo.
|
150
|
+
Para crear un nuevo modulo solo tienes que llamar al siguiente
|
151
|
+
comando desde la consola:
|
152
|
+
|
153
|
+
%pre
|
154
|
+
%code.shell
|
155
|
+
rails g keppler_scaffold [module_name] [attributes] -f
|
156
|
+
|
157
|
+
%p Luego crea la tabla en base de datos.
|
158
|
+
|
159
|
+
%pre
|
160
|
+
%code.shell
|
161
|
+
rake db:migrate
|
162
|
+
|
163
|
+
%h3 Plugins (Módulos)
|
164
|
+
|
165
|
+
%p
|
166
|
+
La plataforma permite la adaptación de módulos con facil instalación,
|
167
|
+
algunos de los módulos desarrollados son:
|
168
|
+
|
169
|
+
%ul
|
170
|
+
%li
|
171
|
+
= link_to 'Keppler google analytics dashboard', 'https://github.com/SliceDevelopers/keppler_ga_dashboard'
|
172
|
+
%strong ya viene integrado
|
173
|
+
%li
|
174
|
+
= link_to 'Keppler blog', 'https://github.com/SliceDevelopers/keppler_blog'
|
175
|
+
%li
|
176
|
+
= link_to 'Keppler catalogs', 'https://github.com/inyxtech/keppler_catalogs'
|
177
|
+
%li
|
178
|
+
= link_to 'Keppler contact', 'https://github.com/SliceDevelopers/keppler_contact_us'
|
179
|
+
|
180
|
+
%script{ src: '/assets/app/front.js' }
|
@@ -0,0 +1,219 @@
|
|
1
|
+
require 'rails/generators/rails/resource/resource_generator'
|
2
|
+
require 'rails/generators/resource_helpers'
|
3
|
+
module Rails
|
4
|
+
module Generators
|
5
|
+
# KepplerRelation
|
6
|
+
class KepplerRelationGenerator < Rails::Generators::NamedBase
|
7
|
+
source_root File.expand_path('../templates', __FILE__)
|
8
|
+
# Modify models (add has_many and belongs_to relation)
|
9
|
+
def modify_models
|
10
|
+
inject_into_file(
|
11
|
+
"app/models/#{name}.rb",
|
12
|
+
"\n has_many :#{args[0].pluralize}, :dependent => :delete_all",
|
13
|
+
after: 'include CloneRecord'
|
14
|
+
)
|
15
|
+
inject_into_file(
|
16
|
+
"app/models/#{args[0]}.rb",
|
17
|
+
"\n belongs_to :#{name}",
|
18
|
+
after: 'include CloneRecord'
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Delete the son module from the sidemenu
|
23
|
+
def add_submenu
|
24
|
+
gsub_file 'config/menu.yml', sub_menu_deleted(args[0]), " ##{args[0].camelcase} deleted"
|
25
|
+
end
|
26
|
+
|
27
|
+
# Nest routes father_module/son_module and delete the routes generated by the keppler_scaffold command
|
28
|
+
def nest_routes
|
29
|
+
gsub_file 'config/routes.rb', commented_route(args[0]), ' #Route deleted'
|
30
|
+
inject_into_file(
|
31
|
+
"config/routes.rb",
|
32
|
+
str_route(args[0]),
|
33
|
+
after:" resources :#{name.pluralize} do\n get '(page/:page)', action: :index, on: :collection, as: ''\n get '/clone', action: 'clone'\n delete(\n action: :destroy_multiple,\n on: :collection,\n as: :destroy_multiple\n )\n"
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Modify the paths of the view of the son module
|
38
|
+
def modify_views_path
|
39
|
+
["_listing", "index", "_form", "_index_show", "show"].each do |view|
|
40
|
+
singular_path(name,args[0],view)
|
41
|
+
if view == '_listing'
|
42
|
+
clone_path(name,args[0],view)
|
43
|
+
inject_listing(name, args[0], view)
|
44
|
+
end
|
45
|
+
inject_variable(name, args[0], view)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
# Add the method in the son controller to find the father :id
|
52
|
+
def add_controller_flag
|
53
|
+
inject_into_file(
|
54
|
+
"app/controllers/admin/#{args[0].pluralize}_controller.rb",
|
55
|
+
str_ctrl_method(name,args[0]),
|
56
|
+
after: " private"
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
# Add the callback in the son's controller
|
61
|
+
def add_callback
|
62
|
+
inject_into_file(
|
63
|
+
"app/controllers/admin/#{args[0].pluralize}_controller.rb",
|
64
|
+
str_callback_ctrl(name),
|
65
|
+
after: " before_action :show_history, only: [:index]"
|
66
|
+
)
|
67
|
+
end
|
68
|
+
|
69
|
+
# Inject the variables in the simple_form_for of the form partial
|
70
|
+
def inject_var_form
|
71
|
+
inject_into_file(
|
72
|
+
"app/views/admin/#{args[0].pluralize}/_form.html.haml",
|
73
|
+
"@#{name}_#{args[0]}, ",
|
74
|
+
before: "@#{args[0]}]"
|
75
|
+
)
|
76
|
+
end
|
77
|
+
|
78
|
+
# Include the button in the father_module _listing
|
79
|
+
def nested_button
|
80
|
+
inject_into_file(
|
81
|
+
"app/views/admin/#{name.pluralize}/_listing.html.haml",
|
82
|
+
str_btn(name, args[0]),
|
83
|
+
# before: str_last_button(name)
|
84
|
+
after: ' .icons.right'
|
85
|
+
)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Insert params in son's controller within new method
|
89
|
+
def new_params
|
90
|
+
inject_into_file(
|
91
|
+
"app/controllers/admin/#{args[0].pluralize}_controller.rb",
|
92
|
+
"(#{name.underscore}_id: params[:#{name.underscore}_id])",
|
93
|
+
after: " def new\n @#{args[0]} = #{args[0].camelcase}.new"
|
94
|
+
)
|
95
|
+
|
96
|
+
end
|
97
|
+
|
98
|
+
# Replace the paths in module_son controller
|
99
|
+
def controller_paths
|
100
|
+
gsub_file(
|
101
|
+
"app/controllers/admin/#{args[0].pluralize}_controller.rb",
|
102
|
+
"admin_#{args[0].pluralize}_path",
|
103
|
+
"admin_#{name.underscore}_#{args[0].pluralize}_path"
|
104
|
+
)
|
105
|
+
gsub_file(
|
106
|
+
"app/controllers/admin/#{args[0].pluralize}_controller.rb",
|
107
|
+
"redirect(@#{args[0].underscore}, params)",
|
108
|
+
redirect_path(name, args[0])
|
109
|
+
)
|
110
|
+
end
|
111
|
+
|
112
|
+
# Replace 'params[:q] to (@category_shop) and add .where to filter the index of son_module'
|
113
|
+
def index_controller
|
114
|
+
gsub_file(
|
115
|
+
"app/controllers/admin/#{args[0].pluralize}_controller.rb",
|
116
|
+
'params[:q]',
|
117
|
+
"@#{name.underscore}_#{args[0].underscore}"
|
118
|
+
)
|
119
|
+
inject_into_file(
|
120
|
+
"app/controllers/admin/#{args[0].pluralize}_controller.rb",
|
121
|
+
".where(#{name}_id: @#{name.underscore}_#{args[0].underscore})",
|
122
|
+
after: "#{args[0].pluralize} = @q.result(distinct: true)"
|
123
|
+
)
|
124
|
+
end
|
125
|
+
|
126
|
+
def return_btn
|
127
|
+
inject_into_file(
|
128
|
+
"app/views/admin/#{args[0].underscore.pluralize}/index.html.haml",
|
129
|
+
"\n\t= link_to admin_#{name.underscore.pluralize}_path, class: 'btn-floating btn-flat' do\n\t\t-# = material_icon.md_18.arrow_back.css_class('md-dark')",
|
130
|
+
after: '= entries(@total, @objects)'
|
131
|
+
)
|
132
|
+
end
|
133
|
+
|
134
|
+
private
|
135
|
+
|
136
|
+
# String to delete the menu.yml menu (son_module)
|
137
|
+
def sub_menu_deleted(son)
|
138
|
+
" #{son}:\n name: #{son.split('_').join(" ").pluralize}\n url_path: /admin/#{son.pluralize}\n icon: code\n current: ['admin/#{son.pluralize}']\n model: #{son.camelcase}"
|
139
|
+
end
|
140
|
+
|
141
|
+
#
|
142
|
+
def redirect_path(father,son)
|
143
|
+
"if params.key?('_add_other')\n redirect_to new_admin_#{father.underscore}_#{son.underscore}_path, notice: actions_messages(@#{son})\n else\n redirect_to admin_#{father.underscore}_#{son.pluralize}_path\n end"
|
144
|
+
end
|
145
|
+
|
146
|
+
def singular_path(father,son,file)
|
147
|
+
inject_into_file(
|
148
|
+
"app/views/admin/#{son.pluralize}/#{file}.html.haml",
|
149
|
+
"_#{father.underscore}",
|
150
|
+
before: "_#{son}"
|
151
|
+
)
|
152
|
+
end
|
153
|
+
|
154
|
+
def clone_path(father,son,file)
|
155
|
+
inject_into_file(
|
156
|
+
"app/views/admin/#{son.pluralize}/#{file}.html.haml",
|
157
|
+
"_#{father.underscore}",
|
158
|
+
before: "_#{son}_clone_path"
|
159
|
+
)
|
160
|
+
end
|
161
|
+
|
162
|
+
# String to know what route comment (son_module)
|
163
|
+
def commented_route(path)
|
164
|
+
" resources :#{path.pluralize(2)} do\n get '(page/:page)', action: :index, on: :collection, as: ''\n get '/clone', action: 'clone'\n delete(\n action: :destroy_multiple,\n on: :collection,\n as: :destroy_multiple\n )\n end\n"
|
165
|
+
end
|
166
|
+
|
167
|
+
# String of new route to nest (son_module)
|
168
|
+
def str_route(path)
|
169
|
+
" resources :#{path.pluralize(2)} do\n get '(page/:page)', action: :index, on: :collection, as: ''\n get '/clone', action: 'clone'\n delete(\n action: :destroy_multiple,\n on: :collection,\n as: :destroy_multiple\n )\n end\n"
|
170
|
+
end
|
171
|
+
|
172
|
+
# string of private method to add within the son_module controller
|
173
|
+
def str_ctrl_method(father, son)
|
174
|
+
"\n\n def set_#{father}\n @#{father}_#{son} = #{father.camelcase}.find(params[:#{father.underscore}_id])\n end\n"
|
175
|
+
end
|
176
|
+
|
177
|
+
# String of the callback to add within the son_module controller
|
178
|
+
def str_callback_ctrl(father)
|
179
|
+
"\n before_action :set_#{father.underscore}\n"
|
180
|
+
end
|
181
|
+
|
182
|
+
# Add variables to path of son_module views
|
183
|
+
def inject_variable(father, son, file)
|
184
|
+
if file.eql?("_form")
|
185
|
+
inject_into_file(
|
186
|
+
"app/views/admin/#{args[0].pluralize}/#{file}.html.haml",
|
187
|
+
"(@#{father.underscore}_#{son.underscore}, @#{son.underscore})",
|
188
|
+
after: "admin_#{father.underscore}_#{son.underscore}_path"
|
189
|
+
)
|
190
|
+
end
|
191
|
+
inject_into_file(
|
192
|
+
"app/views/admin/#{args[0].pluralize}/#{file}.html.haml",
|
193
|
+
"@#{father.underscore}_#{son.underscore}, ",
|
194
|
+
before: "@#{son.underscore})"
|
195
|
+
)
|
196
|
+
end
|
197
|
+
|
198
|
+
# Inject variable to _listing view of son_module
|
199
|
+
def inject_listing(father, son, file)
|
200
|
+
inject_into_file(
|
201
|
+
"app/views/admin/#{args[0].pluralize}/_listing.html.haml",
|
202
|
+
"@#{father.underscore}_#{son.underscore},",
|
203
|
+
after: "_path("
|
204
|
+
)
|
205
|
+
end
|
206
|
+
|
207
|
+
|
208
|
+
# References to add nest button in father_module's listing
|
209
|
+
def str_last_button(father)
|
210
|
+
" - if Pundit.policy(current_user, #{father.camelcase}).show?"
|
211
|
+
end
|
212
|
+
|
213
|
+
#String of the button to add in father_module's listing
|
214
|
+
def str_btn(father, son)
|
215
|
+
"\n %li.center\n = link_to admin_#{father}_#{son.pluralize}_path(#{father}), class: 'btn-floating waves-effect btn-flat tooltipped', title: t('keppler.sidebar-menu.#{son.pluralize}') do\n -# = material_icon.md_24.add_circle_outline.css_class('md-dark')\n"
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
@@ -0,0 +1,240 @@
|
|
1
|
+
require 'rails/generators/rails/resource/resource_generator'
|
2
|
+
require 'rails/generators/resource_helpers'
|
3
|
+
module Rails
|
4
|
+
module Generators
|
5
|
+
# KepplerScaffold
|
6
|
+
class KepplerScaffoldGenerator < ResourceGenerator
|
7
|
+
remove_hook_for :resource_controller
|
8
|
+
remove_class_option :actions
|
9
|
+
|
10
|
+
class_option :stylesheets, type: :boolean, desc: 'Generate Stylesheets'
|
11
|
+
class_option :stylesheet_engine, desc: 'Engine for Stylesheets'
|
12
|
+
remove_class_option :resource_route, type: :boolean
|
13
|
+
|
14
|
+
source_root File.expand_path('../templates', __FILE__)
|
15
|
+
|
16
|
+
check_class_collision suffix: 'Controller'
|
17
|
+
|
18
|
+
class_option(
|
19
|
+
:orm,
|
20
|
+
banner: 'NAME',
|
21
|
+
type: :string,
|
22
|
+
required: true,
|
23
|
+
desc: 'ORM to generate the controller for'
|
24
|
+
)
|
25
|
+
|
26
|
+
argument(
|
27
|
+
:attributes,
|
28
|
+
type: :array,
|
29
|
+
default: [],
|
30
|
+
banner: 'field:type field:type'
|
31
|
+
)
|
32
|
+
|
33
|
+
def add_route
|
34
|
+
unless options[:skip_routes]
|
35
|
+
inject_into_file(
|
36
|
+
'config/routes.rb',
|
37
|
+
"\n #{indent(str_route)}",
|
38
|
+
after: "root to: 'admin#root'"
|
39
|
+
)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def add_option_menu
|
44
|
+
inject_into_file(
|
45
|
+
'config/menu.yml',
|
46
|
+
str_menu,
|
47
|
+
before: ' user:'
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
# def add_access_ability
|
52
|
+
# inject_into_file(
|
53
|
+
# 'app/models/ability.rb',
|
54
|
+
# str_ability_admin,
|
55
|
+
# after: ' if user.has_role? :keppler_admin'
|
56
|
+
# )
|
57
|
+
# inject_into_file(
|
58
|
+
# 'app/models/ability.rb',
|
59
|
+
# str_ability_admin,
|
60
|
+
# after: ' elsif user.has_role? :admin'
|
61
|
+
# )
|
62
|
+
# inject_into_file(
|
63
|
+
# 'app/models/ability.rb',
|
64
|
+
# str_ability_client,
|
65
|
+
# after: ' elsif user.has_role? :client'
|
66
|
+
# )
|
67
|
+
# end
|
68
|
+
|
69
|
+
def add_locales
|
70
|
+
%w(en es).each do |locale|
|
71
|
+
add_str_locales(locale, 'singularize')
|
72
|
+
add_str_locales(locale, 'pluralize')
|
73
|
+
add_str_locales(locale, 'modules')
|
74
|
+
add_str_locales(locale, 'sidebar-menu')
|
75
|
+
# add_str_locales(locale, 'attributes')
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Se usa para configurar la exportación del ActiveRecords a .xls,
|
80
|
+
# pero da problemas al borrar el KepplerScaffold
|
81
|
+
|
82
|
+
# def add_config_xls
|
83
|
+
# inject_into_file(
|
84
|
+
# 'config/initializers/mime_types.rb',
|
85
|
+
# str_xls,
|
86
|
+
# after: '# ActiveRecords to save as .xls'
|
87
|
+
# )
|
88
|
+
# end
|
89
|
+
|
90
|
+
def create_controller_files
|
91
|
+
template(
|
92
|
+
'controllers/controller.rb',
|
93
|
+
File.join(
|
94
|
+
'app/controllers/admin',
|
95
|
+
controller_class_path, "#{controller_file_name}_controller.rb"
|
96
|
+
)
|
97
|
+
)
|
98
|
+
end
|
99
|
+
|
100
|
+
def create_model_files
|
101
|
+
attachments
|
102
|
+
template(
|
103
|
+
'models/model.rb',
|
104
|
+
File.join(
|
105
|
+
'app/models',
|
106
|
+
controller_class_path,
|
107
|
+
"#{controller_file_name.singularize}.rb"
|
108
|
+
)
|
109
|
+
)
|
110
|
+
end
|
111
|
+
|
112
|
+
def create_policies_files
|
113
|
+
template(
|
114
|
+
'policies/policy.rb',
|
115
|
+
File.join(
|
116
|
+
'app/policies',
|
117
|
+
controller_class_path, "#{controller_file_name.singularize}_policy.rb"
|
118
|
+
)
|
119
|
+
)
|
120
|
+
end
|
121
|
+
|
122
|
+
def create_views_files
|
123
|
+
names
|
124
|
+
attachments
|
125
|
+
template_keppler_views('_description.html.haml')
|
126
|
+
template_keppler_views('_index_show.html.haml')
|
127
|
+
template_keppler_views('_listing.html.haml')
|
128
|
+
template_keppler_views('_form.html.haml')
|
129
|
+
template_keppler_views('show.js.haml')
|
130
|
+
template_keppler_views('edit.html.haml')
|
131
|
+
template_keppler_views('new.html.haml')
|
132
|
+
template_keppler_views('show.html.haml')
|
133
|
+
template_keppler_views('index.html.haml')
|
134
|
+
template_keppler_views('reload.js.haml')
|
135
|
+
end
|
136
|
+
|
137
|
+
hook_for :test_framework, as: :scaffold
|
138
|
+
|
139
|
+
# Invoke the helper using the controller name (pluralized)
|
140
|
+
hook_for :helper, as: :scaffold do |invoked|
|
141
|
+
invoke invoked, [controller_name]
|
142
|
+
end
|
143
|
+
|
144
|
+
def add_position_field
|
145
|
+
file = Dir::entries('db/migrate').sort.last
|
146
|
+
#system "sudo apt-get update"
|
147
|
+
inject_into_file(
|
148
|
+
"db/migrate/#{file}",
|
149
|
+
"t.integer :position\n ",
|
150
|
+
before: "t.timestamps null: false"
|
151
|
+
)
|
152
|
+
end
|
153
|
+
|
154
|
+
private
|
155
|
+
|
156
|
+
def names
|
157
|
+
@names = ['name', 'title', 'first_name', 'full_name']
|
158
|
+
end
|
159
|
+
|
160
|
+
def attachments
|
161
|
+
@attachments = ['logo', 'brand', 'photo', 'avatar', 'cover', 'image', 'picture', 'banner', 'attachment', 'pic', 'file']
|
162
|
+
end
|
163
|
+
|
164
|
+
def add_str_locales(locale, switch)
|
165
|
+
inject_into_file(
|
166
|
+
"config/locales/#{locale}.yml",
|
167
|
+
str_locales(switch),
|
168
|
+
after: "#{switch}:"
|
169
|
+
)
|
170
|
+
end
|
171
|
+
|
172
|
+
def str_route
|
173
|
+
"\n resources :#{controller_file_name} do\n get '(page/:page)', action: :index, on: :collection, as: ''\n get '/clone', action: 'clone'\n post '/import', action: 'import', as: :import\n \n get '/download', action: 'download', as: :download\n post(\n '/sort',\n action: :sort,\n on: :collection,\n )\n get(\n '/reload',\n action: :reload,\n on: :collection,\n )\n delete(\n '/destroy_multiple',\n action: :destroy_multiple,\n on: :collection,\n as: :destroy_multiple\n )
|
174
|
+
end"
|
175
|
+
end
|
176
|
+
|
177
|
+
def str_menu
|
178
|
+
" #{controller_file_name.singularize}:\n name: #{controller_file_name.humanize.downcase}\n url_path: /admin/#{controller_file_name}\n icon: layers\n current: ['admin/#{controller_file_name}']\n model: #{controller_file_name.singularize.camelize}\n"
|
179
|
+
end
|
180
|
+
|
181
|
+
# def str_ability_admin
|
182
|
+
# "\n\n # - #{controller_file_name.singularize.camelcase} authorize -\n can :manage, #{controller_file_name.singularize.camelcase}"
|
183
|
+
# end
|
184
|
+
#
|
185
|
+
# def str_ability_client
|
186
|
+
# "\n\n # - #{controller_file_name.singularize.camelcase} authorize -\n can [:index, :show], #{controller_file_name.singularize.camelcase}"
|
187
|
+
# end
|
188
|
+
|
189
|
+
def str_xls
|
190
|
+
"\nif #{controller_file_name.singularize.camelcase}.table_exists?\n @#{controller_file_name.pluralize} = #{controller_file_name.singularize.camelcase}.all\n @#{controller_file_name.pluralize}.to_xls(\n only: %i[#{attributes_names.map { |name| name }.join(' ')}],\n except: [:id],\n header: false,\n prepend: [['Col 0, Row 0', 'Col 1, Row 0'], ['Col 0, Row 1']],\n column_width: [17, 15, 15, 40, 25, 37]\n )\n @#{controller_file_name.pluralize}.to_xls do |column, value|\n column == :salutation ? t(value) : value\n end\nend\n"
|
191
|
+
end
|
192
|
+
|
193
|
+
def str_locales(switch)
|
194
|
+
case switch
|
195
|
+
when 'singularize'
|
196
|
+
"\n #{controller_file_name.singularize}: #{controller_file_name.singularize.humanize.downcase}"
|
197
|
+
when 'pluralize'
|
198
|
+
"\n #{controller_file_name}: #{controller_file_name.humanize.downcase}"
|
199
|
+
when 'modules'
|
200
|
+
"\n admin/#{controller_file_name}: #{controller_file_name.humanize}"
|
201
|
+
when 'sidebar-menu'
|
202
|
+
"\n #{controller_file_name}: #{controller_file_name.humanize}"
|
203
|
+
# when 'attributes'
|
204
|
+
# array = ["\n #{controller_file_name.singularize}:"]
|
205
|
+
# attributes_names.each do |attribute|
|
206
|
+
# array.push("\n #{attribute}: #{attribute.humanize}")
|
207
|
+
# end
|
208
|
+
# array.join
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
def template_keppler_views(name_file)
|
213
|
+
template(
|
214
|
+
"views/#{name_file}",
|
215
|
+
File.join("app/views/admin/#{controller_file_name}", name_file)
|
216
|
+
)
|
217
|
+
end
|
218
|
+
|
219
|
+
def arr_exist(path, search)
|
220
|
+
object = []
|
221
|
+
open(path).each do |line|
|
222
|
+
object << line if line.to_s.include? search
|
223
|
+
end
|
224
|
+
object
|
225
|
+
end
|
226
|
+
|
227
|
+
def destination_path(path)
|
228
|
+
File.join(destination_root, path)
|
229
|
+
end
|
230
|
+
|
231
|
+
def gsub_file(relative_destination, regexp, *args, &block)
|
232
|
+
path = destination_path(relative_destination)
|
233
|
+
content = File.read(path).gsub(regexp, *args, &block)
|
234
|
+
File.open(path, 'wb') do |file|
|
235
|
+
file.write(content)
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|