lesli 5.0.1 → 5.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/lesli_manifest.js +7 -4
  3. data/app/assets/fonts/lesli/Domine/Domine-VariableFont_wght.ttf +0 -0
  4. data/app/assets/fonts/lesli/Domine/OFL.txt +2 -0
  5. data/app/assets/javascripts/lesli/users/passwords.js +776 -0
  6. data/app/assets/javascripts/lesli/users/registrations.js +776 -0
  7. data/app/assets/javascripts/lesli/users/sessions.js +776 -1
  8. data/app/assets/stylesheets/lesli/users/passwords.scss +5 -6
  9. data/app/assets/stylesheets/lesli/users/registrations.scss +5 -6
  10. data/app/assets/stylesheets/lesli/users/sessions.scss +5 -10
  11. data/app/controllers/lesli/application_lesli_controller.rb +0 -1
  12. data/app/controllers/lesli/interfaces/application/logger.rb +9 -9
  13. data/app/controllers/lesli/roles_controller.rb +43 -0
  14. data/{lib/sass/lesli/devise/registrations.scss.erb → app/controllers/lesli/users_controller.rb} +18 -23
  15. data/app/controllers/users/registrations_controller.rb +137 -58
  16. data/app/helpers/lesli/assets_helper.rb +2 -2
  17. data/app/helpers/lesli/general_helper.rb +1 -1
  18. data/app/helpers/lesli/navigation_helper.rb +7 -10
  19. data/app/helpers/lesli/system_helper.rb +1 -1
  20. data/app/lib/lesli/system.rb +7 -3
  21. data/app/mailers/lesli/application_lesli_mailer.rb +199 -0
  22. data/app/mailers/lesli/application_mailer.rb +7 -0
  23. data/app/mailers/lesli/devise_mailer.rb +33 -0
  24. data/app/models/concerns/user_guard.rb +3 -4
  25. data/app/models/lesli/account.rb +29 -0
  26. data/{lib/sass/lesli/pages/passes.scss → app/models/lesli/descriptor.rb} +14 -8
  27. data/app/models/lesli/role.rb +90 -0
  28. data/app/models/lesli/system_controller.rb +1 -0
  29. data/app/models/lesli/user/detail.rb +55 -0
  30. data/{lib/sass/lesli/pages/otps.scss → app/models/lesli/user/role.rb} +13 -9
  31. data/app/models/lesli/user.rb +4 -3
  32. data/app/services/lesli/role_service.rb +45 -0
  33. data/app/services/lesli/user_service.rb +69 -0
  34. data/app/views/devise/passwords/new.html.erb +72 -12
  35. data/app/views/devise/registrations/new.html.erb +146 -28
  36. data/app/views/devise/sessions/new.html.erb +11 -78
  37. data/app/views/devise/shared/_links.html.erb +96 -25
  38. data/app/views/lesli/emails/devise_mailer/confirmation_instructions.html.erb +23 -0
  39. data/app/views/lesli/emails/user_mailer/invitation.html.erb +23 -0
  40. data/app/views/lesli/layouts/application-devise.html.erb +1 -1
  41. data/app/views/lesli/layouts/application-public.html.erb +2 -2
  42. data/app/views/lesli/layouts/mailer.html.erb +13 -0
  43. data/app/views/lesli/layouts/mailer.text.erb +1 -0
  44. data/app/views/lesli/partials/_application-lesli-header.html.erb +27 -41
  45. data/app/views/lesli/partials/_application-lesli-javascript.html.erb +10 -6
  46. data/app/views/lesli/partials/_application-public-javascript.html.erb +12 -8
  47. data/{lib/sass/lesli/devise/confirmations.scss.erb → app/views/lesli/wrappers/_application-devise-simple.erb} +30 -46
  48. data/app/views/lesli/wrappers/{_application-auth.html.erb → _application-devise.html.erb} +15 -0
  49. data/config/initializers/{lesli_defaults.rb → lesli.rb} +4 -2
  50. data/config/locales/translations.en.yml +7 -0
  51. data/config/locales/translations.es.yml +7 -0
  52. data/config/routes.rb +22 -17
  53. data/db/migrate/v1.0/0010000210_create_lesli_roles.rb +1 -1
  54. data/db/{tables/0010003010_create_user_details.rb → migrate/v1.0/0010003010_create_lesli_user_details.rb} +6 -6
  55. data/db/{tables/0010003510_create_user_roles.rb → migrate/v1.0/0010003410_create_lesli_user_roles.rb} +4 -4
  56. data/db/{tables/0010005010_create_descriptors.rb → migrate/v1.0/0010005010_create_lesli_descriptors.rb} +5 -6
  57. data/db/{tables/0010005110_create_descriptor_privileges.rb → migrate/v1.0/0010005110_create_lesli_descriptor_privileges.rb} +8 -7
  58. data/db/{tables/0010005210_create_descriptor_activities.rb → migrate/v1.0/0010005210_create_lesli_descriptor_activities.rb} +6 -8
  59. data/db/seeds.rb +0 -2
  60. data/lib/lesli/engine.rb +25 -2
  61. data/lib/lesli/routing.rb +26 -0
  62. data/lib/lesli/version.rb +2 -2
  63. data/lib/lesli.rb +1 -0
  64. data/lib/{sass/lesli/pages/mfas.scss → mailer_previews/devise_mailer_preview.rb} +12 -6
  65. data/lib/sass/lesli/bulma/loader.scss +3 -0
  66. data/lib/sass/lesli/elements/header.scss +1 -1
  67. data/lib/sass/lesli/fonts/families.scss +3 -3
  68. data/lib/sass/lesli/layouts/application-container.scss +4 -0
  69. data/lib/sass/lesli/{devise/passwords.scss.erb → pages/devise-simple.scss} +38 -38
  70. data/lib/sass/lesli/{templates → pages}/devise.scss +4 -26
  71. data/lib/sass/lesli/settings/variables.scss +1 -1
  72. data/lib/sass/lesli/templates/application.scss +8 -4
  73. data/lib/sass/lesli/templates/dashboards.scss +8 -0
  74. data/lib/sass/lesli/templates/public.scss +2 -3
  75. data/lib/tasks/lesli/controllers.rake +33 -0
  76. data/lib/tasks/lesli/db.rake +88 -0
  77. data/lib/tasks/lesli/git.rake +74 -0
  78. data/lib/tasks/lesli_tasks.rake +70 -20
  79. data/lib/vue/devise/registrations.js +10 -15
  80. data/lib/vue/layouts/application-container.vue +10 -2
  81. data/lib/vue/layouts/application-header.vue +10 -3
  82. data/lib/vue/stores/account.js +113 -0
  83. data/lib/vue/stores/role.js +243 -0
  84. data/lib/vue/stores/translations.json +86 -0
  85. data/lib/vue/stores/user.js +102 -0
  86. data/lib/{sass/lesli/devise/sessions.scss → vue/translation.js} +14 -5
  87. data/lib/webpack/base.js +2 -2
  88. data/lib/webpack/core.js +2 -0
  89. data/readme.md +74 -55
  90. metadata +196 -51
  91. data/app/assets/fonts/lesli/Domine/Domine-Bold.ttf +0 -0
  92. data/app/assets/fonts/lesli/Domine/Domine-Regular.ttf +0 -0
  93. data/app/assets/stylesheets/lesli/users/devise.scss +0 -32
  94. data/app/controllers/lesli/profiles_controller.rb +0 -60
  95. data/app/helpers/lesli/profiles_helper.rb +0 -4
  96. data/app/models/lesli/profile.rb +0 -4
  97. data/app/views/lesli/devise/sessions/_form.html.erb +0 -17
  98. data/app/views/lesli/devise/sessions/_session.html.erb +0 -2
  99. data/app/views/lesli/devise/sessions/edit.html.erb +0 -10
  100. data/app/views/lesli/devise/sessions/index.html.erb +0 -14
  101. data/app/views/lesli/devise/sessions/new.html.erb +0 -9
  102. data/app/views/lesli/devise/sessions/show.html.erb +0 -10
  103. data/app/views/lesli/profiles/_form.html.erb +0 -17
  104. data/app/views/lesli/profiles/_profile.html.erb +0 -2
  105. data/app/views/lesli/profiles/edit.html.erb +0 -10
  106. data/app/views/lesli/profiles/index.html.erb +0 -14
  107. data/app/views/lesli/profiles/new.html.erb +0 -9
  108. data/app/views/lesli/profiles/show.html.erb +0 -10
  109. data/lib/sass/lesli/pages/dashboards.scss +0 -57
  110. data/lib/tasks/db.rb +0 -76
  111. data/lib/vue/stores/profile.js +0 -90
  112. data/lib/vue/stores/workflow2.js +0 -345
  113. data/lib/vue/stores/workflows/actions.js +0 -327
  114. data/lib/vue/stores/workflows/associations.js +0 -130
  115. data/lib/vue/stores/workflows/checks.js +0 -210
  116. /data/lib/vue/stores/{announcements.js → entities/announcements.js} +0 -0
  117. /data/lib/vue/stores/{dashboard.js → entities/dashboard.js} +0 -0
  118. /data/lib/vue/stores/{workflow.js → entities/workflow.js} +0 -0
  119. /data/lib/vue/stores/{cloud-bell → panels}/notification.js +0 -0
  120. /data/lib/vue/stores/{firebase.js → services/firebase.js} +0 -0
data/lib/lesli/engine.rb CHANGED
@@ -30,14 +30,24 @@ Building a better future, one line of code at a time.
30
30
  // ·
31
31
  =end
32
32
 
33
+ # · Tools used to extend Rails functionality
34
+ require "kaminari"
35
+
36
+
37
+ # · Tools used to build the Lesli Framework
38
+ require "L2"
39
+ require "devise"
40
+ require "useragent"
41
+ require "flag-icons-rails"
42
+
33
43
  module Lesli
34
44
  class Engine < ::Rails::Engine
35
45
  isolate_namespace Lesli
36
46
 
37
47
  initializer :lesli do |app|
38
48
 
39
- # register assets manifest
40
- config.assets.precompile += %w[lesli_manifest.js]
49
+ # Lesli Framework configuration
50
+
41
51
 
42
52
  # Include lib/assets folder in the asset pipeline
43
53
  config.assets.paths << root.join("lib", "assets")
@@ -51,6 +61,19 @@ module Lesli
51
61
  config.i18n.default_locale = :en
52
62
  config.i18n.available_locales = [:en]
53
63
 
64
+ # Force to not use digest,
65
+ # if this is not false Rails will fingerprint the assets by default and precompile is needed
66
+ config.assets.digest = false
67
+
68
+ config.action_mailer.preview_path = root.join("lib", "mailer_previews")
69
+
70
+
71
+ # Lesli standard engine configuration
72
+
73
+
74
+ # register assets manifest
75
+ config.assets.precompile += %w[lesli_manifest.js]
76
+
54
77
  # register engine migrations path
55
78
  unless app.root.to_s.match root.to_s
56
79
  config.paths["db/migrate"].expanded.each do |expanded_path|
@@ -0,0 +1,26 @@
1
+ module Lesli
2
+ module Routing
3
+ def self.mount_login
4
+ mount_login_at()
5
+ end
6
+ def self.mount_login_at path=""
7
+ Rails.application.routes.draw do
8
+ devise_for :users, class_name: "Lesli::User", module: :devise,
9
+ :path => path,
10
+ :path_names => {
11
+ :sign_in => "login",
12
+ :sign_out => "logout",
13
+ :sign_up => "register",
14
+ :password => "password",
15
+ :confirmation => "confirmation"
16
+ },
17
+ :controllers => {
18
+ :registrations => "users/registrations",
19
+ :confirmations => "users/confirmations",
20
+ :passwords => "users/passwords",
21
+ :sessions => "users/sessions"
22
+ }
23
+ end
24
+ end
25
+ end
26
+ end
data/lib/lesli/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Lesli
2
- VERSION = "5.0.1"
3
- BUILD = "1696568414"
2
+ VERSION = "5.0.2"
3
+ BUILD = "1697000148"
4
4
  end
data/lib/lesli.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "lesli/configuration"
2
+ require "lesli/routing"
2
3
  require "lesli/version"
3
4
  require "lesli/engine"
4
5
 
@@ -1,4 +1,4 @@
1
- /*
1
+ =begin
2
2
 
3
3
  Lesli
4
4
 
@@ -17,7 +17,7 @@ GNU General Public License for more details.
17
17
  You should have received a copy of the GNU General Public License
18
18
  along with this program. If not, see http://www.gnu.org/licenses/.
19
19
 
20
- Lesli · Ruby on Rails SaaS development platform.
20
+ Lesli · Ruby on Rails SaaS Development Framework.
21
21
 
22
22
  Made with ♥ by https://www.lesli.tech
23
23
  Building a better future, one line of code at a time.
@@ -27,10 +27,16 @@ Building a better future, one line of code at a time.
27
27
  @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
28
 
29
29
  // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
- // ·
30
+ // ·
31
+ =end
31
32
 
32
- */
33
+ class DeviseMailerPreview < ActionMailer::Preview
33
34
 
35
+ def confirmation_instructions
36
+ record = Lesli::User.first
37
+ token = "abcdef12345"
38
+ opts = {}
39
+ Lesli::DeviseMailer.confirmation_instructions(record, token, opts)
40
+ end
34
41
 
35
- // ·
36
- @import "./base.scss";
42
+ end
@@ -53,6 +53,8 @@ $navbar-background-color: transparent;
53
53
  @import "bulma/sass/form/all";
54
54
 
55
55
  @import "bulma/sass/components/tabs";
56
+ @import "bulma/sass/components/media";
57
+ @import "bulma/sass/components/level";
56
58
  @import "bulma/sass/components/dropdown";
57
59
  @import "bulma/sass/components/pagination";
58
60
 
@@ -61,6 +63,7 @@ $navbar-background-color: transparent;
61
63
  @import "bulma/sass/elements/image";
62
64
  @import "bulma/sass/elements/title";
63
65
  @import "bulma/sass/elements/table";
66
+ @import "bulma/sass/elements/icon";
64
67
 
65
68
  @import "bulma/sass/grid/columns";
66
69
 
@@ -34,7 +34,7 @@ Building a better future, one line of code at a time.
34
34
 
35
35
  // ·
36
36
  .lesli-element-header {
37
- margin: 40px auto 30px;
37
+ margin: 30px auto 30px;
38
38
 
39
39
  .lesli-element-header-items {
40
40
  display: flex;
@@ -33,15 +33,15 @@ Building a better future, one line of code at a time.
33
33
 
34
34
  // · Font family for titles
35
35
  @font-face {
36
- font-family: "Montserrat";
37
- src: font-url("lesli/Montserrat/Montserrat-Variable.ttf") format("truetype");
36
+ font-family: "Domine";
37
+ src: font-url("lesli/Domine/Domine-VariableFont_wght.ttf") format("truetype");
38
38
  font-display: swap;
39
39
  }
40
40
 
41
41
 
42
42
  // · Font family for the body
43
43
  @font-face {
44
- font-family: "Open Sans";
44
+ font-family: "OpenSans";
45
45
  src: font-url("lesli/OpenSans/OpenSans-Variable.ttf") format("truetype");
46
46
  font-display: swap;
47
47
  }
@@ -29,3 +29,7 @@ Building a better future, one line of code at a time.
29
29
  // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
30
  // ·
31
31
  */
32
+
33
+ section.lesli-application-container {
34
+ padding: 1rem;
35
+ }
@@ -17,7 +17,7 @@ GNU General Public License for more details.
17
17
  You should have received a copy of the GNU General Public License
18
18
  along with this program. If not, see http://www.gnu.org/licenses/.
19
19
 
20
- Lesli · Ruby on Rails SaaS development platform.
20
+ Lesli · Ruby on Rails SaaS Development Framework.
21
21
 
22
22
  Made with ♥ by https://www.lesli.tech
23
23
  Building a better future, one line of code at a time.
@@ -27,45 +27,39 @@ Building a better future, one line of code at a time.
27
27
  @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
28
 
29
29
  // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
- // ·
31
-
30
+ // ·
32
31
  */
33
32
 
34
-
35
- // ·
36
- @import "templates/public";
37
- @import "lesli/fonts/mdicons.scss";
33
+ @import "lesli/templates/public";
34
+ @import "lesli/fonts/remixicons.scss";
38
35
 
39
36
 
40
- // ·
41
- body.users-passwords.new,
42
- body.users-passwords.edit {
43
-
44
- main {
45
- background: white;
37
+ main {
38
+ background: white;
46
39
 
47
- .hero-head {
48
- padding: 8rem 0 4rem;
40
+ // logo container
41
+ .hero-head {
42
+ padding: 8rem 0 4rem;
49
43
 
50
- .app-logo {
51
- max-width: 130px;
52
- }
44
+ .app-logo {
45
+ max-width: 130px;
53
46
  }
47
+ }
54
48
 
55
- .hero-body {
56
- flex-direction: column;
57
- border-top: 1px solid #ebebeb;
58
- background-color: whitesmoke;
59
-
60
- form {
61
- padding: 4rem;
62
- margin: 2rem auto;
63
- width: 100%;
64
- max-width: 750px;
65
- border-radius: 6px;
66
- border: 1px solid #ececec;
67
- background-color: white;
68
- }
49
+ // form container
50
+ .hero-body {
51
+ flex-direction: column;
52
+ background-color: whitesmoke;
53
+ border-top: 1px solid #ebebeb;
54
+
55
+ form {
56
+ width: 100%;
57
+ padding: 4rem;
58
+ max-width: 750px;
59
+ margin: 2rem auto;
60
+ border-radius: 6px;
61
+ border: 1px solid #ececec;
62
+ background-color: white;
69
63
 
70
64
  .label {
71
65
  font-size: 1.1rem;
@@ -73,14 +67,20 @@ body.users-passwords.edit {
73
67
  margin-bottom: 0;
74
68
  color: lesli-css-color(slate, 500);
75
69
  }
70
+ }
76
71
 
77
- .app-logo {
78
- margin-top: 4rem;
79
- max-width: 100px;
72
+ .links {
73
+ display: flex;
74
+
75
+ a {
76
+ display: flex;
77
+ align-items: center;
78
+ font-family: "OpenSans";
79
+ // add margin only to the middle links
80
+ &:not(:first-child):not(:last-child) {
81
+ margin: 0 1rem;
82
+ }
80
83
  }
81
-
82
84
  }
83
-
84
85
  }
85
-
86
86
  }
@@ -28,7 +28,6 @@ Building a better future, one line of code at a time.
28
28
 
29
29
  // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
30
  // ·
31
-
32
31
  */
33
32
 
34
33
 
@@ -39,7 +38,7 @@ Building a better future, one line of code at a time.
39
38
  // ·
40
39
  h1 {
41
40
  line-height: 33px;
42
- font-weight: 800;
41
+ font-weight: 900;
43
42
  font-size: 24px;
44
43
  }
45
44
 
@@ -83,11 +82,9 @@ body {
83
82
  form {
84
83
 
85
84
  label {
86
- font-family: "Montserrat";
87
- font-weight: 500;
85
+ font-weight: 400;
88
86
  font-size: 15px;
89
87
  line-height: 150%;
90
- color: #333;
91
88
  }
92
89
  input {
93
90
  border-radius: 6px;
@@ -126,33 +123,15 @@ body {
126
123
  }
127
124
  }
128
125
  span {
129
- font-family: "Exo";
126
+ font-family: "Domine";
130
127
  font-weight: 500;
131
128
  font-size: 14px;
132
129
  //color: lesli-css-color(lesli, navy);
133
130
  }
134
131
  }
135
132
 
136
- .links {
137
- a {
138
- width: 100%;
139
- display: flex;
140
- flex-grow: 1;
141
- padding: .8rem 0;
142
- &:not(:last-child) {
143
- border-bottom: 1px solid lesli-css-color(silver, 300);
144
- }
145
- }
146
- span {
147
- font-family: "Exo";
148
- font-weight: 500;
149
- font-size: 14px;
150
- //color: red; //lesli-css-color(lesli, navy);
151
- }
152
- }
153
-
154
133
  .terms {
155
- font-family: "Exo";
134
+ font-family: "Domine";
156
135
  font-weight: 400;
157
136
  font-size: 12px;
158
137
  line-height: 19px;
@@ -171,7 +150,6 @@ body {
171
150
  line-height: 18px;
172
151
  }
173
152
  }
174
-
175
153
  }
176
154
 
177
155
  .column.is-hidden-touch {
@@ -71,7 +71,7 @@ $color-sidebar: $lesli-sidebar-color;
71
71
  $color-background: $lesli-color-background;
72
72
 
73
73
 
74
- $family-primary: "Open Sans", "Ubuntu", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
74
+ $family-primary: "OpenSans", "Ubuntu", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
75
75
 
76
76
 
77
77
 
@@ -55,12 +55,13 @@ Building a better future, one line of code at a time.
55
55
 
56
56
 
57
57
  // · Lesli application layout
58
- @import "lesli/layouts/application-header";
59
- @import "lesli/layouts/application-navbar";
60
58
  @import "lesli/layouts/application-announcements";
59
+ @import "lesli/layouts/application-component";
60
+ @import "lesli/layouts/application-container";
61
61
  @import "lesli/layouts/application-engines";
62
62
  @import "lesli/layouts/application-sidebar";
63
- @import "lesli/layouts/application-component";
63
+ @import "lesli/layouts/application-header";
64
+ @import "lesli/layouts/application-navbar";
64
65
  @import "lesli/layouts/application-footer";
65
66
  @import "lesli/layouts/application-search";
66
67
 
@@ -112,6 +113,9 @@ Building a better future, one line of code at a time.
112
113
  @import "lesli/elements/card";
113
114
 
114
115
 
116
+ @import "flag-icon";
117
+
118
+
115
119
  html,
116
120
  body {
117
121
  color: var(--lesli-font-color);
@@ -134,7 +138,7 @@ body {
134
138
 
135
139
  // · titles
136
140
  h1, h2, h3, h4, h5, h6 {
137
- font-family: "Montserrat", $family-primary;
141
+ font-family: "Domine", $family-primary;
138
142
  }
139
143
 
140
144
 
@@ -43,3 +43,11 @@ Building a better future, one line of code at a time.
43
43
  aside.lesli-application-sidebar {
44
44
  display: none !important;
45
45
  }
46
+
47
+
48
+ // ·
49
+ .lesli-application-container {
50
+ // width: 90%;
51
+ // max-width: 1600px !important;
52
+ // margin: 0 auto;
53
+ }
@@ -28,7 +28,6 @@ Building a better future, one line of code at a time.
28
28
 
29
29
  // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
30
  // ·
31
-
32
31
  */
33
32
 
34
33
 
@@ -45,7 +44,7 @@ Building a better future, one line of code at a time.
45
44
 
46
45
 
47
46
  // · Font families and icons
48
- @import "lesli/fonts/mdicons";
47
+ @import "lesli/fonts/remixicons";
49
48
  @import "lesli/fonts/families";
50
49
 
51
50
 
@@ -61,7 +60,7 @@ body {
61
60
 
62
61
  // · headings and links
63
62
  h1, h2, h3, h4, h5, h6, a {
64
- font-family: "Montserrat", $family-primary;
63
+ font-family: "Domine", $family-primary;
65
64
  }
66
65
 
67
66
 
@@ -1,3 +1,36 @@
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
+ # ·
1
34
  namespace :lesli do
2
35
  namespace :controllers do
3
36
 
@@ -0,0 +1,88 @@
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
+ # ·
34
+ namespace :lesli do
35
+ namespace :db do
36
+
37
+ desc "Drop, build, migrate & seed Lesli database (development only)"
38
+ task :reset => :environment do |task, args|
39
+ reset()
40
+ end
41
+
42
+ desc "Build, migrate & seed Lesli database"
43
+ task :setup => :environment do |task, args|
44
+ setup()
45
+ end
46
+
47
+ desc "Build, migrate & seed Lesli database"
48
+ task :seed => :environment do |task, args|
49
+ seed()
50
+ end
51
+ end
52
+
53
+ # Drop, build, migrate & seed database (development only)
54
+ def reset
55
+ return if Rails.env.production?
56
+ L2.msg("Reset Lesli database for development")
57
+
58
+ Rake::Task['db:drop'].invoke
59
+ setup()
60
+ end
61
+
62
+ # Build, migrate & seed database (development only)
63
+ def setup
64
+ return if Rails.env.production?
65
+ L2.msg("Setup Lesli database for development")
66
+
67
+ Rake::Task['db:create'].invoke
68
+ Rake::Task['db:migrate'].invoke
69
+
70
+ seed()
71
+ end
72
+
73
+ # Seed database (development only)
74
+ def seed
75
+ return if Rails.env.production?
76
+ L2.msg("Seed Lesli database for development")
77
+
78
+ Rake::Task['db:seed'].invoke
79
+
80
+ Lesli::Engine.load_seed
81
+ LesliBell::Engine.load_seed if defined?(LesliBell)
82
+ LesliAudit::Engine.load_seed if defined?(LesliAudit)
83
+ Rake::Task['lesli:controllers:build'].invoke
84
+ Rake::Task['lesli:babel:build'].invoke if defined?(LesliBabel)
85
+
86
+ Rake::Task['lesli:status'].invoke
87
+ end
88
+ end
@@ -0,0 +1,74 @@
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
+ # ·
34
+ namespace :lesli do
35
+ namespace :git do
36
+
37
+ desc "Update vendor from node_modules"
38
+ task :vendor => :environment do |task, args|
39
+ vendor()
40
+ end
41
+ end
42
+
43
+ def vendor
44
+
45
+ # copy vendor dependencies (only css files are required)
46
+ FileUtils.rm_rf("engines/Lesli/vendor")
47
+ FileUtils.mkdir("engines/Lesli/vendor")
48
+
49
+ # updated version of libraries
50
+ [
51
+ "bulma",
52
+ "lesli-css",
53
+ "remixicon"
54
+ ].each do |package|
55
+ FileUtils.cp_r "engines/Lesli/node_modules/#{package}/", "engines/Lesli/vendor/#{package}", :verbose => true
56
+ FileUtils.rm_rf("engines/Lesli/vendor/#{package}/.git")
57
+ end
58
+
59
+ Dir.glob("engines/Lesli/vendor/**/*").each do |file|
60
+ next if file.end_with?(".css")
61
+ next if file.end_with?(".scss")
62
+ next if file.end_with?(".sass")
63
+ next if file.end_with?("LICENSE")
64
+ next if file.end_with?("License")
65
+ next if file.end_with?("license")
66
+ next if File.directory?(file)
67
+ FileUtils.rm(file, :verbose => true)
68
+ end
69
+
70
+ # commit any change in vendor
71
+ # command("git add vendor && git commit -m \"vendor: update npm dependencies (vendors)\" vendor")
72
+
73
+ end
74
+ end