lesli_admin 1.0.0 → 1.0.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/app/controllers/lesli_admin/abouts_controller.rb +2 -8
- data/app/controllers/lesli_admin/accounts_controller.rb +5 -3
- data/app/controllers/lesli_admin/settings_controller.rb +58 -0
- data/app/helpers/lesli_admin/settings_helper.rb +4 -0
- data/app/models/lesli_admin/account.rb +2 -2
- data/app/models/lesli_admin/dashboard.rb +1 -19
- data/app/models/lesli_admin/setting.rb +4 -0
- data/app/views/lesli_admin/abouts/show.html.erb +13 -22
- data/app/views/lesli_admin/accounts/show.html.erb +0 -1
- data/app/views/lesli_admin/dashboards/_component-installed-engines.html.erb +5 -0
- data/app/views/lesli_admin/partials/_navigation.html.erb +1 -0
- data/app/views/lesli_admin/settings/_form.html.erb +17 -0
- data/app/views/lesli_admin/settings/_setting.html.erb +2 -0
- data/app/views/lesli_admin/settings/edit.html.erb +12 -0
- data/app/views/lesli_admin/settings/index.html.erb +16 -0
- data/app/views/lesli_admin/settings/new.html.erb +11 -0
- data/app/views/lesli_admin/settings/show.html.erb +11 -0
- data/config/routes.rb +2 -0
- data/lib/lesli_admin/version.rb +2 -2
- data/readme.md +23 -17
- metadata +14 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fe2fa40b79cedac9232755c2b3f928e6836d802b5e379e97d645bd776fef41e
|
4
|
+
data.tar.gz: f1c5398d9f4201c73c055635c0ed905def1be93a9876da2e7c22db94b22cb317
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60051ae8b957b7702313ce4c71b08d572a483f528d40723eb1ce4d890787863e40a963e5e2d52b78b6d629c5f6f65b7dbf8ade4a65389147daeb7bdefd976d22
|
7
|
+
data.tar.gz: 2ee2f8246bb3c3476b4f3f991ad9984753eb2812281be34d0f3173f8c60f0b332e9d8cf675898057f3c7e0a28be719bce425dade9d940cb5bcc41fd8793d8ac6
|
@@ -38,14 +38,8 @@ module LesliAdmin
|
|
38
38
|
respond_to do |format|
|
39
39
|
format.html {
|
40
40
|
@lesli_engines = LesliSystem.engines.map do |engine, engine_info|
|
41
|
-
|
42
|
-
|
43
|
-
:code => engine_info[:code],
|
44
|
-
:path => engine_info[:path],
|
45
|
-
:build => engine_info[:build],
|
46
|
-
:version => engine_info[:version],
|
47
|
-
:description => engine_info[:description]
|
48
|
-
}
|
41
|
+
engine_info[:description] = engine_info[:description]&.sub("for the Lesli Framework","")&.sub("for The Lesli Framework","")
|
42
|
+
engine_info
|
49
43
|
end
|
50
44
|
}
|
51
45
|
end
|
@@ -35,12 +35,14 @@ module LesliAdmin
|
|
35
35
|
before_action :set_account, only: %i[show update]
|
36
36
|
|
37
37
|
def show
|
38
|
+
@account = AccountService.new(current_user, query).show
|
38
39
|
respond_to do |format|
|
39
|
-
format.html
|
40
|
-
|
40
|
+
format.html
|
41
|
+
format.turbo_stream do
|
42
|
+
render(turbo_stream: turbo_stream.replace("application-lesli-notifications", partial: "lesli/partials/application-lesli-notifications"))
|
41
43
|
end
|
42
44
|
format.json do
|
43
|
-
respond_with_successful(
|
45
|
+
respond_with_successful(@account)
|
44
46
|
end
|
45
47
|
end
|
46
48
|
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module LesliAdmin
|
2
|
+
class SettingsController < ApplicationController
|
3
|
+
before_action :set_setting, only: %i[ show edit update destroy ]
|
4
|
+
|
5
|
+
# GET /settings
|
6
|
+
def index
|
7
|
+
end
|
8
|
+
|
9
|
+
# GET /settings/1
|
10
|
+
def show
|
11
|
+
end
|
12
|
+
|
13
|
+
# GET /settings/new
|
14
|
+
def new
|
15
|
+
@setting = Setting.new
|
16
|
+
end
|
17
|
+
|
18
|
+
# GET /settings/1/edit
|
19
|
+
def edit
|
20
|
+
end
|
21
|
+
|
22
|
+
# POST /settings
|
23
|
+
def create
|
24
|
+
@setting = Setting.new(setting_params)
|
25
|
+
|
26
|
+
if @setting.save
|
27
|
+
redirect_to @setting, notice: "Setting was successfully created."
|
28
|
+
else
|
29
|
+
render :new, status: :unprocessable_entity
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# PATCH/PUT /settings/1
|
34
|
+
def update
|
35
|
+
if @setting.update(setting_params)
|
36
|
+
redirect_to @setting, notice: "Setting was successfully updated.", status: :see_other
|
37
|
+
else
|
38
|
+
render :edit, status: :unprocessable_entity
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# DELETE /settings/1
|
43
|
+
def destroy
|
44
|
+
@setting.destroy!
|
45
|
+
redirect_to settings_path, notice: "Setting was successfully destroyed.", status: :see_other
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
# Use callbacks to share common setup or constraints between actions.
|
50
|
+
def set_setting
|
51
|
+
end
|
52
|
+
|
53
|
+
# Only allow a list of trusted parameters through.
|
54
|
+
def setting_params
|
55
|
+
params.fetch(:setting, {})
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -33,12 +33,12 @@ Building a better future, one line of code at a time.
|
|
33
33
|
module LesliAdmin
|
34
34
|
class Account < ApplicationRecord
|
35
35
|
belongs_to :account, class_name: "Lesli::Account"
|
36
|
-
has_many :
|
36
|
+
has_many :dashboards
|
37
37
|
|
38
38
|
after_create :initialize_account
|
39
39
|
|
40
40
|
def initialize_account
|
41
|
-
|
41
|
+
Dashboard.initialize_dashboard(self)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -35,24 +35,6 @@ module LesliAdmin
|
|
35
35
|
self.table_name = "lesli_admin_dashboards"
|
36
36
|
belongs_to :account
|
37
37
|
|
38
|
-
|
39
|
-
accepts_nested_attributes_for :components, allow_destroy: true
|
40
|
-
|
41
|
-
def self.initialize_account(account)
|
42
|
-
self.create_with(
|
43
|
-
default: true,
|
44
|
-
main: false,
|
45
|
-
components_attributes: [{
|
46
|
-
name: "Lesli version",
|
47
|
-
component_id: "admin-lesli-version",
|
48
|
-
layout: 3,
|
49
|
-
query_configuration: {},
|
50
|
-
custom_configuration: {}
|
51
|
-
}]
|
52
|
-
).find_or_create_by!(
|
53
|
-
account: account,
|
54
|
-
name: "Admin Default Dashboard"
|
55
|
-
)
|
56
|
-
end
|
38
|
+
COMPONENTS = %i[installed_engines]
|
57
39
|
end
|
58
40
|
end
|
@@ -56,27 +56,18 @@ Building a better future, one line of code at a time.
|
|
56
56
|
<%= render LesliView::Layout::Container.new("admin-accounts") do %>
|
57
57
|
<%= render LesliView::Components::Header.new("About") %>
|
58
58
|
|
59
|
-
<div x-data="engineManager()">
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
<
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
<button
|
73
|
-
@click="toggleEngine('<%= engine[:path].gsub("/","") %>')"
|
74
|
-
:class="data.engines.includes('<%= engine[:path].gsub("/","") %>') ? 'button is-small is-info' : 'button is-small is-danger'"
|
75
|
-
x-text="data.engines.includes('<%= engine[:path].gsub("/","") %>') ? 'Activar módulo' : 'Desactivar módulo'">
|
76
|
-
</button>
|
77
|
-
</div>
|
78
|
-
</div>
|
79
|
-
<% end %>
|
80
|
-
</div>
|
59
|
+
<div class="box" x-data="engineManager()">
|
60
|
+
<% @lesli_engines.each do |engine| %>
|
61
|
+
<div>
|
62
|
+
<%= render(LesliView::Partials::EngineSpec.new(engine)) %>
|
63
|
+
<hr class="mt-4 mb-4" />
|
64
|
+
<button
|
65
|
+
@click="toggleEngine('<%= engine[:path].gsub("/","") %>')"
|
66
|
+
:class="data.engines.includes('<%= engine[:path].gsub("/","") %>') ? 'button is-small is-info' : 'button is-small is-danger'"
|
67
|
+
x-text="data.engines.includes('<%= engine[:path].gsub("/","") %>') ? 'Activar módulo' : 'Desactivar módulo'">
|
68
|
+
</button>
|
69
|
+
</div>
|
70
|
+
<hr class="my-6 has-background-grey">
|
71
|
+
<% end %>
|
81
72
|
</div>
|
82
73
|
<% end %>
|
@@ -4,7 +4,6 @@
|
|
4
4
|
<%= render(LesliView::Components::Header.new("Account information")) %>
|
5
5
|
|
6
6
|
<%= render LesliView::Components::Tabs.new do |tabs| %>
|
7
|
-
|
8
7
|
<% tabs.with_tab(title: "General Information", icon: "business") do %>
|
9
8
|
<%= form_with(model: @account, builder: LesliView::Forms::Builder) do |form| %>
|
10
9
|
<%= form.fieldset do %>
|
@@ -35,6 +35,7 @@ Building a better future, one line of code at a time.
|
|
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
37
|
<%= navigation_item(lesli_admin.about_path, "About", "ri-star-line"); %>
|
38
|
+
<%= navigation_item(lesli_admin.settings_path, "Settings", "ri-settings-4-line"); %>
|
38
39
|
|
39
40
|
<%#= navigation_item(lesli.account_path, "Localization", "ri-time-line"); %>
|
40
41
|
<%#= navigation_item(lesli.account_path, "Theming", "ri-paint-brush-line"); %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= form_with(model: setting) do |form| %>
|
2
|
+
<% if setting.errors.any? %>
|
3
|
+
<div style="color: red">
|
4
|
+
<h2><%= pluralize(setting.errors.count, "error") %> prohibited this setting from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% 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,16 @@
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
2
|
+
|
3
|
+
<% content_for :title, "Settings" %>
|
4
|
+
|
5
|
+
<h1>Settings</h1>
|
6
|
+
|
7
|
+
<div id="settings">
|
8
|
+
<% @settings.each do |setting| %>
|
9
|
+
<%= render setting %>
|
10
|
+
<p>
|
11
|
+
<%= link_to "Show this setting", setting %>
|
12
|
+
</p>
|
13
|
+
<% end %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<%= link_to "New setting", new_setting_path %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
<%= render(LesliView::Layout::Container.new("settings")) do %>
|
3
|
+
|
4
|
+
<%= render(LesliView::Components::Header.new("Settings")) %>
|
5
|
+
|
6
|
+
<%= render LesliView::Components::Tabs.new(:vertical => true) do |tabs| %>
|
7
|
+
<% tabs.with_tab(title: "About", icon: "star") do %>
|
8
|
+
<%= render(LesliView::Partials::EngineSpec.new(LesliSystem.engine(@lesli[:engine_name]))) %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
data/config/routes.rb
CHANGED
data/lib/lesli_admin/version.rb
CHANGED
data/readme.md
CHANGED
@@ -1,23 +1,27 @@
|
|
1
|
-
<div align="center">
|
2
|
-
|
1
|
+
<div align="center" class="documentation-header">
|
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
|
+
<br />
|
6
8
|
<hr/>
|
7
|
-
|
8
|
-
|
9
|
-
|
9
|
+
|
10
|
+
<div align="center" class="documentation-statics">
|
11
|
+
<a target="blank" href="https://rubygems.org/gems/lesli">
|
12
|
+
<img height="22" alt="Gem Version" src="https://badge.fury.io/rb/lesli.svg"/>
|
13
|
+
</a>
|
14
|
+
<a class="mx-2" href="https://codecov.io/github/LesliTech/Lesli">
|
15
|
+
<img height="22" src="https://codecov.io/github/LesliTech/Lesli/graph/badge.svg?token=2O12NENK5Y"/>
|
16
|
+
</a>
|
17
|
+
<a href="https://codecov.io/github/LesliTech/LesliBabel">
|
18
|
+
<img height="22" src="https://sonarcloud.io/api/project_badges/measure?project=LesliTech_LesliBabel&metric=sqale_rating"/>
|
10
19
|
</a>
|
11
20
|
</div>
|
12
|
-
<hr/>
|
13
21
|
|
22
|
+
<hr/>
|
14
23
|
<br />
|
15
24
|
|
16
|
-
<div align="center">
|
17
|
-
<img
|
18
|
-
style="width:100%;max-width:800px;border-radius:6px;"
|
19
|
-
alt="Lesli screenshot" src="./docs/images/screenshot.png" />
|
20
|
-
</div>
|
21
25
|
|
22
26
|
### Quick start
|
23
27
|
|
@@ -40,8 +44,11 @@ end
|
|
40
44
|
|
41
45
|
|
42
46
|
### Documentation
|
47
|
+
- [Account](https://www.lesli.dev/engines/admin/account)
|
48
|
+
|
49
|
+
|
50
|
+
### Lesli Documentation
|
43
51
|
* [website](https://www.lesli.dev/)
|
44
|
-
* [database](./docs/database.md)
|
45
52
|
* [documentation](https://www.lesli.dev/engines/admin/)
|
46
53
|
|
47
54
|
|
@@ -54,7 +61,7 @@ end
|
|
54
61
|
|
55
62
|
### License
|
56
63
|
-------
|
57
|
-
Copyright (c)
|
64
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
58
65
|
|
59
66
|
This program is free software: you can redistribute it and/or modify
|
60
67
|
it under the terms of the GNU General Public License as published by
|
@@ -72,8 +79,7 @@ along with this program. If not, see http://www.gnu.org/licenses/.
|
|
72
79
|
<hr />
|
73
80
|
<br />
|
74
81
|
|
75
|
-
<
|
82
|
+
<div align="center" class="has-text-centered">
|
76
83
|
<img width="200" alt="Lesli logo" src="https://cdn.lesli.tech/lesli/brand/app-logo.svg" />
|
77
|
-
<h4 align="center">Ruby on Rails SaaS Development Framework.</h4>
|
78
|
-
</
|
79
|
-
|
84
|
+
<h4 align="center" class="mt-0">Ruby on Rails SaaS Development Framework.</h4>
|
85
|
+
</div>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lesli_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Lesli Development Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-07-
|
11
|
+
date: 2025-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lesli
|
@@ -42,15 +42,18 @@ files:
|
|
42
42
|
- app/controllers/lesli_admin/dashboard/components_controller.rb
|
43
43
|
- app/controllers/lesli_admin/dashboards_controller.rb
|
44
44
|
- app/controllers/lesli_admin/profiles_controller.rb
|
45
|
+
- app/controllers/lesli_admin/settings_controller.rb
|
45
46
|
- app/helpers/lesli_admin/application_helper.rb
|
46
47
|
- app/helpers/lesli_admin/dashboards_helper.rb
|
47
48
|
- app/helpers/lesli_admin/profiles_helper.rb
|
49
|
+
- app/helpers/lesli_admin/settings_helper.rb
|
48
50
|
- app/jobs/lesli_admin/application_job.rb
|
49
51
|
- app/mailers/lesli_admin/application_mailer.rb
|
50
52
|
- app/models/lesli_admin/account.rb
|
51
53
|
- app/models/lesli_admin/application_record.rb
|
52
54
|
- app/models/lesli_admin/dashboard.rb
|
53
55
|
- app/models/lesli_admin/dashboard/component.rb
|
56
|
+
- app/models/lesli_admin/setting.rb
|
54
57
|
- app/services/lesli_admin/account_service.rb
|
55
58
|
- app/views/lesli_admin/abouts/show.html.erb
|
56
59
|
- app/views/lesli_admin/accounts/_account.html.erb
|
@@ -60,12 +63,19 @@ files:
|
|
60
63
|
- app/views/lesli_admin/accounts/new.html.erb
|
61
64
|
- app/views/lesli_admin/accounts/show.html.erb
|
62
65
|
- app/views/lesli_admin/accounts/update.turbo_stream.erb
|
66
|
+
- app/views/lesli_admin/dashboards/_component-installed-engines.html.erb
|
63
67
|
- app/views/lesli_admin/dashboards/edit.html.erb
|
64
68
|
- app/views/lesli_admin/dashboards/index.html.erb
|
65
69
|
- app/views/lesli_admin/dashboards/new.html.erb
|
66
70
|
- app/views/lesli_admin/dashboards/show.html.erb
|
67
71
|
- app/views/lesli_admin/partials/_navigation.html.erb
|
68
72
|
- app/views/lesli_admin/profiles/show.html.erb
|
73
|
+
- app/views/lesli_admin/settings/_form.html.erb
|
74
|
+
- app/views/lesli_admin/settings/_setting.html.erb
|
75
|
+
- app/views/lesli_admin/settings/edit.html.erb
|
76
|
+
- app/views/lesli_admin/settings/index.html.erb
|
77
|
+
- app/views/lesli_admin/settings/new.html.erb
|
78
|
+
- app/views/lesli_admin/settings/show.html.erb
|
69
79
|
- app/views/lesli_admin/users/edit.html.erb
|
70
80
|
- app/views/lesli_admin/users/index.html.erb
|
71
81
|
- app/views/lesli_admin/users/new.html.erb
|
@@ -107,6 +117,8 @@ metadata:
|
|
107
117
|
homepage_uri: https://www.lesli.dev/
|
108
118
|
changelog_uri: https://github.com/LesliTech/LesliAdmin
|
109
119
|
source_code_uri: https://github.com/LesliTech/LesliAdmin
|
120
|
+
bug_tracker_uri: https://github.com/LesliTech/LesliAdmin/issues
|
121
|
+
documentation_uri: https://www.lesli.dev/engines/admin
|
110
122
|
post_install_message:
|
111
123
|
rdoc_options: []
|
112
124
|
require_paths:
|