lesli_letter 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +5 -0
- data/app/assets/config/lesli_letter_manifest.js +39 -0
- data/app/assets/images/lesli_letter/letter-logo.svg +1 -0
- data/app/assets/javascripts/lesli_letter/application.js +3980 -0
- data/app/assets/stylesheets/lesli_letter/application.scss +37 -0
- data/app/assets/stylesheets/lesli_letter/notebooks.scss +43 -0
- data/app/assets/stylesheets/lesli_letter/notes.scss +71 -0
- data/app/controllers/lesli_letter/accounts_controller.rb +60 -0
- data/app/controllers/lesli_letter/application_controller.rb +4 -0
- data/app/controllers/lesli_letter/dashboards_controller.rb +4 -0
- data/app/controllers/lesli_letter/notebooks_controller.rb +98 -0
- data/app/controllers/lesli_letter/notes_controller.rb +114 -0
- data/app/helpers/lesli_letter/accounts_helper.rb +4 -0
- data/app/helpers/lesli_letter/application_helper.rb +4 -0
- data/app/helpers/lesli_letter/dashboards_helper.rb +4 -0
- data/app/helpers/lesli_letter/notebooks_helper.rb +4 -0
- data/app/helpers/lesli_letter/notes_helper.rb +4 -0
- data/app/jobs/lesli_letter/application_job.rb +4 -0
- data/app/mailers/lesli_letter/application_mailer.rb +6 -0
- data/app/models/lesli_letter/account.rb +39 -0
- data/app/models/lesli_letter/application_record.rb +5 -0
- data/app/models/lesli_letter/dashboard.rb +31 -0
- data/app/models/lesli_letter/note.rb +7 -0
- data/app/models/lesli_letter/notebook.rb +7 -0
- data/app/services/lesli_letter/note_service.rb +64 -0
- data/app/services/lesli_letter/notebook_service.rb +52 -0
- data/app/views/lesli_letter/accounts/_account.html.erb +2 -0
- data/app/views/lesli_letter/accounts/_form.html.erb +17 -0
- data/app/views/lesli_letter/accounts/edit.html.erb +10 -0
- data/app/views/lesli_letter/accounts/index.html.erb +14 -0
- data/app/views/lesli_letter/accounts/new.html.erb +9 -0
- data/app/views/lesli_letter/accounts/show.html.erb +10 -0
- data/app/views/lesli_letter/dashboards/show.html.erb +1 -0
- data/app/views/lesli_letter/notebooks/edit.html.erb +10 -0
- data/app/views/lesli_letter/notebooks/index.html.erb +1 -0
- data/app/views/lesli_letter/notebooks/new.html.erb +9 -0
- data/app/views/lesli_letter/notebooks/show.html.erb +10 -0
- data/app/views/lesli_letter/notes/edit.html.erb +10 -0
- data/app/views/lesli_letter/notes/index.html.erb +1 -0
- data/app/views/lesli_letter/notes/new.html.erb +9 -0
- data/app/views/lesli_letter/notes/show.html.erb +10 -0
- data/app/views/lesli_letter/partials/_engine-navigation.html.erb +37 -0
- data/config/locales/translations.en.yml +23 -0
- data/config/locales/translations.es.yml +23 -0
- data/config/routes.rb +57 -0
- data/db/migrate/v1/0305000110_create_lesli_letter_accounts.rb +42 -0
- data/db/migrate/v1/0305050110_create_lesli_letter_dashboards.rb +51 -0
- data/db/migrate/v1/0305050210_create_lesli_letter_dashboard_components.rb +53 -0
- data/db/migrate/v1/0305100110_create_lesli_letter_notebooks.rb +46 -0
- data/db/migrate/v1/0305110110_create_lesli_letter_notes.rb +48 -0
- data/db/seed/development.rb +53 -0
- data/db/seed/production.rb +35 -0
- data/db/seed/test.rb +35 -0
- data/db/seeds.rb +43 -0
- data/lib/lesli_letter/engine.rb +49 -0
- data/lib/lesli_letter/version.rb +4 -0
- data/lib/lesli_letter.rb +6 -0
- data/lib/tasks/lesli_letter_tasks.rake +4 -0
- data/lib/vue/application.js +77 -0
- data/lib/vue/apps/notebooks/index.vue +85 -0
- data/lib/vue/apps/notes/components/note-preview.vue +45 -0
- data/lib/vue/apps/notes/index.vue +102 -0
- data/lib/vue/stores/note.js +90 -0
- data/lib/vue/stores/notebooks.js +61 -0
- data/lib/vue/stores/notes.js +61 -0
- data/lib/vue/stores/translations.json +58 -0
- data/license +674 -0
- data/readme.md +76 -0
- metadata +128 -0
@@ -0,0 +1,52 @@
|
|
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 platform.
|
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 LesliLetter
|
34
|
+
class NotebookService < Lesli::ApplicationLesliService
|
35
|
+
|
36
|
+
def find id
|
37
|
+
self.resource = current_user.account.roles.find_by_id(id)
|
38
|
+
self
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
# @return [Array] Paginated index of users.
|
43
|
+
# @description Return a paginated array of users, used mostly in frontend views
|
44
|
+
def index
|
45
|
+
current_user.account.letter.notebooks
|
46
|
+
.select(:id, :name, :description)
|
47
|
+
.page(query[:pagination][:page])
|
48
|
+
.per(query[:pagination][:perPage])
|
49
|
+
.order(updated_at: :desc, name: :asc)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= form_with(model: account) do |form| %>
|
2
|
+
<% if account.errors.any? %>
|
3
|
+
<div style="color: red">
|
4
|
+
<h2><%= pluralize(account.errors.count, "error") %> prohibited this account from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% account.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,14 @@
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Accounts</h1>
|
4
|
+
|
5
|
+
<div id="accounts">
|
6
|
+
<% @accounts.each do |account| %>
|
7
|
+
<%= render account %>
|
8
|
+
<p>
|
9
|
+
<%= link_to "Show this account", account %>
|
10
|
+
</p>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<%= link_to "New account", new_account_path %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
2
|
+
|
3
|
+
<%= render @account %>
|
4
|
+
|
5
|
+
<div>
|
6
|
+
<%= link_to "Edit this account", edit_account_path(@account) %> |
|
7
|
+
<%= link_to "Back to accounts", accounts_path %>
|
8
|
+
|
9
|
+
<%= button_to "Destroy this account", @account, method: :delete %>
|
10
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<router-view></router-view>
|
@@ -0,0 +1 @@
|
|
1
|
+
<router-view></router-view>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
2
|
+
|
3
|
+
<%= render @notebook %>
|
4
|
+
|
5
|
+
<div>
|
6
|
+
<%= link_to "Edit this notebook", edit_notebook_path(@notebook) %> |
|
7
|
+
<%= link_to "Back to notebooks", notebooks_path %>
|
8
|
+
|
9
|
+
<%= button_to "Destroy this notebook", @notebook, method: :delete %>
|
10
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<router-view></router-view>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<%
|
2
|
+
=begin
|
3
|
+
|
4
|
+
Lesli
|
5
|
+
|
6
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
7
|
+
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
9
|
+
it under the terms of the GNU General Public License as published by
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
11
|
+
(at your option) any later version.
|
12
|
+
|
13
|
+
This program is distributed in the hope that it will be useful,
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
GNU General Public License for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU General Public License
|
19
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
20
|
+
|
21
|
+
Lesli · Ruby on Rails SaaS development platform.
|
22
|
+
|
23
|
+
Made with ♥ by https://www.lesli.tech
|
24
|
+
Building a better future, one line of code at a time.
|
25
|
+
|
26
|
+
@contact hello@lesli.tech
|
27
|
+
@website https://www.lesli.tech
|
28
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
29
|
+
|
30
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
31
|
+
// ·
|
32
|
+
=end
|
33
|
+
%>
|
34
|
+
|
35
|
+
<%= navigation_item(lesli_letter.dashboard_path, "Dashboard", "ri-dashboard-3-line"); %>
|
36
|
+
<%= navigation_item(lesli_letter.notes_path, "Notes", "ri-article-line"); %>
|
37
|
+
<%= navigation_item(lesli_letter.notebooks_path, "Notebooks", "ri-booklet-line"); %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
:en:
|
3
|
+
lesli_letter:
|
4
|
+
notes:
|
5
|
+
toolbar_search_placeholder: Search by title or content...
|
6
|
+
view_title: Notes
|
7
|
+
lesli:
|
8
|
+
shared:
|
9
|
+
view_discussions: Discussions
|
10
|
+
button_add_new: Add new
|
11
|
+
button_reload: Reload
|
12
|
+
view_files: Files
|
13
|
+
view_quick_actions: Quick actions
|
14
|
+
button_list: List
|
15
|
+
button_save: Save
|
16
|
+
button_delete: Delete
|
17
|
+
button_edit: Edit
|
18
|
+
view_status_active: Active
|
19
|
+
view_status_inactive: Inactive
|
20
|
+
button_settings: Settings
|
21
|
+
application:
|
22
|
+
navigation_logout: Logout
|
23
|
+
navigation_my_profile: My profile
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
:es:
|
3
|
+
lesli_letter:
|
4
|
+
notes:
|
5
|
+
toolbar_search_placeholder: Buscar por titulo o contenido...
|
6
|
+
view_title: Notas
|
7
|
+
lesli:
|
8
|
+
shared:
|
9
|
+
view_discussions: Discusiones
|
10
|
+
button_add_new: Agregar nuevo
|
11
|
+
button_reload: Recargar
|
12
|
+
view_files: Archivos
|
13
|
+
view_quick_actions: Acciones rapidas
|
14
|
+
button_list: Lista
|
15
|
+
button_save: Guardar
|
16
|
+
button_delete: Eliminar
|
17
|
+
button_edit: Editar
|
18
|
+
view_status_active: Activo
|
19
|
+
view_status_inactive: Inactivo
|
20
|
+
button_settings: Configuración
|
21
|
+
application:
|
22
|
+
navigation_logout: Cerrar sesión
|
23
|
+
navigation_my_profile: Mi perfil
|
data/config/routes.rb
ADDED
@@ -0,0 +1,57 @@
|
|
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
|
+
LesliLetter::Engine.routes.draw do
|
33
|
+
resources :notes
|
34
|
+
|
35
|
+
# Dashboard alias
|
36
|
+
root to: "dashboards#show"
|
37
|
+
|
38
|
+
|
39
|
+
# Dashboard
|
40
|
+
resource :dashboard, only: [:show]
|
41
|
+
# resources :dashboards do
|
42
|
+
# collection do
|
43
|
+
# post "list" => :index
|
44
|
+
# get :options
|
45
|
+
# end
|
46
|
+
# scope module: :dashboard do
|
47
|
+
# resources :components
|
48
|
+
# end
|
49
|
+
# end
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
resources :notes, only: [:index, :show, :update]
|
54
|
+
resources :notebooks, only: [:index]
|
55
|
+
#resources :dashboards
|
56
|
+
#resources :accounts
|
57
|
+
end
|
@@ -0,0 +1,42 @@
|
|
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
|
+
class CreateLesliLetterAccounts < ActiveRecord::Migration[6.0]
|
34
|
+
def change
|
35
|
+
create_table :lesli_letter_accounts do |t|
|
36
|
+
t.integer :status
|
37
|
+
t.datetime :deleted_at, index: true
|
38
|
+
t.timestamps
|
39
|
+
end
|
40
|
+
add_reference(:lesli_letter_accounts, :account, foreign_key: { to_table: :lesli_accounts })
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,51 @@
|
|
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
|
+
class CreateLesliLetterDashboards < ActiveRecord::Migration[6.1]
|
34
|
+
def change
|
35
|
+
gem_path = Lesli::System.engine("Lesli", "dir")
|
36
|
+
table_base_structure = JSON.parse(File.read(File.join(gem_path, "db", "structure", "00000501_dashboards.json")))
|
37
|
+
create_table :lesli_letter_dashboards do |t|
|
38
|
+
table_base_structure.each do |column|
|
39
|
+
t.send(
|
40
|
+
column["type"].parameterize.underscore.to_sym,
|
41
|
+
column["name"].parameterize.underscore.to_sym
|
42
|
+
)
|
43
|
+
end
|
44
|
+
t.timestamps
|
45
|
+
end
|
46
|
+
|
47
|
+
add_reference(:lesli_letter_dashboards, :account, foreign_key: { to_table: :lesli_letter_accounts })
|
48
|
+
add_reference(:lesli_letter_dashboards, :user, foreign_key: { to_table: :lesli_users })
|
49
|
+
#add_reference(:lesli_admin_dashboards, :role, foreign_key: { to_table: :roles })
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,53 @@
|
|
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
|
+
class CreateLesliLetterDashboardComponents < ActiveRecord::Migration[6.1]
|
34
|
+
def change
|
35
|
+
gem_path = Lesli::System.engine("Lesli", "dir")
|
36
|
+
table_base_structure = JSON.parse(File.read(File.join(gem_path, "db", "structure", "00000502_dashboard_components.json")))
|
37
|
+
create_table :lesli_letter_dashboard_components do |t|
|
38
|
+
table_base_structure.each do |column|
|
39
|
+
t.send(
|
40
|
+
column["type"].parameterize.underscore.to_sym,
|
41
|
+
column["name"].parameterize.underscore.to_sym
|
42
|
+
)
|
43
|
+
end
|
44
|
+
t.timestamps
|
45
|
+
end
|
46
|
+
|
47
|
+
add_reference(
|
48
|
+
:lesli_letter_dashboard_components, :dashboard,
|
49
|
+
foreign_key: { to_table: :lesli_letter_dashboards },
|
50
|
+
index: { name: "lesli_letter_dashboard_components_index" }
|
51
|
+
)
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,46 @@
|
|
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
|
+
class CreateLesliLetterNotebooks < ActiveRecord::Migration[7.0]
|
34
|
+
def change
|
35
|
+
create_table :lesli_letter_notebooks do |t|
|
36
|
+
t.string :name
|
37
|
+
t.string :description
|
38
|
+
t.string :icon
|
39
|
+
t.boolean :active
|
40
|
+
t.datetime :deleted_at, index: true
|
41
|
+
t.timestamps
|
42
|
+
end
|
43
|
+
add_reference(:lesli_letter_notebooks, :user, foreign_key: { to_table: :lesli_users })
|
44
|
+
add_reference(:lesli_letter_notebooks, :account, foreign_key: { to_table: :lesli_letter_accounts })
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,48 @@
|
|
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
|
+
class CreateLesliLetterNotes < ActiveRecord::Migration[7.0]
|
34
|
+
def change
|
35
|
+
create_table :lesli_letter_notes do |t|
|
36
|
+
t.string :name
|
37
|
+
t.string :type
|
38
|
+
t.string :privacy
|
39
|
+
t.string :icon
|
40
|
+
t.text :content
|
41
|
+
t.datetime :deleted_at, index: true
|
42
|
+
t.timestamps
|
43
|
+
end
|
44
|
+
add_reference(:lesli_letter_notes, :notebook, foreign_key: { to_table: :lesli_letter_notebooks })
|
45
|
+
add_reference(:lesli_letter_notes, :user, foreign_key: { to_table: :lesli_users })
|
46
|
+
add_reference(:lesli_letter_notes, :account, foreign_key: { to_table: :lesli_letter_accounts })
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,53 @@
|
|
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
|
+
current_user = Lesli::User.first
|
34
|
+
|
35
|
+
10.times do |index|
|
36
|
+
notebook = current_user.account.letter.notebooks.create!({
|
37
|
+
:name => "Demo notebook ##{index}",
|
38
|
+
:description => "My printer number #{index} is not working",
|
39
|
+
:active => true,
|
40
|
+
:user => current_user
|
41
|
+
})
|
42
|
+
|
43
|
+
25.times do |index|
|
44
|
+
notebook.notes.create!({
|
45
|
+
:name => "Demo note ##{index}",
|
46
|
+
#:type => "",
|
47
|
+
:privacy => "private",
|
48
|
+
:content => "In the shadowy realms where darkness prevails, a fellowship emerges, forged in the crucible of adversity. Hearts ablaze with courage, swords unsheathed, they embark on an odyssey through perilous lands. Bound by a singular ring and destiny's intertwining threads, they traverse the daunting landscapes of Middle-earth. Each step echoes with the weight of history, a journey marked by sacrifice and valor. Amidst the towering peaks of Mordor, their unwavering unity stands as a beacon against the encroaching night. In this epic tale, even the smallest among them carries the potential to alter the course of history, proving that strength lies not in size but in the bonds forged on the precipice of doom.",
|
49
|
+
:user => current_user,
|
50
|
+
:account => current_user.account
|
51
|
+
})
|
52
|
+
end
|
53
|
+
end
|