lesli 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +3 -0
- data/app/assets/config/lesli_manifest.js +53 -0
- data/app/assets/fonts/lesli/Domine/Domine-Bold.ttf +0 -0
- data/app/assets/fonts/lesli/Domine/Domine-Regular.ttf +0 -0
- data/app/assets/fonts/lesli/Domine/OFL.txt +95 -0
- data/app/assets/fonts/lesli/MaterialDesign/icons.woff2 +0 -0
- data/app/assets/fonts/lesli/Montserrat/Montserrat-Variable.ttf +0 -0
- data/app/assets/fonts/lesli/OpenSans/OpenSans-Variable.ttf +0 -0
- data/app/assets/fonts/lesli/Remix/remixicon.eot +0 -0
- data/app/assets/fonts/lesli/Remix/remixicon.glyph.json +1 -0
- data/app/assets/fonts/lesli/Remix/remixicon.svg +7633 -0
- data/app/assets/fonts/lesli/Remix/remixicon.symbol.svg +11 -0
- data/app/assets/fonts/lesli/Remix/remixicon.ttf +0 -0
- data/app/assets/fonts/lesli/Remix/remixicon.woff +0 -0
- data/app/assets/fonts/lesli/Remix/remixicon.woff2 +0 -0
- data/app/assets/fonts/lesli/Roboto/LICENSE.txt +202 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Black.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-BlackItalic.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Bold.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-BoldItalic.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Italic.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Light.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-LightItalic.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Medium.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-MediumItalic.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Regular.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Thin.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-ThinItalic.ttf +0 -0
- data/app/assets/icons/lesli/cloud-admin.svg +1 -0
- data/app/assets/icons/lesli/cloud-audit.svg +1 -0
- data/app/assets/icons/lesli/cloud-babel.svg +1 -0
- data/app/assets/icons/lesli/cloud-bell.svg +1 -0
- data/app/assets/icons/lesli/cloud-books.svg +1 -0
- data/app/assets/icons/lesli/cloud-development.svg +1 -0
- data/app/assets/icons/lesli/cloud-dispatcher.svg +1 -0
- data/app/assets/icons/lesli/cloud-driver.svg +1 -0
- data/app/assets/icons/lesli/cloud-focus.svg +1 -0
- data/app/assets/icons/lesli/cloud-help.svg +1 -0
- data/app/assets/icons/lesli/cloud-kb.svg +1 -0
- data/app/assets/icons/lesli/cloud-leaf.svg +1 -0
- data/app/assets/icons/lesli/cloud-lesli.svg +1 -0
- data/app/assets/icons/lesli/cloud-mailer.svg +1 -0
- data/app/assets/icons/lesli/cloud-one.svg +1 -0
- data/app/assets/icons/lesli/cloud-profile.svg +1 -0
- data/app/assets/icons/lesli/cloud-proposal.svg +1 -0
- data/app/assets/icons/lesli/cloud-scraper.svg +1 -0
- data/app/assets/icons/lesli/cloud-shared.svg +1 -0
- data/app/assets/icons/lesli/cloud-storage.svg +1 -0
- data/app/assets/icons/lesli/cloud-talk.svg +1 -0
- data/app/assets/icons/lesli/cloud-team.svg +1 -0
- data/app/assets/icons/lesli/cloud-time.svg +1 -0
- data/app/assets/icons/lesli/cloud-vault.svg +1 -0
- data/app/assets/icons/lesli/cloud-word.svg +1 -0
- data/app/assets/icons/lesli/icon-module.svg +1 -0
- data/app/assets/icons/lesli/logo-android.svg +1 -0
- data/app/assets/icons/lesli/logo-bulma.svg +1 -0
- data/app/assets/icons/lesli/logo-ios.svg +1 -0
- data/app/assets/icons/lesli/logo-linux.svg +1 -0
- data/app/assets/icons/lesli/logo-mac.svg +1 -0
- data/app/assets/icons/lesli/logo-module.svg +1 -0
- data/app/assets/icons/lesli/logo-postgresql.svg +1 -0
- data/app/assets/icons/lesli/logo-rails.svg +1 -0
- data/app/assets/icons/lesli/logo-ruby.svg +1 -0
- data/app/assets/icons/lesli/logo-sass.svg +1 -0
- data/app/assets/icons/lesli/logo-vue.svg +1 -0
- data/app/assets/icons/lesli/logo-web.svg +1 -0
- data/app/assets/icons/lesli/logo-windows.svg +1 -0
- data/app/assets/icons/readme.md +10 -0
- data/app/assets/images/lesli/brand/app-auth.svg +9 -0
- data/app/assets/images/lesli/brand/app-icon.svg +42 -0
- data/app/assets/images/lesli/brand/app-logo.svg +4 -0
- data/app/assets/images/lesli/brand/favicon.png +0 -0
- data/app/assets/images/lesli/brand/favicon.svg +61 -0
- data/app/assets/images/lesli/brand/login-background.jpg +0 -0
- data/app/assets/javascripts/lesli/users/sessions.js +786 -0
- data/app/assets/stylesheets/lesli/users/confirmations.scss +34 -0
- data/app/assets/stylesheets/lesli/users/devise.scss +32 -0
- data/app/assets/stylesheets/lesli/users/oauth.scss +34 -0
- data/app/assets/stylesheets/lesli/users/passwords.scss +34 -0
- data/app/assets/stylesheets/lesli/users/registrations.scss +34 -0
- data/app/assets/stylesheets/lesli/users/sessions.scss +38 -0
- data/app/controllers/lesli/application_controller.rb +108 -0
- data/app/controllers/lesli/application_devise_controller.rb +54 -0
- data/app/controllers/lesli/application_lesli_controller.rb +61 -0
- data/app/controllers/lesli/interfaces/application/authorization.rb +107 -0
- data/app/controllers/lesli/interfaces/application/customization.rb +46 -0
- data/app/controllers/lesli/interfaces/application/logger.rb +133 -0
- data/app/controllers/lesli/interfaces/application/requester.rb +84 -0
- data/app/controllers/lesli/interfaces/application/responder.rb +132 -0
- data/app/controllers/lesli/profiles_controller.rb +60 -0
- data/app/controllers/users/confirmations_controller.rb +30 -0
- data/app/controllers/users/omniauth_callbacks_controller.rb +30 -0
- data/app/controllers/users/passwords_controller.rb +34 -0
- data/app/controllers/users/registrations_controller.rb +62 -0
- data/app/controllers/users/sessions_controller.rb +142 -0
- data/app/controllers/users/unlocks_controller.rb +30 -0
- data/app/helpers/lesli/assets_helper.rb +92 -0
- data/app/helpers/lesli/customization_helper.rb +84 -0
- data/app/helpers/lesli/general_helper.rb +83 -0
- data/app/helpers/lesli/navigation_helper.rb +349 -0
- data/app/helpers/lesli/profiles_helper.rb +4 -0
- data/app/helpers/lesli/system_helper.rb +57 -0
- data/app/lib/date2.rb +192 -0
- data/app/lib/lesli/system.rb +80 -0
- data/app/models/concerns/account_engines.rb +249 -0
- data/app/models/concerns/user_activities.rb +163 -0
- data/app/models/concerns/user_extensions.rb +129 -0
- data/app/models/concerns/user_guard.rb +278 -0
- data/app/models/concerns/user_polyfill.rb +134 -0
- data/app/models/lesli/account/log.rb +57 -0
- data/app/models/lesli/account.rb +76 -0
- data/app/models/lesli/application_lesli_record.rb +37 -0
- data/app/models/lesli/profile.rb +4 -0
- data/app/models/lesli/system_controller/action.rb +37 -0
- data/app/models/lesli/system_controller.rb +37 -0
- data/app/models/lesli/user/agent.rb +37 -0
- data/app/models/lesli/user/log.rb +38 -0
- data/app/models/lesli/user/request.rb +37 -0
- data/app/models/lesli/user/session.rb +105 -0
- data/app/models/lesli/user.rb +162 -0
- data/app/services/lesli/application_lesli_service.rb +168 -0
- data/app/services/lesli/user/session_service.rb +62 -0
- data/app/validators/lesli/application_lesli_validator.rb +67 -0
- data/app/validators/lesli/users_validator.rb +217 -0
- data/app/views/devise/confirmations/new.html.erb +16 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/devise/mailer/email_changed.html.erb +7 -0
- data/app/views/devise/mailer/password_change.html.erb +3 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.erb +25 -0
- data/app/views/devise/passwords/new.html.erb +16 -0
- data/app/views/devise/registrations/edit.html.erb +43 -0
- data/app/views/devise/registrations/new.html.erb +29 -0
- data/app/views/devise/sessions/new.html.erb +178 -0
- data/app/views/devise/shared/_error_messages.html.erb +15 -0
- data/app/views/devise/shared/_links.html.erb +25 -0
- data/app/views/devise/unlocks/new.html.erb +16 -0
- data/app/views/lesli/devise/sessions/_form.html.erb +17 -0
- data/app/views/lesli/devise/sessions/_session.html.erb +2 -0
- data/app/views/lesli/devise/sessions/edit.html.erb +10 -0
- data/app/views/lesli/devise/sessions/index.html.erb +14 -0
- data/app/views/lesli/devise/sessions/new.html.erb +9 -0
- data/app/views/lesli/devise/sessions/show.html.erb +10 -0
- data/app/views/lesli/layouts/application-devise.html.erb +58 -0
- data/app/views/lesli/layouts/application-lesli.html.erb +57 -0
- data/app/views/lesli/layouts/application-public.html.erb +59 -0
- data/app/views/lesli/partials/_application-analytics.html.erb +71 -0
- data/app/views/lesli/partials/_application-data.html.erb +102 -0
- data/app/views/lesli/partials/_application-head.html.erb +56 -0
- data/app/views/lesli/partials/_application-lesli-chatbox.html.erb +35 -0
- data/app/views/lesli/partials/_application-lesli-content.html.erb +35 -0
- data/app/views/lesli/partials/_application-lesli-engines.html.erb +83 -0
- data/app/views/lesli/partials/_application-lesli-footer.html.erb +82 -0
- data/app/views/lesli/partials/_application-lesli-header.html.erb +79 -0
- data/app/views/lesli/partials/_application-lesli-icons.html.erb +1 -0
- data/app/views/lesli/partials/_application-lesli-javascript.html.erb +57 -0
- data/app/views/lesli/partials/_application-lesli-navigation.html.erb +52 -0
- data/app/views/lesli/partials/_application-lesli-notices.html.erb +43 -0
- data/app/views/lesli/partials/_application-lesli-panels.html.erb +58 -0
- data/app/views/lesli/partials/_application-lesli-scss.html.erb +60 -0
- data/app/views/lesli/partials/_application-lesli-sidebar.html.erb +50 -0
- data/app/views/lesli/partials/_application-public-footer.html.erb +51 -0
- data/app/views/lesli/partials/_application-public-javascript.html.erb +51 -0
- data/app/views/lesli/partials/_application-public-scss.html.erb +35 -0
- data/app/views/lesli/profiles/_form.html.erb +17 -0
- data/app/views/lesli/profiles/_profile.html.erb +2 -0
- data/app/views/lesli/profiles/edit.html.erb +10 -0
- data/app/views/lesli/profiles/index.html.erb +14 -0
- data/app/views/lesli/profiles/new.html.erb +9 -0
- data/app/views/lesli/profiles/show.html.erb +10 -0
- data/app/views/lesli/wrappers/_application-auth.html.erb +65 -0
- data/config/initializers/devise.rb +334 -0
- data/config/initializers/lesli_defaults.rb +100 -0
- data/config/locales/devise.en.yml +65 -0
- data/config/routes.rb +52 -0
- data/db/migrate/v1.0/0010000110_create_lesli_accounts.rb +70 -0
- data/db/migrate/v1.0/0010000210_create_lesli_roles.rb +59 -0
- data/db/migrate/v1.0/0010000310_create_lesli_users.rb +97 -0
- data/db/migrate/v1.0/0010000610_create_lesli_system_controllers.rb +44 -0
- data/db/migrate/v1.0/0010000710_create_lesli_system_controller_actions.rb +43 -0
- data/db/migrate/v1.0/0010001210_create_lesli_account_activities.rb +50 -0
- data/db/migrate/v1.0/0010001310_create_lesli_account_logs.rb +45 -0
- data/db/migrate/v1.0/0010003210_create_lesli_user_sessions.rb +51 -0
- data/db/migrate/v1.0/0010003310_create_lesli_user_requests.rb +48 -0
- data/db/migrate/v1.0/0010003610_create_lesli_user_logs.rb +45 -0
- data/db/migrate/v1.0/0010004010_create_lesli_user_agents.rb +46 -0
- data/db/seed/development/accounts.rb +47 -0
- data/db/seed/development/users.rb +53 -0
- data/db/seed/development.rb +35 -0
- data/db/seed/production.rb +35 -0
- data/db/seed/test.rb +35 -0
- data/db/seed/tools.rb +60 -0
- data/db/seeds.rb +64 -0
- data/db/structure/00000000_locations.json +32 -0
- data/db/structure/00000000_people.json +34 -0
- data/db/structure/00000003_actions.json +14 -0
- data/db/structure/00000004_activities.json +20 -0
- data/db/structure/00000005_discussions.json +8 -0
- data/db/structure/00000006_files.json +32 -0
- data/db/structure/00000007_subscribers.json +11 -0
- data/db/structure/00000008_custom_fields.json +8 -0
- data/db/structure/00000201_workflows.json +17 -0
- data/db/structure/00000202_workflow_statuses.json +24 -0
- data/db/structure/00000203_workflow_associations.json +14 -0
- data/db/structure/00000204_workflow_actions.json +39 -0
- data/db/structure/00000205_workflow_checks.json +27 -0
- data/db/structure/00000301_custom_fields.json +38 -0
- data/db/structure/00000401_custom_validations.json +14 -0
- data/db/structure/00000402_custom_validation_rules.json +23 -0
- data/db/structure/00000403_custom_validation_fields.json +14 -0
- data/db/structure/00000501_dashboards.json +14 -0
- data/db/structure/00000502_dashboard_components.json +23 -0
- data/db/tables/0010001010_create_account_settings.rb +42 -0
- data/db/tables/0010001110_create_account_locations.rb +64 -0
- data/db/tables/0010001410_create_account_files.rb +52 -0
- data/db/tables/0010001510_create_account_currencies.rb +48 -0
- data/db/tables/0010001610_create_account_currency_exchange_rates.rb +54 -0
- data/db/tables/0010003010_create_user_details.rb +49 -0
- data/db/tables/0010003110_create_user_settings.rb +44 -0
- data/db/tables/0010003410_create_user_activities.rb +51 -0
- data/db/tables/0010003510_create_user_roles.rb +43 -0
- data/db/tables/0010003710_create_user_codes.rb +43 -0
- data/db/tables/0010003810_create_user_shortcuts.rb +46 -0
- data/db/tables/0010004110_create_user_tokens.rb +45 -0
- data/db/tables/0010005010_create_descriptors.rb +45 -0
- data/db/tables/0010005110_create_descriptor_privileges.rb +44 -0
- data/db/tables/0010005210_create_descriptor_activities.rb +51 -0
- data/db/tables/0010005510_create_role_descriptors.rb +44 -0
- data/db/tables/0010005610_create_role_activities.rb +50 -0
- data/db/tables/0010005710_create_role_privileges.rb +45 -0
- data/db/tables/0010009010_create_feedbacks.rb +56 -0
- data/lib/assets/javascripts/lesli/i18n.js +1095 -0
- data/lib/assets/javascripts/lesli/translations.js +15 -0
- data/lib/lesli/configuration.rb +45 -0
- data/lib/lesli/engine.rb +62 -0
- data/lib/lesli/version.rb +34 -0
- data/lib/lesli.rb +6 -0
- data/lib/sass/lesli/bulma/loader.scss +84 -0
- data/lib/sass/lesli/cloud-objects/discussion.scss +77 -0
- data/lib/sass/lesli/cloud-objects/file.scss +138 -0
- data/lib/sass/lesli/components/editor-richtext.scss +78 -0
- data/lib/sass/lesli/components/keypad.scss +109 -0
- data/lib/sass/lesli/devise/confirmations.scss.erb +75 -0
- data/lib/sass/lesli/devise/passwords.scss.erb +86 -0
- data/lib/sass/lesli/devise/registrations.scss.erb +50 -0
- data/lib/sass/lesli/devise/sessions.scss +36 -0
- data/lib/sass/lesli/elements/autocomplete.scss +72 -0
- data/lib/sass/lesli/elements/avatar.scss +48 -0
- data/lib/sass/lesli/elements/calendar.scss +47 -0
- data/lib/sass/lesli/elements/card.scss +37 -0
- data/lib/sass/lesli/elements/content.scss +37 -0
- data/lib/sass/lesli/elements/empty.scss +43 -0
- data/lib/sass/lesli/elements/file-uploader.scss +74 -0
- data/lib/sass/lesli/elements/form.scss +43 -0
- data/lib/sass/lesli/elements/gallery.scss +98 -0
- data/lib/sass/lesli/elements/header.scss +44 -0
- data/lib/sass/lesli/elements/input-tag.scss +73 -0
- data/lib/sass/lesli/elements/loading.scss +63 -0
- data/lib/sass/lesli/elements/map.scss +107 -0
- data/lib/sass/lesli/elements/msg.scss +77 -0
- data/lib/sass/lesli/elements/navbar.scss +115 -0
- data/lib/sass/lesli/elements/panel.scss +65 -0
- data/lib/sass/lesli/elements/tab.scss +48 -0
- data/lib/sass/lesli/elements/table.scss +118 -0
- data/lib/sass/lesli/elements/toggle.scss +102 -0
- data/lib/sass/lesli/elements/toolbar.scss +66 -0
- data/lib/sass/lesli/fonts/families.scss +47 -0
- data/lib/sass/lesli/fonts/mdicons.scss +84 -0
- data/lib/sass/lesli/fonts/remixicons.scss +2602 -0
- data/lib/sass/lesli/helpers/display.scss +44 -0
- data/lib/sass/lesli/helpers/tooltip.scss +91 -0
- data/lib/sass/lesli/layouts/application-announcements.scss +40 -0
- data/lib/sass/lesli/layouts/application-component.scss +50 -0
- data/lib/sass/lesli/layouts/application-engines.scss +155 -0
- data/lib/sass/lesli/layouts/application-footer.scss +102 -0
- data/lib/sass/lesli/layouts/application-header.scss +152 -0
- data/lib/sass/lesli/layouts/application-navbar.scss +61 -0
- data/lib/sass/lesli/layouts/application-search.scss +71 -0
- data/lib/sass/lesli/layouts/application-sidebar.scss +219 -0
- data/lib/sass/lesli/overrides/sweetalert.scss +106 -0
- data/lib/sass/lesli/pages/dashboards.scss +57 -0
- data/lib/sass/lesli/pages/invites.scss +81 -0
- data/lib/sass/lesli/pages/mfas.scss +36 -0
- data/lib/sass/lesli/pages/otps.scss +36 -0
- data/lib/sass/lesli/pages/passes.scss +35 -0
- data/lib/sass/lesli/panels/panel-announcements.scss +56 -0
- data/lib/sass/lesli/panels/panel-notification.scss +67 -0
- data/lib/sass/lesli/panels/panel-profile.scss +62 -0
- data/lib/sass/lesli/panels/panel-tasks.scss +41 -0
- data/lib/sass/lesli/panels/panel-ticket.scss +57 -0
- data/lib/sass/lesli/settings/variables.scss +148 -0
- data/lib/sass/lesli/shared/workflow-status-progress.scss +135 -0
- data/lib/sass/lesli/templates/application.scss +141 -0
- data/lib/sass/lesli/templates/dashboards.scss +32 -0
- data/lib/sass/lesli/templates/devise.scss +185 -0
- data/lib/sass/lesli/templates/empty.scss +42 -0
- data/lib/sass/lesli/templates/pdf.scss +45 -0
- data/lib/sass/lesli/templates/public.scss +71 -0
- data/lib/tasks/db.rb +75 -0
- data/lib/tasks/lesli/controllers.rake +103 -0
- data/lib/tasks/lesli_tasks.rake +23 -0
- data/lib/vue/application.js +269 -0
- data/lib/vue/apps/cloudobjects/action.vue +193 -0
- data/lib/vue/apps/cloudobjects/discussion/content.vue +60 -0
- data/lib/vue/apps/cloudobjects/discussion/element.vue +132 -0
- data/lib/vue/apps/cloudobjects/discussion/filters.vue +108 -0
- data/lib/vue/apps/cloudobjects/discussion/new.vue +130 -0
- data/lib/vue/apps/cloudobjects/discussion.vue +98 -0
- data/lib/vue/apps/cloudobjects/file/grid.vue +215 -0
- data/lib/vue/apps/cloudobjects/file/list.vue +106 -0
- data/lib/vue/apps/cloudobjects/file.vue +145 -0
- data/lib/vue/apps/dashboards/apps/edit.vue +105 -0
- data/lib/vue/apps/dashboards/apps/index.vue +114 -0
- data/lib/vue/apps/dashboards/apps/new.vue +89 -0
- data/lib/vue/apps/dashboards/apps/show.vue +76 -0
- data/lib/vue/apps/dashboards/components/form.vue +267 -0
- data/lib/vue/apps/dashboards/components/preview.vue +172 -0
- data/lib/vue/apps/workflows2/apps/actions/form.vue +232 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/chatroom-form.vue +103 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/cloud-object-clone-form.vue +125 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/cloud-object-file-form.vue +102 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/email-form.vue +190 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/notification-form.vue +124 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/send-cloud-object-file.vue +170 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/task-form.vue +258 -0
- data/lib/vue/apps/workflows2/apps/actions/index.vue +146 -0
- data/lib/vue/apps/workflows2/apps/checks/form.vue +200 -0
- data/lib/vue/apps/workflows2/apps/checks/index.vue +160 -0
- data/lib/vue/apps/workflows2/apps/index.vue +177 -0
- data/lib/vue/apps/workflows2/apps/new.vue +97 -0
- data/lib/vue/apps/workflows2/apps/show.vue +146 -0
- data/lib/vue/apps/workflows2/components/associations.vue +215 -0
- data/lib/vue/apps/workflows2/components/chart.vue +91 -0
- data/lib/vue/apps/workflows2/components/workflow-form.vue +466 -0
- data/lib/vue/apps/workflows2/components/workflow-status-dropdown.vue +129 -0
- data/lib/vue/devise/confirmations.js +33 -0
- data/lib/vue/devise/passwords.js +137 -0
- data/lib/vue/devise/registrations.js +162 -0
- data/lib/vue/devise/sessions.js +143 -0
- data/lib/vue/layouts/application-announcements.vue +78 -0
- data/lib/vue/layouts/application-engines.vue +66 -0
- data/lib/vue/layouts/application-footer.vue +123 -0
- data/lib/vue/layouts/application-header.vue +213 -0
- data/lib/vue/layouts/application-navbar.vue +110 -0
- data/lib/vue/layouts/application-search.vue +86 -0
- data/lib/vue/layouts/application-sidebar.vue +63 -0
- data/lib/vue/layouts/dashboard-component.vue +62 -0
- data/lib/vue/pages/errors/app.js +32 -0
- data/lib/vue/pages/invites/app.js +76 -0
- data/lib/vue/pages/mfas/application.js +77 -0
- data/lib/vue/pages/onboarding/application.js +45 -0
- data/lib/vue/pages/onboarding/components/address.vue +120 -0
- data/lib/vue/pages/onboarding/components/buttons.vue +67 -0
- data/lib/vue/pages/onboarding/components/contact.vue +148 -0
- data/lib/vue/pages/onboarding/components/date-time.vue +265 -0
- data/lib/vue/pages/onboarding/components/finish.vue +62 -0
- data/lib/vue/pages/onboarding/components/general-info.vue +93 -0
- data/lib/vue/pages/onboarding/components/indicators.vue +78 -0
- data/lib/vue/pages/onboarding/components/welcome.vue +66 -0
- data/lib/vue/pages/onboarding/show.vue +67 -0
- data/lib/vue/pages/onboarding/store.js +165 -0
- data/lib/vue/pages/otps/application.js +90 -0
- data/lib/vue/pages/passes/application.js +80 -0
- data/lib/vue/pages/websites/application.js +34 -0
- data/lib/vue/panels/panel-announcements.vue +248 -0
- data/lib/vue/panels/panel-files.vue +281 -0
- data/lib/vue/panels/panel-notifications.vue +106 -0
- data/lib/vue/panels/panel-profile.vue +76 -0
- data/lib/vue/panels/panel-tasks.vue +124 -0
- data/lib/vue/panels/panel-tickets.vue +181 -0
- data/lib/vue/public.js +85 -0
- data/lib/vue/stores/announcements.js +75 -0
- data/lib/vue/stores/cloud-bell/notification.js +114 -0
- data/lib/vue/stores/cloudobjects/action.js +181 -0
- data/lib/vue/stores/cloudobjects/discussion.js +221 -0
- data/lib/vue/stores/cloudobjects/file.js +205 -0
- data/lib/vue/stores/dashboard.js +251 -0
- data/lib/vue/stores/firebase.js +163 -0
- data/lib/vue/stores/layout.js +60 -0
- data/lib/vue/stores/panels/announcements.js +153 -0
- data/lib/vue/stores/panels/task.js +66 -0
- data/lib/vue/stores/panels/tickets.js +129 -0
- data/lib/vue/stores/profile.js +90 -0
- data/lib/vue/stores/search.js +154 -0
- data/lib/vue/stores/services/translator.js +87 -0
- data/lib/vue/stores/workflow.js +185 -0
- data/lib/vue/stores/workflow2.js +345 -0
- data/lib/vue/stores/workflows/actions.js +327 -0
- data/lib/vue/stores/workflows/associations.js +130 -0
- data/lib/vue/stores/workflows/checks.js +210 -0
- data/lib/webpack/base.js +182 -0
- data/lib/webpack/core.js +80 -0
- data/lib/webpack/engines.js +162 -0
- data/license +674 -0
- data/readme.md +120 -0
- metadata +554 -0
@@ -0,0 +1,349 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Your Smart Business Assistant.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
|
32
|
+
=end
|
33
|
+
|
34
|
+
module Lesli
|
35
|
+
module NavigationHelper
|
36
|
+
# Prints a html link inside a list item
|
37
|
+
def navigation_item(path, label, icon = nil, reload: false)
|
38
|
+
# default vue router links for single page applications
|
39
|
+
html_element = "router-link"
|
40
|
+
html_options = { to: path }
|
41
|
+
|
42
|
+
# if reload is nedeed, we use a standard "a" tag
|
43
|
+
if reload
|
44
|
+
html_element = "a"
|
45
|
+
html_options = { href: path }
|
46
|
+
end
|
47
|
+
|
48
|
+
content_tag(:li) do
|
49
|
+
content_tag(html_element, html_options) do
|
50
|
+
# print a simple menu item (without icon)
|
51
|
+
concat content_tag(:span, label, class: "text iconless") unless icon
|
52
|
+
|
53
|
+
# print a full menu item if icon was requested
|
54
|
+
if icon
|
55
|
+
concat content_tag("span", nil, class: [icon, "icono"])
|
56
|
+
concat content_tag(:span, label, class: "text")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Prints a separator line
|
63
|
+
def navigation_separator
|
64
|
+
content_tag(:li) do
|
65
|
+
content_tag(:hr)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# 00.00 System administration
|
70
|
+
def navigation_engine_admin(title: "Administration", subtitle: "Users, privileges, access roles.")
|
71
|
+
navigation_engine_item(title, subtitle, "admin", lesli_admin.root_path, controller_path.include?("lesli_admin"))
|
72
|
+
end
|
73
|
+
|
74
|
+
# ADMINISTRATION
|
75
|
+
|
76
|
+
# 01.01 Team engine
|
77
|
+
def navigation_engine_team(title: "Team", subtitle: "Human Resources Management")
|
78
|
+
return unless defined? CloudTeam
|
79
|
+
|
80
|
+
navigation_engine_item(title, subtitle, "team", cloud_team.root_path,
|
81
|
+
controller_path.include?("cloud_team"))
|
82
|
+
end
|
83
|
+
|
84
|
+
# SALES & MARKETING
|
85
|
+
|
86
|
+
# 02.03 Drop engine
|
87
|
+
def navigation_engine_word(title: "Word", subtitle: "Content Management System")
|
88
|
+
return unless defined? CloudWord
|
89
|
+
|
90
|
+
navigation_engine_item(title, subtitle, "word", cloud_word.root_path,
|
91
|
+
controller_path.include?("cloud_word"))
|
92
|
+
end
|
93
|
+
|
94
|
+
# 02.04 House engine
|
95
|
+
def navigation_engine_house(title: "House", subtitle: "cloud_house/house-logo.svg")
|
96
|
+
return unless defined? CloudHouse
|
97
|
+
|
98
|
+
navigation_engine_item(title, subtitle, "house", cloud_house.root_path,
|
99
|
+
controller_path.include?("cloud_house"))
|
100
|
+
end
|
101
|
+
|
102
|
+
# 02.05 Mailer engine
|
103
|
+
def navigation_engine_mailer(title: "Mailer", subtitle: "Email automation system")
|
104
|
+
return unless defined? CloudMailer
|
105
|
+
|
106
|
+
navigation_engine_item(title, subtitle, "mailer", cloud_mailer.root_path,
|
107
|
+
controller_path.include?("cloud_mailer"))
|
108
|
+
end
|
109
|
+
|
110
|
+
# 02.08 Proposal engine
|
111
|
+
def navigation_engine_proposal(title: "Proposal", subtitle: "cloud_proposal/proposal-logo.svg")
|
112
|
+
return unless defined? CloudProposal
|
113
|
+
|
114
|
+
navigation_engine_item(title, subtitle, "proposal", cloud_proposal.root_path,
|
115
|
+
controller_path.include?("cloud_proposal"))
|
116
|
+
end
|
117
|
+
|
118
|
+
# PRODUCTIVITY & TEAMWORK
|
119
|
+
|
120
|
+
# 03.01 Driver engine
|
121
|
+
def navigation_engine_driver(title: "Driver", subtitle: "Calendar")
|
122
|
+
return unless defined? CloudDriver
|
123
|
+
|
124
|
+
navigation_engine_item(title, subtitle, "driver", cloud_driver.root_path,
|
125
|
+
controller_path.include?("cloud_driver"))
|
126
|
+
end
|
127
|
+
|
128
|
+
# 03.02 Work engine
|
129
|
+
def navigation_engine_work(title: "Work", subtitle: "Dynamic Project Management")
|
130
|
+
return unless defined? CloudWork
|
131
|
+
|
132
|
+
navigation_engine_item(title, subtitle, "work", cloud_work.root_path,
|
133
|
+
controller_path.include?("cloud_work"))
|
134
|
+
end
|
135
|
+
|
136
|
+
# 03.03 Focus engine
|
137
|
+
def navigation_engine_focus(title: "Tasks", subtitle: "Task Management")
|
138
|
+
return unless defined? CloudFocus
|
139
|
+
|
140
|
+
navigation_engine_item(title, subtitle, "focus", cloud_focus.root_path,
|
141
|
+
controller_path.include?("cloud_focus"))
|
142
|
+
end
|
143
|
+
|
144
|
+
# 03.05 Text engine
|
145
|
+
def navigation_engine_text(title: "Text", subtitle: "cloud_text/text-logo.svg")
|
146
|
+
return unless defined? CloudText
|
147
|
+
|
148
|
+
navigation_engine_item(title, subtitle, "text", cloud_text.root_path,
|
149
|
+
controller_path.include?("cloud_text"))
|
150
|
+
end
|
151
|
+
|
152
|
+
# 03.07 Social engine
|
153
|
+
def navigation_engine_social(title: "Social", subtitle: "Team social network")
|
154
|
+
return unless defined? CloudSocial
|
155
|
+
|
156
|
+
navigation_engine_item(title, subtitle, "social", cloud_social.root_path,
|
157
|
+
controller_path.include?("cloud_social"))
|
158
|
+
end
|
159
|
+
|
160
|
+
# 03.08 Bell engine
|
161
|
+
def navigation_engine_bell(title: "Notifications", subtitle: "Announcements and notifications")
|
162
|
+
return unless defined? LesliBell
|
163
|
+
|
164
|
+
navigation_engine_item(title, subtitle, "bell", lesli_bell.root_path,
|
165
|
+
controller_path.include?("lesli_bell"))
|
166
|
+
end
|
167
|
+
|
168
|
+
# 03.09 Time engine
|
169
|
+
def navigation_engine_time(title: "Time managment", subtitle: "Track your time")
|
170
|
+
return unless defined? CloudTime
|
171
|
+
|
172
|
+
navigation_engine_item(title, subtitle, "time", cloud_time.root_path,
|
173
|
+
controller_path.include?("cloud_time"))
|
174
|
+
end
|
175
|
+
|
176
|
+
# 03.10 Talk engine
|
177
|
+
def navigation_engine_talk(title: "Talk", subtitle: "Real-time communication")
|
178
|
+
return unless defined? CloudTalk
|
179
|
+
|
180
|
+
navigation_engine_item(title, subtitle, "talk", cloud_talk.root_path,
|
181
|
+
controller_path.include?("cloud_talk"))
|
182
|
+
end
|
183
|
+
|
184
|
+
# 03.11 Storage engine
|
185
|
+
def navigation_engine_storage(title: "Storage", subtitle: "Cloud files management")
|
186
|
+
return unless defined? CloudStorage
|
187
|
+
|
188
|
+
navigation_engine_item(title, subtitle, "storage", cloud_storage.root_path,
|
189
|
+
controller_path.include?("cloud_storage"))
|
190
|
+
end
|
191
|
+
|
192
|
+
# FINANCE
|
193
|
+
|
194
|
+
# 04.01 Books engine
|
195
|
+
def navigation_engine_books(title: "Books", subtitle: "cloud_books/books-logo.svg")
|
196
|
+
return unless defined? CloudBooks
|
197
|
+
|
198
|
+
navigation_engine_item(title, subtitle, "books", cloud_books.root_path,
|
199
|
+
controller_path.include?("cloud_books"))
|
200
|
+
end
|
201
|
+
|
202
|
+
# 04.03 Things engine
|
203
|
+
def navigation_engine_things(title: "Things", subtitle: "cloud_things/things-logo.svg")
|
204
|
+
return unless defined? CloudThings
|
205
|
+
|
206
|
+
navigation_engine_item(title, subtitle, "things", cloud_things.root_path,
|
207
|
+
controller_path.include?("cloud_things"))
|
208
|
+
end
|
209
|
+
|
210
|
+
# 04.05 Realty engine
|
211
|
+
def navigation_engine_realty(title: "Realty", subtitle: "cloud_realty/realty-logo.svg")
|
212
|
+
return unless defined? CloudRealty
|
213
|
+
|
214
|
+
navigation_engine_item(title, subtitle, "realty", cloud_realty.root_path,
|
215
|
+
controller_path.include?("cloud_realty"))
|
216
|
+
end
|
217
|
+
|
218
|
+
# ANALYTICS
|
219
|
+
|
220
|
+
# 05.04 Insights engine
|
221
|
+
def navigation_engine_insights(title: "Insights", subtitle: "cloud_insights/insights-logo.svg")
|
222
|
+
return unless defined? CloudInsights
|
223
|
+
|
224
|
+
navigation_engine_item(title, subtitle, "insights", cloud_insights.root_path,
|
225
|
+
controller_path.include?("cloud_insights"))
|
226
|
+
end
|
227
|
+
|
228
|
+
# INTELLIGENCE
|
229
|
+
|
230
|
+
# 06.06 Scraper engine
|
231
|
+
def navigation_engine_scraper(title: "Scraper", subtitle: "Scraper")
|
232
|
+
return unless defined? CloudScraper
|
233
|
+
|
234
|
+
navigation_engine_item(title, subtitle, "scraper", cloud_scraper.root_path,
|
235
|
+
controller_path.include?("cloud_scraper"))
|
236
|
+
end
|
237
|
+
|
238
|
+
# IT & HELP DESK
|
239
|
+
|
240
|
+
# 07.01 Kb engine
|
241
|
+
def navigation_engine_kb(title: "Kb", subtitle: "cloud_kb/kb-logo.svg")
|
242
|
+
return unless defined? CloudKb
|
243
|
+
|
244
|
+
navigation_engine_item(title, subtitle, "kb", cloud_kb.root_path, controller_path.include?("cloud_kb"))
|
245
|
+
end
|
246
|
+
|
247
|
+
# 07.02 Help engine
|
248
|
+
def navigation_engine_help(title: "Help", subtitle: "Support Ticket System")
|
249
|
+
return unless defined? CloudHelp
|
250
|
+
|
251
|
+
navigation_engine_item(title, subtitle, "help", cloud_help.root_path,
|
252
|
+
controller_path.include?("cloud_help"))
|
253
|
+
end
|
254
|
+
|
255
|
+
# 07.03 Portal engine
|
256
|
+
def navigation_engine_portal(title: "Portal", subtitle: "cloud_portal/portal-logo.svg")
|
257
|
+
return unless defined? CloudPortal
|
258
|
+
|
259
|
+
navigation_engine_item(title, subtitle, "portal", cloud_portal.root_path,
|
260
|
+
controller_path.include?("cloud_portal"))
|
261
|
+
end
|
262
|
+
|
263
|
+
# 07.05 Shared engine
|
264
|
+
def navigation_engine_shared(title: "Shared", subtitle: "Shared & Open resources")
|
265
|
+
return unless defined? CloudShared
|
266
|
+
|
267
|
+
navigation_engine_item(title, subtitle, "shared", cloud_shared.root_path,
|
268
|
+
controller_path.include?("cloud_shared"))
|
269
|
+
end
|
270
|
+
|
271
|
+
# SECURITY & PRIVACY
|
272
|
+
|
273
|
+
# 08.01 Vault engine
|
274
|
+
def navigation_engine_vault(title: "Vault", subtitle: "")
|
275
|
+
return unless defined? LesliVault
|
276
|
+
|
277
|
+
navigation_engine_item(title, subtitle, "vault", lesli_vault.root_path,
|
278
|
+
controller_path.include?("lesli_vault"))
|
279
|
+
end
|
280
|
+
|
281
|
+
# 08.03 Audit engine
|
282
|
+
def navigation_engine_audit(title: "Audit", subtitle: "Activity, logs, security and more")
|
283
|
+
return unless defined? CloudAudit
|
284
|
+
|
285
|
+
navigation_engine_item(title, subtitle, "audit", cloud_audit.root_path,
|
286
|
+
controller_path.include?("cloud_audit"))
|
287
|
+
end
|
288
|
+
|
289
|
+
# INTEGRATIONS
|
290
|
+
|
291
|
+
# 09.01 Babel engine
|
292
|
+
def navigation_engine_babel(title: "Babel", subtitle: "Translations")
|
293
|
+
return unless defined? LesliBabel
|
294
|
+
|
295
|
+
navigation_engine_item(title, subtitle, "babel", lesli_babel.root_path,
|
296
|
+
controller_path.include?("lesli_babel"))
|
297
|
+
end
|
298
|
+
|
299
|
+
# 09.02 Dispatcher engine
|
300
|
+
def navigation_engine_dispatcher(title: "Dispatcher", subtitle: "cloud_dispatcher/dispatcher-logo.svg")
|
301
|
+
return unless defined? CloudDispatcher
|
302
|
+
|
303
|
+
navigation_engine_item(title, subtitle, "api", cloud_dispatcher.root_path,
|
304
|
+
controller_path.include?("cloud_dispatcher"))
|
305
|
+
end
|
306
|
+
|
307
|
+
# 09.03 Federation engine
|
308
|
+
def navigation_engine_federation(title: "Federation", subtitle: "cloud_federation/federation-logo.svg")
|
309
|
+
return unless defined? CloudFederation
|
310
|
+
|
311
|
+
navigation_engine_item(title, subtitle, "federation", cloud_federation.root_path,
|
312
|
+
controller_path.include?("cloud_federation"))
|
313
|
+
end
|
314
|
+
|
315
|
+
# 09.04 One engine
|
316
|
+
def navigation_engine_one(title: "One", subtitle: "Cloud Enterprise Resource Management")
|
317
|
+
return unless defined? CloudOne
|
318
|
+
|
319
|
+
navigation_engine_item(title, subtitle, "one", cloud_one.root_path,
|
320
|
+
controller_path.include?("cloud_one"))
|
321
|
+
end
|
322
|
+
|
323
|
+
# 09.06 Development engine
|
324
|
+
def navigation_engine_development(title: "Dev", subtitle: "Development notes")
|
325
|
+
return unless defined? CloudDevelopment
|
326
|
+
|
327
|
+
navigation_engine_item(title, subtitle, "development", cloud_development.root_path,
|
328
|
+
controller_path.include?("cloud_development"))
|
329
|
+
end
|
330
|
+
|
331
|
+
private
|
332
|
+
|
333
|
+
# build a html link for an engine path
|
334
|
+
def navigation_engine_item(title, subtitle, icon, path, is_active)
|
335
|
+
# get hidden modules if there are modules to hide
|
336
|
+
modules_hidden = [] # Rails.application.config.lesli.dig(:modules_hidden) || []
|
337
|
+
|
338
|
+
# stop rendering module navigation if need to hide the module
|
339
|
+
return nil if modules_hidden.include?(path)
|
340
|
+
|
341
|
+
# render module navigation item :)
|
342
|
+
content_tag(:a, href: path, class: is_active ? "is-active" : nil) do
|
343
|
+
lesli_svg("cloud-#{icon}") << content_tag(:div) do
|
344
|
+
content_tag(:span, title) << content_tag(:p, subtitle)
|
345
|
+
end
|
346
|
+
end
|
347
|
+
end
|
348
|
+
end
|
349
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.dev
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
33
|
+
module Lesli
|
34
|
+
module SystemHelper
|
35
|
+
# return the engine code of the controller that is handling the http request
|
36
|
+
def lesli_controller
|
37
|
+
controller_path.split("/")[0]
|
38
|
+
end
|
39
|
+
|
40
|
+
# retun the code of the instance builder engine
|
41
|
+
# example: lesli_cloud, deutsche_leibrenten, mitwerken_cloud
|
42
|
+
def lesli_instance_code
|
43
|
+
return "lesli"
|
44
|
+
Lesli::System.instance[:code]
|
45
|
+
end
|
46
|
+
|
47
|
+
# return the information about the current engine
|
48
|
+
def lesli_engine(property = nil)
|
49
|
+
Lesli::System.engine(lesli_controller.camelize, property)
|
50
|
+
end
|
51
|
+
|
52
|
+
# return true if the controller requested belongs to the administration area
|
53
|
+
def is_lesli_onboarding?
|
54
|
+
lesli_controller == "onboardings"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/app/lib/date2.rb
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
33
|
+
class Date2
|
34
|
+
|
35
|
+
def initialize(datetime = Time.current, format = "%Y-%m-%d %H:%M:%S")
|
36
|
+
|
37
|
+
# NOTE: user should be able to change this through settings table
|
38
|
+
# get initial datetime configuration
|
39
|
+
config = Lesli.config.datetime
|
40
|
+
|
41
|
+
|
42
|
+
# NOTE: Do not modify settings here,
|
43
|
+
# if you need a different date format you should change it in the config file
|
44
|
+
# Check the docs for more information: /development/docs/rails-lib-time
|
45
|
+
|
46
|
+
# configuration example
|
47
|
+
# @settings = {
|
48
|
+
# :time_zone => config[:time_zone],
|
49
|
+
# :start_week_on => config[:start_week_on],
|
50
|
+
# :format => {
|
51
|
+
# :date => "%d.%m.%Y",
|
52
|
+
# :time => "%H:%M %p", # 12 hours datetime format
|
53
|
+
# :time => "%H:%M", # 24 hours datetime format (default)
|
54
|
+
# :date_time => "%d.%m.%Y %I:%M %p", # 12 hours datetime format
|
55
|
+
# :date_time => "%d.%m.%Y %H:%M", # 24 hours datetime format (default)
|
56
|
+
# :date_words => "%A, %B %d, %Y",
|
57
|
+
# :date_time_words => "%A, %B %d, %Y, %I:%M %p", # 12 hours datetime in words format
|
58
|
+
# :date_time_words => "%A, %B %d, %Y, %H:%M" # 24 hours datetime in words format (default)
|
59
|
+
# }
|
60
|
+
# }
|
61
|
+
|
62
|
+
@settings = {
|
63
|
+
:time_zone => config[:time_zone],
|
64
|
+
:start_week_on => config[:start_week_on],
|
65
|
+
:format => {
|
66
|
+
:date => "%d.%m.%Y",
|
67
|
+
:time => "%H:%M",
|
68
|
+
:date_time => config[:formats][:date_time],
|
69
|
+
:date_words => "%A, %B %d, %Y",
|
70
|
+
:date_time_words => "%A, %B %d, %Y, %I:%M %p", # 12 hours datetime in words format
|
71
|
+
:date_time_words => "%A, %B %d, %Y, %H:%M" # 24 hours datetime in words format (default)
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
|
76
|
+
# default date format
|
77
|
+
@format = set_format(:date)
|
78
|
+
|
79
|
+
|
80
|
+
# get a valid timezone
|
81
|
+
@zone = ActiveSupport::TimeZone.new(@settings[:time_zone])
|
82
|
+
|
83
|
+
|
84
|
+
# get datetime object from user params
|
85
|
+
@datetime = parse_initial_datetime(datetime, format).in_time_zone(@zone)
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
# set date format and return Date2 instance
|
90
|
+
def date
|
91
|
+
set_format(:date)
|
92
|
+
self
|
93
|
+
end
|
94
|
+
|
95
|
+
# set time format and return Date2 instance
|
96
|
+
def time
|
97
|
+
set_format(:time)
|
98
|
+
self
|
99
|
+
end
|
100
|
+
|
101
|
+
# set date_time format and return Date2 instance
|
102
|
+
def date_time
|
103
|
+
set_format(:date_time)
|
104
|
+
self
|
105
|
+
end
|
106
|
+
|
107
|
+
# set date_words format and return Date2 instance
|
108
|
+
def date_words
|
109
|
+
set_format(:date_words)
|
110
|
+
self
|
111
|
+
end
|
112
|
+
|
113
|
+
# set date_time_words format and return Date2 instance
|
114
|
+
def date_time_words
|
115
|
+
set_format(:date_time_words)
|
116
|
+
self
|
117
|
+
end
|
118
|
+
|
119
|
+
# return query string to get timestamps columns from database
|
120
|
+
def db_timestamps table=""
|
121
|
+
|
122
|
+
# avoid ambiguous columns
|
123
|
+
table = table.concat(".") if table != ""
|
124
|
+
|
125
|
+
# get right format for dates
|
126
|
+
format = self.db_format
|
127
|
+
|
128
|
+
"TO_CHAR(#{table}created_at at time zone 'utc' at time zone '#{@settings[:time_zone]}', '#{format}') as created_at_date, TO_CHAR(#{table}updated_at at time zone 'utc' at time zone '#{@settings[:time_zone]}', '#{format}') as updated_at_date"
|
129
|
+
|
130
|
+
end
|
131
|
+
|
132
|
+
# return query string to get a datetime column from database
|
133
|
+
def db_column column, table=""
|
134
|
+
|
135
|
+
# avoid ambiguous columns
|
136
|
+
table = table.concat(".") if table != ""
|
137
|
+
|
138
|
+
# get right format for dates
|
139
|
+
format = self.db_format
|
140
|
+
|
141
|
+
"TO_CHAR(#{table}#{column} at time zone 'utc' at time zone '#{@settings[:time_zone]}', '#{format}') as #{column}_string"
|
142
|
+
|
143
|
+
end
|
144
|
+
|
145
|
+
# convert a datetime object to string representation using defined format
|
146
|
+
def to_s
|
147
|
+
@datetime.strftime(@format)
|
148
|
+
end
|
149
|
+
|
150
|
+
def get
|
151
|
+
@datetime
|
152
|
+
end
|
153
|
+
|
154
|
+
private
|
155
|
+
|
156
|
+
|
157
|
+
# get datetime object or string datetime and return a datetime object
|
158
|
+
def parse_initial_datetime datetime, format
|
159
|
+
|
160
|
+
return datetime if datetime.is_a?(Time)
|
161
|
+
|
162
|
+
if datetime.is_a?(::String) and datetime.size == 25 and datetime[10] == "T"
|
163
|
+
return ::DateTime.iso8601(datetime)
|
164
|
+
end
|
165
|
+
|
166
|
+
return ::DateTime.strptime(datetime, format)
|
167
|
+
end
|
168
|
+
|
169
|
+
|
170
|
+
def set_format format
|
171
|
+
@format = @settings[:format][format || :date]
|
172
|
+
end
|
173
|
+
|
174
|
+
|
175
|
+
def db_format
|
176
|
+
format = @format
|
177
|
+
|
178
|
+
# Convert Ruby to postgresql date format
|
179
|
+
format = format.gsub("%Y", "YYYY")
|
180
|
+
format = format.gsub("%m", "MM")
|
181
|
+
format = format.gsub("%d", "DD")
|
182
|
+
|
183
|
+
# Convert Ruby to postgresql time format
|
184
|
+
format = format.gsub("%H", "HH24") # 24 hours format
|
185
|
+
format = format.gsub("%I", "HH12") # 12 hours format
|
186
|
+
format = format.gsub("%p", "AM") # Meridian indicator (AM/PM)
|
187
|
+
format = format.gsub("%M", "MI")
|
188
|
+
|
189
|
+
format
|
190
|
+
end
|
191
|
+
|
192
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Your Smart Business Assistant.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
|
32
|
+
=end
|
33
|
+
|
34
|
+
module Lesli
|
35
|
+
class System
|
36
|
+
ENGINES = {}
|
37
|
+
|
38
|
+
# engine("LesliAdmin")
|
39
|
+
# engine("LesliAdmin", "name")
|
40
|
+
def self.engine(engine, property=nil)
|
41
|
+
|
42
|
+
engines() if ENGINES.empty?
|
43
|
+
|
44
|
+
# return specific property if requested
|
45
|
+
return ENGINES[engine][property] unless property.blank?
|
46
|
+
|
47
|
+
# return the engine info
|
48
|
+
return ENGINES[engine]
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.engines
|
52
|
+
|
53
|
+
return ENGINES unless ENGINES.empty?
|
54
|
+
|
55
|
+
# due we do not know the engine mounted path we have to look up for it every
|
56
|
+
# time we load the html view so we can use the dynamic route from the main rails app
|
57
|
+
# we use this in the url plugin
|
58
|
+
["Lesli", "LesliAdmin", "LesliBabel"].each do |engine|
|
59
|
+
next unless Object.const_defined?(engine)
|
60
|
+
ENGINES[engine]= {
|
61
|
+
:code => engine.underscore,
|
62
|
+
:name => lesli_engine_name(engine),
|
63
|
+
:path => "#{engine}::Engine".constantize.routes.find_script_name({}),
|
64
|
+
:dir => Gem::Specification.find_by_name(engine.underscore).gem_dir
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
ENGINES
|
69
|
+
end
|
70
|
+
|
71
|
+
private
|
72
|
+
|
73
|
+
# Prints the name of the engine
|
74
|
+
def self.lesli_engine_name engine
|
75
|
+
name = engine.camelcase
|
76
|
+
return "Lesli" if name == "Lesli"
|
77
|
+
name.sub("Lesli", "")
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|