lesli_view 1.0.7 → 1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b734297630bd20e59b5d03fd383ec96dbbe1077d017bd57140dfb26ae275fc0d
4
- data.tar.gz: 33ebb5c222abe3e7bb14238364864640b7e3fcfe239dc1b728801a62e5501745
3
+ metadata.gz: dea27d123b49acd9375db16afb5ad126fb232e5b639c0f9699dc2c4825117fdf
4
+ data.tar.gz: a86fa765debb5db1d8b5a0ec487e8ee01ded407f9e6e14d32118ca8ec8ef7ca8
5
5
  SHA512:
6
- metadata.gz: c9491a1796c93dba952bc7d0bcdde90084c87d3dbe5ebf250cb56515367a1a955a9882b7c0b2ee101e70ad1d254dbca1b413345778530b5910362ea53463aaef
7
- data.tar.gz: cf82377496af49210d2ac027f8cf3008e9c178ad42ffa83cff0ae0a94101b6b8e15e021c5c08e4d6add18570e737c07ce4c13341d17d92d9bf225973fec8c8eb
6
+ metadata.gz: 8974bf2767aabad29a0606509bffb635e8f6d2384e1ffaca68dff3fa495763108178e1afc46941e55bcf0592ea9530b7015c2fe2608bc609b6a38d9dc41d03e1
7
+ data.tar.gz: 8c2d7fb73fecf7a251defb3010a45f68f2cfb1f3a77c091890e899a469e407298dbe623adb4499cf3ea748e493ecc8ef591864f753ef1b1266d40e7aad32b0be
data/Rakefile CHANGED
@@ -1,8 +1,6 @@
1
- # frozen_string_literal: true
1
+ require "bundler/setup"
2
2
 
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
3
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
4
+ load "rails/tasks/engine.rake"
7
5
 
8
- task default: :spec
6
+ require "bundler/gem_tasks"
@@ -33,12 +33,5 @@ Building a better future, one line of code at a time.
33
33
  module LesliView
34
34
  class Engine < ::Rails::Engine
35
35
  isolate_namespace LesliView
36
-
37
- initializer "lesli_view" do |app|
38
-
39
- # autoloading sass style sheet files
40
- app.config.assets.precompile += %w[lesli_view/lesli_view.scss]
41
-
42
- end
43
36
  end
44
37
  end
@@ -11,7 +11,7 @@ module LesliView
11
11
  end
12
12
 
13
13
  def text_field(method, options = {})
14
- value = @object.send(method)
14
+ value = @object.send(method) if @object
15
15
  super(method, options.merge(value: value, class: 'input'))
16
16
  end
17
17
 
@@ -0,0 +1,68 @@
1
+ <%#
2
+
3
+ Lesli
4
+
5
+ Copyright (c) 2025, 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
+ %>
32
+ <style>
33
+ .lesli-items-attachments {
34
+ .files {
35
+ display:flex;
36
+ .file-list {
37
+ padding: .2rem 1rem;
38
+ text-align: center;
39
+ span {
40
+ font-size: 2.8rem;
41
+ }
42
+ }
43
+ }
44
+ }
45
+ </style>
46
+ <article class="lesli-items-attachments box p-6" id="lesli-items-attachments">
47
+ <div class="file is-boxed">
48
+ <label class="file-label">
49
+ <input class="file-input" type="file" name="resume" />
50
+ <span class="file-cta">
51
+ <span class="material-symbols-outlined">
52
+ upload_file
53
+ </span>
54
+ <span class="file-label"> Choose a file… </span>
55
+ </span>
56
+ </label>
57
+ </div>
58
+
59
+ <div class="files">
60
+ <% ['file-word-2-line','file-excel-2-line','file-pdf-2-line'].each do |file| %>
61
+ <div class="file-list">
62
+ <span class="ri-<%= file %>"></span>
63
+ <p><%= file %></p>
64
+ </div>
65
+ <% end %>
66
+ </div>
67
+ </article>
68
+
@@ -0,0 +1,45 @@
1
+ =begin
2
+
3
+ Lesli
4
+
5
+ Copyright (c) 2025, 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
+ module LesliView
34
+ module Items
35
+ class Attachments < ViewComponent::Base
36
+ attr_reader :resource, :path_to_create
37
+
38
+ def initialize(resource, path_to_create:nil, path_to_update:nil)
39
+ @resource = resource
40
+ @path_to_create = path_to_create
41
+ @path_to_update = path_to_update
42
+ end
43
+ end
44
+ end
45
+ end
@@ -31,26 +31,27 @@ Building a better future, one line of code at a time.
31
31
  %>
32
32
  <article class="lesli-items-discussions" id="lesli-items-discussions">
33
33
  <div class="lesli-items-discussions-form">
34
+ <% discussion_class = "#{@resource.class.name.deconstantize}::Item::Discussion".constantize %>
35
+ <% scope_key = ActiveSupport::Inflector.underscore(discussion_class.name).tr("/", "_") %>
34
36
  <%= form_with(
35
- url: @path,
36
- model: @resource.discussions.new,
37
- builder: LesliView::Forms::Builder) do |form| %>
37
+ scope: scope_key,
38
+ model: discussion_class.new,
39
+ builder: LesliView::Forms::Builder,
40
+ url: helpers.polymorphic_path([:item, :discussions],
41
+ discussable_type:@resource.class.name,
42
+ discussable_id: @resource.id
43
+ )) do |form| %>
38
44
  <%= form.field_control_textarea(:message) %>
39
45
  <%= form.field_control_submit("Add comment") %>
40
46
  <% end %>
41
47
  </div>
42
- <div class="lesli-items-discussions-comments" id="lesli-comments">
43
- <% @resource.discussions.each do |comment| %>
44
- <div class="lesli-items-discussions-comments-comment is-flex mb-6">
45
- <div class="has-text-right">
46
- <strong>Luis Donis</strong> <br>
47
- <%= comment['created_at_string'] || Date2.new.date_time %>
48
- </div>
49
- <div class="ml-4 is-fullwidth lexxy-content">
50
- <%== comment.message %>
51
- </div>
52
- </div>
53
- <% end %>
48
+ <hr />
49
+ <div class="lesli-items-discussions-container">
50
+ <ul id="<%="#{scope_key}-lesli-items-discussions-list"%>">
51
+ <% @resource.discussions.order(created_at: :desc).each do |comment| %>
52
+ <%= render(LesliView::Items::Discussion.new(comment)) %>
53
+ <% end %>
54
+ </ul>
54
55
  </div>
55
56
  </article>
56
57
 
@@ -0,0 +1,55 @@
1
+ <%#
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
+ %>
32
+
33
+ <li
34
+ id="<%= dom_id(@resource, @scope_key) %>"
35
+ class="lesli-items-tasks-item is-flex mt-3 mb-3 <%= "lesli-items-tasks-task-done" if @resource.done %>">
36
+ <%= form_with(
37
+ url: helpers.polymorphic_path(@resource),
38
+ method: :patch,
39
+ scope: @scope_key,
40
+ local: true
41
+ ) do |form| %>
42
+ <%= form.hidden_field :id, value: @resource.id %>
43
+ <%= form.button type: "submit", disabled: @resource.done? do %>
44
+ <p class="icon-text">
45
+ <span class="icon">
46
+ <span class="material-symbols-outlined">
47
+ <%= @resource.done ? "check_box" : "check_box_outline_blank" %>
48
+ </span>
49
+ </span>
50
+ <span><%= @resource.title %></span>
51
+ </p>
52
+ <% end %>
53
+ <% end %>
54
+ </li>
55
+
@@ -0,0 +1,44 @@
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
+ module LesliView
34
+ module Items
35
+ class Task < ViewComponent::Base
36
+ attr_reader :resource, :scope_key
37
+
38
+ def initialize(task, scope)
39
+ @resource = task
40
+ @scope_key = scope
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,66 @@
1
+ <%#
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
+ %>
32
+ <style>
33
+ .lesli-items-tasks {
34
+ .lesli-items-tasks-tasks-task-done p {
35
+ text-decoration: line-through;
36
+ opacity: 0.6;
37
+ cursor: not-allowed;
38
+ }
39
+ }
40
+ </style>
41
+ <article class="lesli-items-tasks box p-6" id="<%= dom_id(@resource, :tasks) %>">
42
+ <div class="lesli-items-tasks-form">
43
+ <% task_class = "#{@resource.class.name.deconstantize}::Item::Task".constantize %>
44
+ <% scope_key = ActiveSupport::Inflector.underscore(task_class.name).tr("/", "_") %>
45
+ <%= form_with(
46
+ scope: scope_key,
47
+ model: task_class.new,
48
+ builder: LesliView::Forms::Builder,
49
+ url: helpers.polymorphic_path([:item, :tasks],
50
+ taskable_type:@resource.class.name,
51
+ taskable_id: @resource.id
52
+ )) do |form| %>
53
+ <%= form.field_control_text :title %>
54
+ <%= form.field_control_submit "Add task" %>
55
+ <% end %>
56
+ </div>
57
+ <hr>
58
+ <div class="lesli-items-tasks-container">
59
+ <ul id="<%="#{scope_key}-lesli-items-tasks-list"%>">
60
+ <% @resource.tasks.each do |task| %>
61
+ <%= render(LesliView::Items::Task.new(task, scope_key)) %>
62
+ <% end %>
63
+ </ul>
64
+ </div>
65
+ </article>
66
+
@@ -0,0 +1,43 @@
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
+ module LesliView
34
+ module Items
35
+ class Tasks < ViewComponent::Base
36
+ attr_reader :resource, :path_to_create
37
+
38
+ def initialize(resource)
39
+ @resource = resource
40
+ end
41
+ end
42
+ end
43
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LesliView
4
- VERSION = "1.0.7"
5
- BUILD = "1771710537"
4
+ VERSION = "1.1.0"
5
+ BUILD = "1774678451"
6
6
  end
data/lib/lesli_view.rb CHANGED
@@ -38,10 +38,13 @@ require "lesli_view/forms/builder_horizontal"
38
38
 
39
39
 
40
40
  # items
41
+ require "lesli_view/items/task"
42
+ require "lesli_view/items/tasks"
41
43
  require "lesli_view/items/actions"
42
44
  require "lesli_view/items/activities"
43
45
  require "lesli_view/items/discussion"
44
46
  require "lesli_view/items/discussions"
47
+ require "lesli_view/items/attachments"
45
48
 
46
49
 
47
50
  # loading layout
data/readme.md CHANGED
@@ -1,24 +1,15 @@
1
1
  <div align="center" class="documentation-header">
2
2
  <img width="100" alt="LesliView logo" src="./docs/images/view-logo.svg" />
3
- <h3 align="center">Web Elements & Components for The Lesli Framework.</h3>
3
+ <h3 align="center">A Rails ViewComponent-based UI library for The Lesli Framework.</h3>
4
4
  </div>
5
5
 
6
6
  <br />
7
7
  <hr/>
8
8
 
9
9
  <div align="center" class="documentation-statics">
10
- <a target="blank" href="https://github.com/LesliTech/LesliView/actions">
11
- <img alt="Tests passing" src="https://img.shields.io/badge/Tests-passing-green?style=for-the-badge&logo=github">
12
- </a>
13
10
  <a target="blank" href="https://rubygems.org/gems/lesli_view">
14
11
  <img alt="Gem Version" src="https://img.shields.io/gem/v/lesli_view?style=for-the-badge&logo=ruby">
15
12
  </a>
16
- <a target="blank" href="https://codecov.io/github/LesliTech/LesliView">
17
- <img alt="Codecov" src="https://img.shields.io/codecov/c/github/LesliTech/LesliView?style=for-the-badge&logo=codecov">
18
- </a>
19
- <a target="blank" href="https://sonarcloud.io/project/overview?id=LesliTech_LesliView">
20
- <img alt="Sonar Quality Gate" src="https://img.shields.io/sonar/quality_gate/LesliTech_LesliView?server=https%3A%2F%2Fsonarcloud.io&style=for-the-badge&logo=sonarqubecloud&label=Quality">
21
- </a>
22
13
  </div>
23
14
 
24
15
  <hr/>
@@ -32,17 +23,6 @@
32
23
  bundle add lesli_view
33
24
  ```
34
25
 
35
-
36
- <br />
37
- <hr/>
38
- <br />
39
-
40
- ### Demo
41
-
42
- * [online demo](https://demo.lesli.dev/)
43
- * [docker demo](https://github.com/LesliTech/lesli-docker-demo)
44
-
45
-
46
26
  ### Documentation
47
27
  * [website](https://www.lesli.dev/)
48
28
  * [documentation](https://www.lesli.dev/gems/view/)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lesli_view
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Lesli Development Team
@@ -15,15 +15,31 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: '4.1'
18
+ version: 4.1.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: '4.1'
26
- description: Web Elements & Components for The Lesli Framework.
25
+ version: 4.1.0
26
+ - !ruby/object:Gem::Dependency
27
+ name: lexxy
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ description: "LesliView is a ViewComponent-powered UI library for The Lesli Framework,
41
+ \nproviding reusable Rails components and form builders to create consistent, \nscalable,
42
+ and maintainable application interfaces.\n"
27
43
  email:
28
44
  - hello@lesli.tech
29
45
  executables: []
@@ -74,11 +90,17 @@ files:
74
90
  - lib/lesli_view/items/activities.html.erb
75
91
  - lib/lesli_view/items/activities.rb
76
92
  - lib/lesli_view/items/activities.scss
93
+ - lib/lesli_view/items/attachments.html.erb
94
+ - lib/lesli_view/items/attachments.rb
77
95
  - lib/lesli_view/items/discussion.html.erb
78
96
  - lib/lesli_view/items/discussion.rb
79
97
  - lib/lesli_view/items/discussions.html.erb
80
98
  - lib/lesli_view/items/discussions.rb
81
99
  - lib/lesli_view/items/discussions.scss
100
+ - lib/lesli_view/items/task.html.erb
101
+ - lib/lesli_view/items/task.rb
102
+ - lib/lesli_view/items/tasks.html.erb
103
+ - lib/lesli_view/items/tasks.rb
82
104
  - lib/lesli_view/layout/container.html.erb
83
105
  - lib/lesli_view/layout/container.rb
84
106
  - lib/lesli_view/partials/engine_spec.html.erb
@@ -101,8 +123,10 @@ licenses:
101
123
  - GPL-3.0
102
124
  metadata:
103
125
  homepage_uri: https://www.lesli.dev/
104
- changelog_uri: https://github.com/LesliTech/LesliView
126
+ changelog_uri: https://github.com/LesliTech/LesliView/releases
105
127
  source_code_uri: https://github.com/LesliTech/LesliView
128
+ bug_tracker_uri: https://github.com/LesliTech/LesliView/issues
129
+ documentation_uri: https://www.lesli.dev/gems/view/
106
130
  rdoc_options: []
107
131
  require_paths:
108
132
  - lib
@@ -110,7 +134,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
134
  requirements:
111
135
  - - ">="
112
136
  - !ruby/object:Gem::Version
113
- version: '2.7'
137
+ version: '0'
114
138
  required_rubygems_version: !ruby/object:Gem::Requirement
115
139
  requirements:
116
140
  - - ">="
@@ -119,5 +143,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
143
  requirements: []
120
144
  rubygems_version: 3.7.1
121
145
  specification_version: 4
122
- summary: Web Elements & Components for The Lesli Framework.
146
+ summary: A Rails ViewComponent-based UI library for The Lesli Framework.
123
147
  test_files: []