lesli_admin 1.0.1 → 1.0.2
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/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 +7 -4
- data/app/views/lesli_admin/partials/_navigation.html.erb +0 -1
- data/app/views/lesli_admin/settings/_defaults.html.erb +61 -0
- data/app/views/lesli_admin/settings/_modules.html.erb +61 -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/lib/lesli_admin/version.rb +2 -2
- data/readme.md +59 -20
- metadata +47 -34
- 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/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,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 %>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
<div class="box">
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
</
|
|
1
|
+
<div class="box has-text-centered py-6">
|
|
2
|
+
<p class="is-title is-size-3 mb-2">
|
|
3
|
+
<b><%= LesliSystem.engines.size %></b>
|
|
4
|
+
</p>
|
|
5
|
+
<p class="is-title is-size-4">
|
|
6
|
+
Installed engines
|
|
7
|
+
</p>
|
|
5
8
|
</div>
|
|
@@ -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,61 @@
|
|
|
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.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.path_after_login
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
%>
|
|
19
|
+
<section class="section pt-0">
|
|
20
|
+
<h4 class="title is-size-4 mb-4">Lesli Configuration</h4>
|
|
21
|
+
|
|
22
|
+
<% sections.each do |title, config| %>
|
|
23
|
+
<div class="box">
|
|
24
|
+
<h5 class="subtitle is-size-6 has-text-weight-semibold mb-4"><%= title %></h5>
|
|
25
|
+
<div class="columns is-multiline is-mobile">
|
|
26
|
+
<%
|
|
27
|
+
grid = title.underscore
|
|
28
|
+
grid = "is-one-quarter" if title.underscore == "instance info"
|
|
29
|
+
grid = "is-half" if title.underscore == "datetime settings"
|
|
30
|
+
grid = "is-one-quarter" if title.underscore == "security settings"
|
|
31
|
+
grid = "is-one-third" if title.underscore == "theme"
|
|
32
|
+
|
|
33
|
+
%>
|
|
34
|
+
<% config.each do |key, value| %>
|
|
35
|
+
<div class="column <%= grid %>">
|
|
36
|
+
<p class="has-text-weight-semibold"><%= key.to_s.humanize %></p>
|
|
37
|
+
<div>
|
|
38
|
+
<% if value.is_a?(Hash) %>
|
|
39
|
+
<ul class="pl-4">
|
|
40
|
+
<% value.each do |key, value| %>
|
|
41
|
+
<li>
|
|
42
|
+
<strong><%= key.to_s.humanize %>:</strong>
|
|
43
|
+
<code><%= value %></code>
|
|
44
|
+
</li>
|
|
45
|
+
<% end %>
|
|
46
|
+
</ul>
|
|
47
|
+
|
|
48
|
+
<% elsif value == true %>
|
|
49
|
+
<span class="tag is-success has-text-white">Enabled</span>
|
|
50
|
+
<% elsif value == false %>
|
|
51
|
+
<span class="tag is-danger has-text-white">Disabled</span>
|
|
52
|
+
<% else %>
|
|
53
|
+
<code class="is-size-7"><%= value.to_s %></code>
|
|
54
|
+
<% end %>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<% end %>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
<% end %>
|
|
61
|
+
</section>
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
<style>
|
|
24
|
+
.fixed-grid .partial-engine-spec ul {
|
|
25
|
+
display: flex;
|
|
26
|
+
}
|
|
27
|
+
.fixed-grid .partial-engine-spec ul li {
|
|
28
|
+
margin: 0 1rem 0 0;
|
|
29
|
+
font-size: 13px;
|
|
30
|
+
}
|
|
31
|
+
.fixed-grid .partial-engine-spec ul li:last-child {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
.fixed-grid .partial-engine-spec .material-symbols {
|
|
35
|
+
font-size: 0px;
|
|
36
|
+
}
|
|
37
|
+
</style>
|
|
38
|
+
<%
|
|
39
|
+
@lesli_engines = LesliSystem.engines.map do |engine, engine_info|
|
|
40
|
+
engine_info[:summary] = engine_info[:summary]&.sub("for the Lesli Framework","")&.sub("for The Lesli Framework","")
|
|
41
|
+
engine_info
|
|
42
|
+
end
|
|
43
|
+
%>
|
|
44
|
+
|
|
45
|
+
<div class="fixed-grid">
|
|
46
|
+
<div class="grid" x-data="engineManager()">
|
|
47
|
+
<% @lesli_engines.each do |engine| %>
|
|
48
|
+
<% next if engine[:name] == "Root" %>
|
|
49
|
+
<div class="cell">
|
|
50
|
+
<div class="box">
|
|
51
|
+
<%= render(LesliView::Partials::EngineSpec.new(engine)) %>
|
|
52
|
+
<button
|
|
53
|
+
@click="toggleEngine('<%= engine[:path].gsub("/","") %>')"
|
|
54
|
+
:class="data.engines.includes('<%= engine[:path].gsub("/","") %>') ? 'button is-small is-info' : 'button is-small is-danger has-text-white'"
|
|
55
|
+
x-text="data.engines.includes('<%= engine[:path].gsub("/","") %>') ? 'Activar módulo' : 'Desactivar módulo'">
|
|
56
|
+
</button>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
<% end %>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
@@ -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/lib/lesli_admin/version.rb
CHANGED
data/readme.md
CHANGED
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
<div align="center"
|
|
1
|
+
<div align="center">
|
|
2
2
|
<img width="100" alt="LesliAdmin logo" src="./app/assets/images/lesli_admin/admin-logo.svg" />
|
|
3
3
|
<h3 align="center">Administration area for the Lesli Framework.</h3>
|
|
4
4
|
</div>
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
<br />
|
|
8
7
|
<hr/>
|
|
9
8
|
|
|
10
|
-
<div align="center"
|
|
11
|
-
<a target="
|
|
12
|
-
<img
|
|
9
|
+
<div align="center">
|
|
10
|
+
<a target="_blank" href="https://github.com/LesliTech/LesliAdmin/actions">
|
|
11
|
+
<img alt="Tests passing" src="https://img.shields.io/badge/Tests-passing-green?style=for-the-badge&logo=github">
|
|
13
12
|
</a>
|
|
14
|
-
<a
|
|
15
|
-
<img
|
|
13
|
+
<a target="_blank" href="https://rubygems.org/gems/lesli_admin">
|
|
14
|
+
<img alt="Gem Version" src="https://img.shields.io/gem/v/lesli_admin?style=for-the-badge&logo=ruby">
|
|
16
15
|
</a>
|
|
17
|
-
<a href="https://codecov.io/github/LesliTech/
|
|
18
|
-
<img
|
|
16
|
+
<a target="_blank" href="https://codecov.io/github/LesliTech/LesliAdmin">
|
|
17
|
+
<img alt="Codecov" src="https://img.shields.io/codecov/c/github/LesliTech/LesliAdmin?style=for-the-badge&logo=codecov">
|
|
19
18
|
</a>
|
|
20
19
|
</div>
|
|
21
20
|
|
|
22
21
|
<hr/>
|
|
23
22
|
<br />
|
|
24
23
|
|
|
24
|
+
<div align="center">
|
|
25
|
+
<img
|
|
26
|
+
style="width:100%;max-width:800px;border-radius:6px;"
|
|
27
|
+
alt="Lesli screenshot" src="./docs/images/screenshot.png" />
|
|
28
|
+
</div>
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
<br />
|
|
31
|
+
<hr/>
|
|
32
|
+
<br />
|
|
33
|
+
|
|
34
|
+
### Installation
|
|
27
35
|
|
|
28
36
|
```shell
|
|
29
37
|
# Add LesliAdmin engine gem
|
|
30
38
|
bundle add lesli_admin
|
|
31
|
-
```
|
|
32
39
|
|
|
33
|
-
```shell
|
|
34
40
|
# Setup & initialize the database
|
|
35
41
|
rake lesli:db:setup
|
|
36
42
|
```
|
|
@@ -42,26 +48,52 @@ Rails.application.routes.draw do
|
|
|
42
48
|
end
|
|
43
49
|
```
|
|
44
50
|
|
|
51
|
+
<br />
|
|
52
|
+
<hr/>
|
|
53
|
+
<br />
|
|
45
54
|
|
|
46
|
-
###
|
|
47
|
-
|
|
55
|
+
### Development
|
|
56
|
+
|
|
57
|
+
```shell
|
|
58
|
+
# clone the lesli repo inside your engine folder: RailsApp/engines
|
|
59
|
+
git clone https://github.com/LesliTech/LesliAdmin.git
|
|
60
|
+
|
|
61
|
+
# Load LesliAdmin as a Gem
|
|
62
|
+
gem "lesli", path: "engines/LesliAdmin"
|
|
48
63
|
|
|
64
|
+
# Install the necessary Gems to run LesliAdmin
|
|
65
|
+
bundle install
|
|
49
66
|
|
|
50
|
-
|
|
67
|
+
# Setup & initialize the database
|
|
68
|
+
rake lesli:db:setup
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
<br />
|
|
73
|
+
<hr/>
|
|
74
|
+
<br />
|
|
75
|
+
|
|
76
|
+
### Demo
|
|
77
|
+
|
|
78
|
+
* [online demo](https://demo.lesli.dev/)
|
|
79
|
+
* [docker demo](https://github.com/LesliTech/lesli-docker-demo)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Documentation
|
|
51
83
|
* [website](https://www.lesli.dev/)
|
|
52
|
-
* [documentation](https://www.lesli.dev/engines/admin
|
|
84
|
+
* [documentation](https://www.lesli.dev/engines/admin)
|
|
53
85
|
|
|
54
86
|
|
|
55
|
-
###
|
|
87
|
+
### Connect with Lesli
|
|
56
88
|
|
|
89
|
+
* [X: @LesliTech](https://x.com/LesliTech)
|
|
57
90
|
* [Email: hello@lesli.tech](hello@lesli.tech)
|
|
58
91
|
* [Website: https://www.lesli.tech](https://www.lesli.tech)
|
|
59
|
-
* [Twitter: @LesliTech](https://twitter.com/LesliTech)
|
|
60
92
|
|
|
61
93
|
|
|
62
94
|
### License
|
|
63
95
|
-------
|
|
64
|
-
Copyright (c)
|
|
96
|
+
Copyright (c) 2026, Lesli Technologies, S. A.
|
|
65
97
|
|
|
66
98
|
This program is free software: you can redistribute it and/or modify
|
|
67
99
|
it under the terms of the GNU General Public License as published by
|
|
@@ -76,10 +108,17 @@ GNU General Public License for more details.
|
|
|
76
108
|
You should have received a copy of the GNU General Public License
|
|
77
109
|
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
78
110
|
|
|
111
|
+
<br />
|
|
79
112
|
<hr />
|
|
80
113
|
<br />
|
|
114
|
+
<br />
|
|
81
115
|
|
|
82
116
|
<div align="center" class="has-text-centered">
|
|
83
117
|
<img width="200" alt="Lesli logo" src="https://cdn.lesli.tech/lesli/brand/app-logo.svg" />
|
|
84
|
-
<
|
|
118
|
+
<h3 align="center" class="mt-0">
|
|
119
|
+
The Open-Source SaaS Development Framework for Ruby on Rails.
|
|
120
|
+
</h3>
|
|
85
121
|
</div>
|
|
122
|
+
|
|
123
|
+
<br />
|
|
124
|
+
<br />
|