lesli_dashboard 0.1.0

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.
Files changed (33) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +28 -0
  3. data/Rakefile +5 -0
  4. data/app/assets/config/lesli_dashboard_manifest.js +38 -0
  5. data/app/assets/javascripts/lesli_dashboard/application.js +1 -0
  6. data/app/assets/stylesheets/lesli_dashboard/application.css +1 -0
  7. data/app/controllers/lesli_dashboard/application_controller.rb +4 -0
  8. data/app/controllers/lesli_dashboard/assistants_controller.rb +60 -0
  9. data/app/helpers/lesli_dashboard/application_helper.rb +4 -0
  10. data/app/helpers/lesli_dashboard/assistants_helper.rb +4 -0
  11. data/app/jobs/lesli_dashboard/application_job.rb +4 -0
  12. data/app/mailers/lesli_dashboard/application_mailer.rb +6 -0
  13. data/app/models/lesli_dashboard/application_record.rb +5 -0
  14. data/app/models/lesli_dashboard/assistant.rb +4 -0
  15. data/app/views/layouts/lesli_dashboard/application.html.erb +15 -0
  16. data/app/views/lesli_dashboard/assistants/edit.html.erb +10 -0
  17. data/app/views/lesli_dashboard/assistants/index.html.erb +14 -0
  18. data/app/views/lesli_dashboard/assistants/new.html.erb +9 -0
  19. data/app/views/lesli_dashboard/assistants/show.html.erb +1 -0
  20. data/config/locales/translations.en.yml +20 -0
  21. data/config/locales/translations.es.yml +20 -0
  22. data/config/routes.rb +35 -0
  23. data/db/migrate/20240303035734_create_lesli_dashboard_assistants.rb +8 -0
  24. data/lib/lesli_dashboard/engine.rb +44 -0
  25. data/lib/lesli_dashboard/version.rb +4 -0
  26. data/lib/lesli_dashboard.rb +6 -0
  27. data/lib/scss/application.scss +0 -0
  28. data/lib/tasks/lesli_dashboard_tasks.rake +4 -0
  29. data/lib/vue/application.js +54 -0
  30. data/lib/vue/apps/assistant/show.vue +33 -0
  31. data/lib/vue/stores/translations.json +48 -0
  32. data/license +674 -0
  33. metadata +105 -0
@@ -0,0 +1,4 @@
1
+ module LesliDashboard
2
+ class ApplicationController < Lesli::ApplicationLesliController
3
+ end
4
+ end
@@ -0,0 +1,60 @@
1
+ module LesliDashboard
2
+ class AssistantsController < ApplicationController
3
+ #before_action :set_assistant, only: %i[ show edit update destroy ]
4
+
5
+ # GET /assistants
6
+ def index
7
+ @assistants = Assistant.all
8
+ end
9
+
10
+ # GET /assistants/1
11
+ def show
12
+ end
13
+
14
+ # GET /assistants/new
15
+ def new
16
+ @assistant = Assistant.new
17
+ end
18
+
19
+ # GET /assistants/1/edit
20
+ def edit
21
+ end
22
+
23
+ # POST /assistants
24
+ def create
25
+ @assistant = Assistant.new(assistant_params)
26
+
27
+ if @assistant.save
28
+ redirect_to @assistant, notice: "Assistant was successfully created."
29
+ else
30
+ render :new, status: :unprocessable_entity
31
+ end
32
+ end
33
+
34
+ # PATCH/PUT /assistants/1
35
+ def update
36
+ if @assistant.update(assistant_params)
37
+ redirect_to @assistant, notice: "Assistant was successfully updated.", status: :see_other
38
+ else
39
+ render :edit, status: :unprocessable_entity
40
+ end
41
+ end
42
+
43
+ # DELETE /assistants/1
44
+ def destroy
45
+ @assistant.destroy
46
+ redirect_to assistants_url, notice: "Assistant was successfully destroyed.", status: :see_other
47
+ end
48
+
49
+ private
50
+ # Use callbacks to share common setup or constraints between actions.
51
+ def set_assistant
52
+ @assistant = Assistant.find(params[:id])
53
+ end
54
+
55
+ # Only allow a list of trusted parameters through.
56
+ def assistant_params
57
+ params.fetch(:assistant, {})
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,4 @@
1
+ module LesliDashboard
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module LesliDashboard
2
+ module AssistantsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module LesliDashboard
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module LesliDashboard
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: "from@example.com"
4
+ layout "mailer"
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module LesliDashboard
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ module LesliDashboard
2
+ class Assistant < ApplicationRecord
3
+ end
4
+ end
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Lesli dashboard</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+
8
+ <%= stylesheet_link_tag "lesli_dashboard/application", media: "all" %>
9
+ </head>
10
+ <body>
11
+
12
+ <%= yield %>
13
+
14
+ </body>
15
+ </html>
@@ -0,0 +1,10 @@
1
+ <h1>Editing assistant</h1>
2
+
3
+ <%= render "form", assistant: @assistant %>
4
+
5
+ <br>
6
+
7
+ <div>
8
+ <%= link_to "Show this assistant", @assistant %> |
9
+ <%= link_to "Back to assistants", assistants_path %>
10
+ </div>
@@ -0,0 +1,14 @@
1
+ <p style="color: green"><%= notice %></p>
2
+
3
+ <h1>Assistants</h1>
4
+
5
+ <div id="assistants">
6
+ <% @assistants.each do |assistant| %>
7
+ <%= render assistant %>
8
+ <p>
9
+ <%= link_to "Show this assistant", assistant %>
10
+ </p>
11
+ <% end %>
12
+ </div>
13
+
14
+ <%= link_to "New assistant", new_assistant_path %>
@@ -0,0 +1,9 @@
1
+ <h1>New assistant</h1>
2
+
3
+ <%= render "form", assistant: @assistant %>
4
+
5
+ <br>
6
+
7
+ <div>
8
+ <%= link_to "Back to assistants", assistants_path %>
9
+ </div>
@@ -0,0 +1 @@
1
+ <router-view></router-view>
@@ -0,0 +1,20 @@
1
+ ---
2
+ :en:
3
+ lesli:
4
+ shared:
5
+ view_discussions: Discussions
6
+ button_add_new: Add new
7
+ button_reload: Reload
8
+ view_files: Files
9
+ view_quick_actions: Quick actions
10
+ button_list: List
11
+ button_save: Save
12
+ button_delete: Delete
13
+ button_edit: Edit
14
+ view_status_active: Active
15
+ view_status_inactive: Inactive
16
+ button_settings: Settings
17
+ button_show: Show
18
+ application:
19
+ navigation_logout: Logout
20
+ navigation_my_profile: My profile
@@ -0,0 +1,20 @@
1
+ ---
2
+ :es:
3
+ lesli:
4
+ shared:
5
+ view_discussions: Discusiones
6
+ button_add_new: Agregar nuevo
7
+ button_reload: Recargar
8
+ view_files: Archivos
9
+ view_quick_actions: Acciones rapidas
10
+ button_list: Lista
11
+ button_save: Guardar
12
+ button_delete: Eliminar
13
+ button_edit: Editar
14
+ view_status_active: Activo
15
+ view_status_inactive: Inactivo
16
+ button_settings: Configuración
17
+ button_show: Ver
18
+ application:
19
+ navigation_logout: Cerrar sesión
20
+ navigation_my_profile: Mi perfil
data/config/routes.rb ADDED
@@ -0,0 +1,35 @@
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
+ LesliDashboard::Engine.routes.draw do
34
+ root to: "assistants#show"
35
+ end
@@ -0,0 +1,8 @@
1
+ class CreateLesliDashboardAssistants < ActiveRecord::Migration[7.0]
2
+ def change
3
+ create_table :lesli_dashboard_assistants do |t|
4
+
5
+ t.timestamps
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,44 @@
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
+ module LesliDashboard
34
+ class Engine < ::Rails::Engine
35
+ isolate_namespace LesliDashboard
36
+
37
+ initializer :lesli_admin do |app|
38
+
39
+ # register assets manifest
40
+ config.assets.precompile += %w[lesli_dashboard_manifest.js]
41
+
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,4 @@
1
+ module LesliDashboard
2
+ VERSION = "0.1.0"
3
+ BUILD = "1709501990"
4
+ end
@@ -0,0 +1,6 @@
1
+ require "lesli_dashboard/version"
2
+ require "lesli_dashboard/engine"
3
+
4
+ module LesliDashboard
5
+ # Your code goes here...
6
+ end
File without changes
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :lesli_dashboard do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,54 @@
1
+ /*
2
+ Lesli
3
+
4
+ Copyright (c) 2023, Lesli Technologies, S. A.
5
+
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program. If not, see http://www.gnu.org/licenses/.
18
+
19
+ Lesli · Ruby on Rails SaaS Development Framework.
20
+
21
+ Made with ♥ by https://www.lesli.tech
22
+ Building a better future, one line of code at a time.
23
+
24
+ @contact hello@lesli.tech
25
+ @website https://www.lesli.tech
26
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
27
+
28
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
29
+ // ·
30
+ */
31
+
32
+
33
+ // · Import Lesli builders
34
+ import application from "Lesli/vue/application"
35
+ import translation from "Lesli/vue/translation"
36
+
37
+
38
+ // · Import engine translations
39
+ import translations from "LesliDashboard/vue/stores/translations.json"
40
+
41
+
42
+ // · Import engine applications
43
+ import applicationAssistantShow from "LesliDashboard/vue/apps/assistant/show.vue"
44
+
45
+
46
+ // · Buil Lesli translations
47
+ translation(translations)
48
+
49
+
50
+ // · Build a new Lesli application
51
+ application("LesliDashboard", [{
52
+ path: "/",
53
+ component: applicationAssistantShow
54
+ }])
@@ -0,0 +1,33 @@
1
+ <script setup>
2
+
3
+
4
+ import { ref, onMounted } from "vue";
5
+
6
+ const lesli = Lesli;
7
+ const hour = new Date().getHours();
8
+ const welcomeTypes = ["Good morning", "Good afternoon", "Good evening"];
9
+ const welcomeText = ref("");
10
+
11
+
12
+ onMounted(()=>{
13
+ if (hour < 12) {
14
+ welcomeText.value = welcomeTypes[0]
15
+ } else if (hour < 18) {
16
+ welcomeText.value = welcomeTypes[1]
17
+ } else {
18
+ welcomeText.value = welcomeTypes[2]
19
+ }
20
+ //_lesli.value = lesli
21
+ })
22
+
23
+ </script>
24
+ <template>
25
+ <lesli-application-container>
26
+ <section class="lesli-element-header is-flex mt-6">
27
+ <div class="lesli-element-header-title is-flex">
28
+ <h1 class="subtitle is-3">{{welcomeText}},<br/>{{ lesli.current_user?.name }}</h1>
29
+ </div>
30
+ </section>
31
+
32
+ </lesli-application-container>
33
+ </template>
@@ -0,0 +1,48 @@
1
+ {
2
+ "en": {
3
+ "lesli": {
4
+ "application": {
5
+ "navigation_logout": "Logout",
6
+ "navigation_my_profile": "My profile"
7
+ },
8
+ "shared": {
9
+ "button_add_new": "Add new",
10
+ "button_delete": "Delete",
11
+ "button_edit": "Edit",
12
+ "button_list": "List",
13
+ "button_reload": "Reload",
14
+ "button_save": "Save",
15
+ "button_settings": "Settings",
16
+ "button_show": "Show",
17
+ "view_discussions": "Discussions",
18
+ "view_files": "Files",
19
+ "view_quick_actions": "Quick actions",
20
+ "view_status_active": "Active",
21
+ "view_status_inactive": "Inactive"
22
+ }
23
+ }
24
+ },
25
+ "es": {
26
+ "lesli": {
27
+ "application": {
28
+ "navigation_logout": "Cerrar sesión",
29
+ "navigation_my_profile": "Mi perfil"
30
+ },
31
+ "shared": {
32
+ "button_add_new": "Agregar nuevo",
33
+ "button_delete": "Eliminar",
34
+ "button_edit": "Editar",
35
+ "button_list": "Lista",
36
+ "button_reload": "Recargar",
37
+ "button_save": "Guardar",
38
+ "button_settings": "Configuración",
39
+ "button_show": "Ver",
40
+ "view_discussions": "Discusiones",
41
+ "view_files": "Archivos",
42
+ "view_quick_actions": "Acciones rapidas",
43
+ "view_status_active": "Activo",
44
+ "view_status_inactive": "Inactivo"
45
+ }
46
+ }
47
+ }
48
+ }