lesli_admin 1.0.1 → 1.1.1
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 +4 -4
- data/Rakefile +3 -1
- data/app/assets/stylesheets/lesli_admin/application.tailwind.css +2 -0
- data/app/controllers/lesli_admin/account/currencies_controller.rb +60 -0
- data/app/controllers/lesli_admin/account/details_controller.rb +60 -0
- data/app/controllers/lesli_admin/account/locations_controller.rb +60 -0
- data/app/controllers/lesli_admin/account/settings_controller.rb +60 -0
- data/app/controllers/lesli_admin/accounts_controller.rb +5 -4
- data/app/helpers/lesli_admin/account/currencies_helper.rb +4 -0
- data/app/helpers/lesli_admin/account/details_helper.rb +4 -0
- data/app/helpers/lesli_admin/account/locations_helper.rb +4 -0
- data/app/helpers/lesli_admin/account/settings_helper.rb +4 -0
- data/app/models/lesli_admin/account/currency.rb +4 -0
- data/app/models/lesli_admin/account/detail.rb +4 -0
- data/app/models/lesli_admin/account/location.rb +4 -0
- data/app/models/lesli_admin/account/setting.rb +4 -0
- data/app/models/lesli_admin/account.rb +3 -4
- data/app/models/lesli_admin/dashboard.rb +0 -3
- data/app/services/lesli_admin/account_service.rb +6 -6
- data/app/views/lesli_admin/account/currencies/_currency.html.erb +2 -0
- data/app/views/lesli_admin/account/currencies/_form.html.erb +17 -0
- data/app/views/lesli_admin/account/currencies/edit.html.erb +12 -0
- data/app/views/lesli_admin/account/currencies/index.html.erb +16 -0
- data/app/views/lesli_admin/account/currencies/new.html.erb +11 -0
- data/app/views/lesli_admin/account/currencies/show.html.erb +10 -0
- data/app/views/lesli_admin/account/details/_detail.html.erb +2 -0
- data/app/views/lesli_admin/account/details/_form.html.erb +17 -0
- data/app/views/lesli_admin/account/details/edit.html.erb +12 -0
- data/app/views/lesli_admin/account/details/index.html.erb +16 -0
- data/app/views/lesli_admin/account/details/new.html.erb +11 -0
- data/app/views/lesli_admin/account/details/show.html.erb +10 -0
- data/app/views/lesli_admin/account/locations/_form.html.erb +17 -0
- data/app/views/lesli_admin/account/locations/_location.html.erb +2 -0
- data/app/views/lesli_admin/account/locations/edit.html.erb +12 -0
- data/app/views/lesli_admin/account/locations/index.html.erb +16 -0
- data/app/views/lesli_admin/account/locations/new.html.erb +11 -0
- data/app/views/lesli_admin/account/locations/show.html.erb +10 -0
- data/app/views/lesli_admin/account/settings/_form.html.erb +17 -0
- data/app/views/lesli_admin/account/settings/_setting.html.erb +2 -0
- data/app/views/lesli_admin/account/settings/edit.html.erb +12 -0
- data/app/views/lesli_admin/account/settings/index.html.erb +16 -0
- data/app/views/lesli_admin/account/settings/new.html.erb +11 -0
- data/app/views/lesli_admin/account/settings/show.html.erb +10 -0
- data/app/views/lesli_admin/accounts/show.html.erb +3 -3
- data/app/views/lesli_admin/dashboards/_component-installed-engines.html.erb +1 -5
- data/app/views/lesli_admin/partials/_navigation.html.erb +0 -1
- data/app/views/lesli_admin/settings/_defaults.html.erb +71 -0
- data/app/views/lesli_admin/settings/_modules.html.erb +57 -0
- data/app/views/lesli_admin/settings/show.html.erb +7 -1
- data/config/routes.rb +1 -3
- data/db/migrate/v1/0101000210_create_lesli_admin_account_details.rb +70 -0
- data/db/migrate/v1/{0101003010_create_lesli_admin_dashboards.rb → 0101000313_create_lesli_admin_account_settings.rb} +11 -4
- data/db/migrate/v1/0101000410_create_lesli_admin_account_locations.rb +63 -0
- data/{app/controllers/lesli_admin/abouts_controller.rb → db/migrate/v1/0101000510_create_lesli_admin_account_currencies.rb} +14 -14
- data/db/seeds.rb +1 -1
- data/lib/lesli_admin/version.rb +2 -2
- data/readme.md +146 -36
- metadata +50 -37
- data/app/controllers/lesli_admin/dashboard/components_controller.rb +0 -60
- data/app/controllers/lesli_admin/profiles_controller.rb +0 -48
- data/app/helpers/lesli_admin/profiles_helper.rb +0 -4
- data/app/models/lesli_admin/dashboard/component.rb +0 -49
- data/app/views/lesli_admin/abouts/show.html.erb +0 -73
- data/app/views/lesli_admin/accounts/_account.html.erb +0 -2
- data/app/views/lesli_admin/accounts/_form.html.erb +0 -17
- data/app/views/lesli_admin/accounts/edit.html.erb +0 -10
- data/app/views/lesli_admin/accounts/index.html.erb +0 -34
- data/app/views/lesli_admin/accounts/new.html.erb +0 -9
- data/app/views/lesli_admin/accounts/update.turbo_stream.erb +0 -3
- data/app/views/lesli_admin/profiles/show.html.erb +0 -1
- data/lib/scss/application.scss +0 -4
- data/lib/vue/application.js +0 -96
- data/lib/vue/apps/about/show.vue +0 -74
- data/lib/vue/apps/account/components/form-address.vue +0 -119
- data/lib/vue/apps/account/components/form-contact.vue +0 -122
- data/lib/vue/apps/account/components/form-information.vue +0 -89
- data/lib/vue/apps/account/show.vue +0 -87
- data/lib/vue/apps/dashboards/components/lesli-version.vue +0 -73
- data/lib/vue/apps/profile/show.vue +0 -129
- data/lib/vue/stores/account.js +0 -111
- data/lib/vue/stores/account_settings.js +0 -342
- data/lib/vue/stores/roles.js +0 -89
- data/lib/vue/stores/translations.json +0 -162
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<%= render @account_location %>
|
|
4
|
+
|
|
5
|
+
<div>
|
|
6
|
+
<%= link_to "Edit this location", edit_account_location_path(@account_location) %> |
|
|
7
|
+
<%= link_to "Back to locations", account_locations_path %>
|
|
8
|
+
|
|
9
|
+
<%= button_to "Destroy this location", @account_location, method: :delete %>
|
|
10
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<%= form_with(model: account_setting) do |form| %>
|
|
2
|
+
<% if account_setting.errors.any? %>
|
|
3
|
+
<div style="color: red">
|
|
4
|
+
<h2><%= pluralize(account_setting.errors.count, "error") %> prohibited this account_setting from being saved:</h2>
|
|
5
|
+
|
|
6
|
+
<ul>
|
|
7
|
+
<% account_setting.errors.each do |error| %>
|
|
8
|
+
<li><%= error.full_message %></li>
|
|
9
|
+
<% end %>
|
|
10
|
+
</ul>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<div>
|
|
15
|
+
<%= form.submit %>
|
|
16
|
+
</div>
|
|
17
|
+
<% end %>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<% content_for :title, "Editing setting" %>
|
|
2
|
+
|
|
3
|
+
<h1>Editing setting</h1>
|
|
4
|
+
|
|
5
|
+
<%= render "form", account_setting: @account_setting %>
|
|
6
|
+
|
|
7
|
+
<br>
|
|
8
|
+
|
|
9
|
+
<div>
|
|
10
|
+
<%= link_to "Show this setting", @account_setting %> |
|
|
11
|
+
<%= link_to "Back to settings", account_settings_path %>
|
|
12
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<% content_for :title, "Settings" %>
|
|
4
|
+
|
|
5
|
+
<h1>Settings</h1>
|
|
6
|
+
|
|
7
|
+
<div id="account_settings">
|
|
8
|
+
<% @account_settings.each do |account_setting| %>
|
|
9
|
+
<%= render account_setting %>
|
|
10
|
+
<p>
|
|
11
|
+
<%= link_to "Show this setting", account_setting %>
|
|
12
|
+
</p>
|
|
13
|
+
<% end %>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<%= link_to "New setting", new_account_setting_path %>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<%= render @account_setting %>
|
|
4
|
+
|
|
5
|
+
<div>
|
|
6
|
+
<%= link_to "Edit this setting", edit_account_setting_path(@account_setting) %> |
|
|
7
|
+
<%= link_to "Back to settings", account_settings_path %>
|
|
8
|
+
|
|
9
|
+
<%= button_to "Destroy this setting", @account_setting, method: :delete %>
|
|
10
|
+
</div>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
<%= render(LesliView::Layout::Container.new("
|
|
2
|
+
<%= render(LesliView::Layout::Container.new("accounts")) do %>
|
|
3
3
|
|
|
4
4
|
<%= render(LesliView::Components::Header.new("Account information")) %>
|
|
5
5
|
|
|
6
6
|
<%= render LesliView::Components::Tabs.new do |tabs| %>
|
|
7
7
|
<% tabs.with_tab(title: "General Information", icon: "business") do %>
|
|
8
|
-
<%= form_with(model: @account, builder: LesliView::Forms::Builder) do |form| %>
|
|
8
|
+
<%= form_with(model: @account, url: account_path, builder: LesliView::Forms::Builder) do |form| %>
|
|
9
9
|
<%= form.fieldset do %>
|
|
10
10
|
<%= form.field_control(:name, label: "Company name")%>
|
|
11
|
-
<%= form.field_control(:email, label: "
|
|
11
|
+
<%= form.field_control(:email, label: "Email") %>
|
|
12
12
|
<%= form.field_control_submit %>
|
|
13
13
|
<% end %>
|
|
14
14
|
<% end %>
|
|
@@ -34,7 +34,6 @@ Building a better future, one line of code at a time.
|
|
|
34
34
|
|
|
35
35
|
<%= navigation_item(lesli_admin.dashboard_path, "Dashboard", "ri-dashboard-3-line"); %>
|
|
36
36
|
<%= navigation_item(lesli_admin.account_path, "Account", "ri-building-4-line"); %>
|
|
37
|
-
<%= navigation_item(lesli_admin.about_path, "About", "ri-star-line"); %>
|
|
38
37
|
<%= navigation_item(lesli_admin.settings_path, "Settings", "ri-settings-4-line"); %>
|
|
39
38
|
|
|
40
39
|
<%#= navigation_item(lesli.account_path, "Localization", "ri-time-line"); %>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<%
|
|
2
|
+
sections = {
|
|
3
|
+
"Instance Info" => {
|
|
4
|
+
demo: Lesli.config.demo,
|
|
5
|
+
instance: Lesli.config.instance
|
|
6
|
+
},
|
|
7
|
+
"Company Info" => Lesli.config.company,
|
|
8
|
+
"Available Locales" => Lesli.config.babel[:locales],
|
|
9
|
+
"Datetime Settings" => Lesli.config.datetime,
|
|
10
|
+
"Security Settings" => Lesli.config.security,
|
|
11
|
+
"Theme" => Lesli.config.theme,
|
|
12
|
+
"Layout" => Lesli.config.layout,
|
|
13
|
+
"Mailer" => Lesli.config.mailer,
|
|
14
|
+
"Paths" => {
|
|
15
|
+
path_after_login: Lesli.config.shield[:path_after_login]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
grid_classes = {
|
|
20
|
+
"Instance Info" => "sm:grid-cols-2 lg:grid-cols-4",
|
|
21
|
+
"Datetime Settings" => "sm:grid-cols-2",
|
|
22
|
+
"Security Settings" => "sm:grid-cols-2 lg:grid-cols-4",
|
|
23
|
+
"Theme" => "sm:grid-cols-2 lg:grid-cols-3"
|
|
24
|
+
}
|
|
25
|
+
%>
|
|
26
|
+
|
|
27
|
+
<section aria-labelledby="lesli-configuration-title">
|
|
28
|
+
<h4
|
|
29
|
+
id="lesli-configuration-title"
|
|
30
|
+
class="mb-5 text-xl font-semibold tracking-tight text-slate-900">
|
|
31
|
+
Lesli Configuration
|
|
32
|
+
</h4>
|
|
33
|
+
|
|
34
|
+
<div class="space-y-5">
|
|
35
|
+
<% sections.each do |title, config| %>
|
|
36
|
+
<article class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm sm:p-6">
|
|
37
|
+
<h5 class="mb-4 text-base font-semibold text-slate-900"><%= title %></h5>
|
|
38
|
+
|
|
39
|
+
<dl class="grid grid-cols-1 gap-x-6 gap-y-5 <%= grid_classes.fetch(title, "sm:grid-cols-2 lg:grid-cols-4") %>">
|
|
40
|
+
<% config.each do |key, value| %>
|
|
41
|
+
<div class="min-w-0">
|
|
42
|
+
<dt class="text-sm font-medium text-slate-600"><%= key.to_s.humanize %></dt>
|
|
43
|
+
<dd class="mt-2 text-sm text-slate-900">
|
|
44
|
+
<% if value.is_a?(Hash) %>
|
|
45
|
+
<ul class="space-y-2 border-l-2 border-slate-200 pl-3">
|
|
46
|
+
<% value.each do |nested_key, nested_value| %>
|
|
47
|
+
<li class="min-w-0">
|
|
48
|
+
<span class="font-medium text-slate-700"><%= nested_key.to_s.humanize %>:</span>
|
|
49
|
+
<code class="ml-1 break-all rounded bg-slate-100 px-1.5 py-0.5 text-xs text-slate-700"><%= nested_value %></code>
|
|
50
|
+
</li>
|
|
51
|
+
<% end %>
|
|
52
|
+
</ul>
|
|
53
|
+
<% elsif value == true %>
|
|
54
|
+
<span class="inline-flex items-center rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-semibold text-emerald-700">
|
|
55
|
+
Enabled
|
|
56
|
+
</span>
|
|
57
|
+
<% elsif value == false %>
|
|
58
|
+
<span class="inline-flex items-center rounded-full bg-red-100 px-2.5 py-1 text-xs font-semibold text-red-700">
|
|
59
|
+
Disabled
|
|
60
|
+
</span>
|
|
61
|
+
<% else %>
|
|
62
|
+
<code class="break-all rounded bg-slate-100 px-1.5 py-1 text-xs text-slate-700"><%= value.to_s %></code>
|
|
63
|
+
<% end %>
|
|
64
|
+
</dd>
|
|
65
|
+
</div>
|
|
66
|
+
<% end %>
|
|
67
|
+
</dl>
|
|
68
|
+
</article>
|
|
69
|
+
<% end %>
|
|
70
|
+
</div>
|
|
71
|
+
</section>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
function engineManager() {
|
|
3
|
+
return {
|
|
4
|
+
data: { engines: [] },
|
|
5
|
+
|
|
6
|
+
init() {
|
|
7
|
+
const stored = localStorage.getItem('engineData')
|
|
8
|
+
this.data = stored ? JSON.parse(stored) : { engines: [] }
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
toggleEngine(engine) {
|
|
12
|
+
const index = this.data.engines.indexOf(engine)
|
|
13
|
+
if (index === -1) {
|
|
14
|
+
this.data.engines.push(engine)
|
|
15
|
+
} else {
|
|
16
|
+
this.data.engines.splice(index, 1)
|
|
17
|
+
}
|
|
18
|
+
localStorage.setItem('engineData', JSON.stringify(this.data))
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<%
|
|
25
|
+
lesli_engines = LesliSystem.engines.values.map do |engine_info|
|
|
26
|
+
summary = engine_info[:summary]
|
|
27
|
+
&.sub("for the Lesli Framework", "")
|
|
28
|
+
&.sub("for The Lesli Framework", "")
|
|
29
|
+
|
|
30
|
+
engine_info.merge(summary: summary)
|
|
31
|
+
end
|
|
32
|
+
%>
|
|
33
|
+
|
|
34
|
+
<section
|
|
35
|
+
class="grid grid-cols-1 gap-5 xl:grid-cols-2"
|
|
36
|
+
aria-label="Modules"
|
|
37
|
+
x-data="engineManager()">
|
|
38
|
+
<% lesli_engines.each do |engine| %>
|
|
39
|
+
<% next if engine[:name] == "Root" %>
|
|
40
|
+
|
|
41
|
+
<% engine_key = engine[:path].delete("/") %>
|
|
42
|
+
|
|
43
|
+
<article class="module-engine-card flex min-w-0 flex-col rounded-2xl border border-slate-200 bg-white p-5 shadow-sm sm:p-6">
|
|
44
|
+
<div class="min-w-0 flex-1">
|
|
45
|
+
<%= render(LesliView::Partials::EngineSpec.new(engine)) %>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<button
|
|
49
|
+
type="button"
|
|
50
|
+
class="mt-5 inline-flex w-fit items-center justify-center rounded-lg px-3 py-2 text-sm font-semibold text-white shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2"
|
|
51
|
+
@click="toggleEngine(<%= engine_key.to_json %>)"
|
|
52
|
+
:class="data.engines.includes(<%= engine_key.to_json %>) ? 'bg-emerald-600 hover:bg-emerald-700 focus-visible:ring-emerald-500/30' : 'bg-red-600 hover:bg-red-700 focus-visible:ring-red-500/30'"
|
|
53
|
+
x-text="data.engines.includes(<%= engine_key.to_json %>) ? 'Activar módulo' : 'Desactivar módulo'">
|
|
54
|
+
</button>
|
|
55
|
+
</article>
|
|
56
|
+
<% end %>
|
|
57
|
+
</section>
|
|
@@ -4,7 +4,13 @@
|
|
|
4
4
|
<%= render(LesliView::Components::Header.new("Settings")) %>
|
|
5
5
|
|
|
6
6
|
<%= render LesliView::Components::Tabs.new(:vertical => true) do |tabs| %>
|
|
7
|
-
<% tabs.with_tab(title: "
|
|
7
|
+
<% tabs.with_tab(title: "Default", icon: "component_exchange") do %>
|
|
8
|
+
<%= render("defaults") %>
|
|
9
|
+
<% end %>
|
|
10
|
+
<% tabs.with_tab(title: "Modules", icon: "brick") do %>
|
|
11
|
+
<%= render("modules") %>
|
|
12
|
+
<% end %>
|
|
13
|
+
<% tabs.with_tab(title: "About", icon: "kid_star") do %>
|
|
8
14
|
<%= render(LesliView::Partials::EngineSpec.new(LesliSystem.engine(@lesli[:engine_name]))) %>
|
|
9
15
|
<% end %>
|
|
10
16
|
<% end %>
|
data/config/routes.rb
CHANGED
|
@@ -32,13 +32,11 @@ Building a better future, one line of code at a time.
|
|
|
32
32
|
|
|
33
33
|
LesliAdmin::Engine.routes.draw do
|
|
34
34
|
|
|
35
|
-
Lesli::
|
|
35
|
+
Lesli::Router.mount_lesli_engine_routes(self)
|
|
36
36
|
|
|
37
37
|
resource :account, only: [:show, :update]
|
|
38
38
|
|
|
39
39
|
resource :profile, only: [:show]
|
|
40
40
|
|
|
41
|
-
resource :about, only: [:show]
|
|
42
|
-
|
|
43
41
|
resource :settings, only: [:show, :update]
|
|
44
42
|
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
Lesli
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026, 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 LesliTech
|
|
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 CreateLesliAdminAccountDetails < ActiveRecord::Migration[6.0]
|
|
34
|
+
def change
|
|
35
|
+
create_table :lesli_admin_account_details do |t|
|
|
36
|
+
|
|
37
|
+
# company information
|
|
38
|
+
t.string :company_name
|
|
39
|
+
t.string :company_name_legal
|
|
40
|
+
t.string :company_tagline
|
|
41
|
+
|
|
42
|
+
# location
|
|
43
|
+
t.integer :country
|
|
44
|
+
t.string :address
|
|
45
|
+
t.string :region
|
|
46
|
+
t.string :city
|
|
47
|
+
t.string :postal_code
|
|
48
|
+
|
|
49
|
+
# contact details
|
|
50
|
+
t.string :website
|
|
51
|
+
t.string :phone_number_1
|
|
52
|
+
t.string :phone_number_2
|
|
53
|
+
t.string :phone_number_3
|
|
54
|
+
t.string :phone_number_4
|
|
55
|
+
t.string :public_email
|
|
56
|
+
|
|
57
|
+
# social media
|
|
58
|
+
t.string :github
|
|
59
|
+
t.string :twitter
|
|
60
|
+
t.string :youtube
|
|
61
|
+
t.string :linkedin
|
|
62
|
+
t.string :facebook
|
|
63
|
+
|
|
64
|
+
# Acts as paranoid
|
|
65
|
+
t.datetime :deleted_at, index: true
|
|
66
|
+
t.timestamps
|
|
67
|
+
end
|
|
68
|
+
add_reference(:lesli_admin_account_details, :account, foreign_key: { to_table: :lesli_accounts })
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Lesli
|
|
4
4
|
|
|
5
|
-
Copyright (c)
|
|
5
|
+
Copyright (c) 2026, Lesli Technologies, S. A.
|
|
6
6
|
|
|
7
7
|
This program is free software: you can redistribute it and/or modify
|
|
8
8
|
it under the terms of the GNU General Public License as published by
|
|
@@ -19,7 +19,7 @@ along with this program. If not, see http://www.gnu.org/licenses/.
|
|
|
19
19
|
|
|
20
20
|
Lesli · Ruby on Rails SaaS Development Framework.
|
|
21
21
|
|
|
22
|
-
Made with ♥ by
|
|
22
|
+
Made with ♥ by LesliTech
|
|
23
23
|
Building a better future, one line of code at a time.
|
|
24
24
|
|
|
25
25
|
@contact hello@lesli.tech
|
|
@@ -30,8 +30,15 @@ Building a better future, one line of code at a time.
|
|
|
30
30
|
// ·
|
|
31
31
|
=end
|
|
32
32
|
|
|
33
|
-
class
|
|
33
|
+
class CreateLesliAdminAccountSettings < ActiveRecord::Migration[5.2]
|
|
34
34
|
def change
|
|
35
|
-
|
|
35
|
+
create_table :lesli_admin_account_settings do |t|
|
|
36
|
+
t.string :name
|
|
37
|
+
t.string :value
|
|
38
|
+
t.timestamps
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
add_reference(:lesli_admin_account_settings, :user, foreign_key: { to_table: :lesli_users }, index: true)
|
|
42
|
+
add_reference(:lesli_admin_account_settings, :account, null: false, foreign_key: { to_table: :lesli_admin_accounts }, index: true)
|
|
36
43
|
end
|
|
37
44
|
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
Lesli
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026, 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 LesliTech
|
|
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 CreateLesliAdminAccountLocations < ActiveRecord::Migration[6.0]
|
|
34
|
+
def change
|
|
35
|
+
create_table :lesli_admin_account_locations do |t|
|
|
36
|
+
|
|
37
|
+
# General information about the location
|
|
38
|
+
t.string :name
|
|
39
|
+
t.string :short_name
|
|
40
|
+
t.string :postal_code
|
|
41
|
+
t.string :latitude
|
|
42
|
+
t.string :longitude
|
|
43
|
+
t.string :code
|
|
44
|
+
t.string :calling_code
|
|
45
|
+
|
|
46
|
+
# Imagine USA, we have country > state > city. In guatemala, we have country > departamento > municipio
|
|
47
|
+
# levels for Guatemala, Alta Verapaz, Cobán will be country, state, city
|
|
48
|
+
# native_levels for Guatemala, Alta Verapaz, Cobán will be country, departamento, municipio
|
|
49
|
+
# native_levels are only reference, for relating entries we will use the 'level' field
|
|
50
|
+
t.string :level # For example, country, state, city, etc.
|
|
51
|
+
t.string :native_level # The original name of the level, based on language and location
|
|
52
|
+
|
|
53
|
+
# acts_as_paranoid
|
|
54
|
+
t.datetime :deleted_at, index: true
|
|
55
|
+
|
|
56
|
+
t.timestamps
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
add_reference(:lesli_admin_account_locations, :parent, foreign_key: { to_table: :lesli_admin_account_locations })
|
|
60
|
+
add_reference(:lesli_admin_account_locations, :account, foreign_key: { to_table: :lesli_accounts })
|
|
61
|
+
add_index(:lesli_admin_account_locations, %i[account_id name level parent_id], unique: true, name: "location_uniqueness_index")
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Lesli
|
|
4
4
|
|
|
5
|
-
Copyright (c)
|
|
5
|
+
Copyright (c) 2026, Lesli Technologies, S. A.
|
|
6
6
|
|
|
7
7
|
This program is free software: you can redistribute it and/or modify
|
|
8
8
|
it under the terms of the GNU General Public License as published by
|
|
@@ -30,19 +30,19 @@ Building a better future, one line of code at a time.
|
|
|
30
30
|
// ·
|
|
31
31
|
=end
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
end
|
|
44
|
-
}
|
|
45
|
-
end
|
|
33
|
+
class CreateLesliAdminAccountCurrencies < ActiveRecord::Migration[6.1]
|
|
34
|
+
def change
|
|
35
|
+
create_table :lesli_admin_account_currencies do |t|
|
|
36
|
+
t.string :name
|
|
37
|
+
t.string :symbol
|
|
38
|
+
t.string :country_alpha_3
|
|
39
|
+
|
|
40
|
+
# Acts as paranoid
|
|
41
|
+
t.datetime :deleted_at, index: true
|
|
42
|
+
t.timestamps
|
|
46
43
|
end
|
|
44
|
+
|
|
45
|
+
add_reference(:lesli_admin_account_currencies, :user, foreign_key: { to_table: :lesli_users })
|
|
46
|
+
add_reference(:lesli_admin_account_currencies, :account, foreign_key: { to_table: :lesli_admin_accounts })
|
|
47
47
|
end
|
|
48
48
|
end
|
data/db/seeds.rb
CHANGED
|
@@ -31,7 +31,7 @@ Building a better future, one line of code at a time.
|
|
|
31
31
|
=end
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Termline.info("Loading seeds for: LesliAdmin #{LesliAdmin::VERSION} (#{LesliAdmin::BUILD})")
|
|
35
35
|
|
|
36
36
|
if Rails.env.development? || Lesli.config.demo
|
|
37
37
|
#load(LesliAdmin::Engine.root.join("db", "seed", "#{ Rails.env.downcase }.rb"))
|
data/lib/lesli_admin/version.rb
CHANGED