lesli_view 1.0.4 → 1.0.6
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/lib/lesli_view/components/header.html.erb +14 -11
- data/lib/lesli_view/components/header.rb +3 -2
- data/lib/lesli_view/components/tabs.html.erb +1 -1
- data/lib/lesli_view/elements/table.html.erb +1 -1
- data/lib/lesli_view/items/discussion.html.erb +9 -0
- data/lib/lesli_view/items/discussion.rb +42 -0
- data/lib/lesli_view/items/discussions.html.erb +56 -0
- data/lib/lesli_view/items/discussions.rb +43 -0
- data/lib/lesli_view/items/discussions.scss +47 -0
- data/lib/lesli_view/layout/container.html.erb +1 -1
- data/lib/lesli_view/version.rb +2 -2
- data/lib/lesli_view/widgets/calendar.html.erb +135 -0
- data/lib/lesli_view/widgets/calendar.rb +44 -0
- data/lib/lesli_view/widgets/chart.html.erb +28 -0
- data/lib/lesli_view/widgets/chart.rb +45 -0
- data/lib/lesli_view/widgets/count.html.erb +16 -0
- data/lib/lesli_view/widgets/count.rb +44 -0
- data/lib/lesli_view/widgets/date.html.erb +22 -0
- data/lib/lesli_view/widgets/date.rb +43 -0
- data/lib/lesli_view/widgets/weather.html.erb +44 -0
- data/lib/lesli_view/widgets/weather.rb +43 -0
- data/lib/lesli_view.rb +12 -0
- metadata +20 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 23e41118aed61f81b4b11d893ac216ce39589c80fedf71717295702a05b69c13
|
|
4
|
+
data.tar.gz: a35dbb7d5035e99900eac523d10804309d63e69da2c6fc5d5e958db4ea468b77
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 81ce9692655a2c0c07bdb28ed47444ab232aa3a090fabb55e2935bddc6a3578df1fa55904d87ae6976389b551fe3c8e030e9a880f9ff4dd7421dff32c473cdcd
|
|
7
|
+
data.tar.gz: 6f53d41293f5486972a5295a84b56a25fce059ffed8fa4cd72b0e98d71db3636e9d19681c1066a7c5903e6633732cba2c76722b1c9c2e2eccc9bce4deea641c3
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
<section class="lesli-element-header is-flex">
|
|
2
|
-
<div class="lesli-element-header-title
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<div class="lesli-element-header-title">
|
|
3
|
+
<div class="is-flex">
|
|
4
|
+
<% if back %>
|
|
5
|
+
<%= link_to(
|
|
6
|
+
back || request.referer || root_path,
|
|
7
|
+
class: "button is-info is-outlined mr-4 mb-1",
|
|
8
|
+
data: { turbo_frame: '_top' }) do %>
|
|
9
|
+
<span class="material-symbols">arrow_back</span>
|
|
10
|
+
<% end %>
|
|
9
11
|
<% end %>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
<% if title.present? %>
|
|
13
|
+
<h1 class="subtitle is-size-3 mb-1"><%= title %></h1>
|
|
14
|
+
<% end %>
|
|
15
|
+
</div>
|
|
16
|
+
<p><%= subtitle %> </p>
|
|
14
17
|
</div>
|
|
15
18
|
<div class="lesli-element-header-items is-flex is-flex-grow-1 is-justify-content-end">
|
|
16
19
|
<% if new_path %>
|
|
@@ -35,10 +35,11 @@ Building a better future, one line of code at a time.
|
|
|
35
35
|
module LesliView
|
|
36
36
|
module Components
|
|
37
37
|
class Header < ViewComponent::Base
|
|
38
|
-
attr_reader :title, :back, :new_path
|
|
38
|
+
attr_reader :title, :subtitle, :back, :new_path
|
|
39
39
|
|
|
40
|
-
def initialize(title, new_path:nil, back:nil)
|
|
40
|
+
def initialize(title, subtitle="", new_path:nil, back:nil)
|
|
41
41
|
@title = title
|
|
42
|
+
@subtitle = subtitle
|
|
42
43
|
@back = back
|
|
43
44
|
@new_path = new_path
|
|
44
45
|
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<div class="lesli-items-discussions-comments-comment is-flex mb-6">
|
|
2
|
+
<div class="has-text-right">
|
|
3
|
+
<strong>Luis Donis</strong> <br>
|
|
4
|
+
<%= discussion['created_at_string'] || Date2.new.date_time %>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="ml-4 is-fullwidth">
|
|
7
|
+
<%== discussion.message %>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
module LesliView
|
|
33
|
+
module Items
|
|
34
|
+
class Discussion < ViewComponent::Base
|
|
35
|
+
attr_reader :discussion
|
|
36
|
+
|
|
37
|
+
def initialize(discussion)
|
|
38
|
+
@discussion = discussion
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
<article class="lesli-items-discussions" id="lesli-items-discussions">
|
|
33
|
+
<div class="lesli-items-discussions-form">
|
|
34
|
+
<%= form_with(
|
|
35
|
+
url: @path,
|
|
36
|
+
model: @resource.discussions.new,
|
|
37
|
+
builder: LesliView::Forms::Builder) do |form| %>
|
|
38
|
+
<%= form.field_text_editor(:message) %>
|
|
39
|
+
<%= form.field_control_submit("Add comment") %>
|
|
40
|
+
<% end %>
|
|
41
|
+
</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">
|
|
50
|
+
<%== comment.message %>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<% end %>
|
|
54
|
+
</div>
|
|
55
|
+
</article>
|
|
56
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
module LesliView
|
|
33
|
+
module Items
|
|
34
|
+
class Discussions < ViewComponent::Base
|
|
35
|
+
attr_reader :resource, :path
|
|
36
|
+
|
|
37
|
+
def initialize(resource, path=nil)
|
|
38
|
+
@resource = resource
|
|
39
|
+
@path = path
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
|
|
33
|
+
@use "lesli-css" as lesli;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
.lesli-items-discussions {
|
|
37
|
+
background-color: white;
|
|
38
|
+
padding: 2rem;
|
|
39
|
+
|
|
40
|
+
&-form {
|
|
41
|
+
padding: 1rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-comments {
|
|
45
|
+
padding: 1rem;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
<!-- app/components/lesli_application_container_component.html.erb -->
|
|
3
3
|
<turbo-frame
|
|
4
4
|
id="<%= turbo_frame_id %>"
|
|
5
|
-
class="lesli-application-container container <%= 'is-fluid' if dashboard %>
|
|
5
|
+
class="lesli-application-container container <%= 'is-fluid' if dashboard %>">
|
|
6
6
|
<%= content %>
|
|
7
7
|
</turbo-frame>
|
data/lib/lesli_view/version.rb
CHANGED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
.lesli-view-widgets-calendar .box {
|
|
3
|
+
padding: 14px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.lesli-view-widgets-calendar-content .weekday,
|
|
7
|
+
.lesli-view-widgets-calendar-content .days {
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-columns: repeat(7, 1fr);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.lesli-view-widgets-calendar-content .weekday li,
|
|
13
|
+
.lesli-view-widgets-calendar-content .days li {
|
|
14
|
+
display: grid;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.lesli-view-widgets-calendar-content .weekday li a,
|
|
18
|
+
.lesli-view-widgets-calendar-content .days li a {
|
|
19
|
+
text-transform: uppercase;
|
|
20
|
+
display: grid;
|
|
21
|
+
place-items: center;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
color: #747978;
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.lesli-view-widgets-calendar-content .weekday li a {
|
|
29
|
+
margin-bottom: 8px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.lesli-view-widgets-calendar-content .days li a {
|
|
33
|
+
border-radius: 5px;
|
|
34
|
+
font-weight: bold;
|
|
35
|
+
padding: 4px 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.lesli-view-widgets-calendar-content .days li .selected{
|
|
39
|
+
background-color: #F5A1A3!important;
|
|
40
|
+
color: #ffffff;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.lesli-view-widgets-calendar-content .days li a:hover{
|
|
44
|
+
background-color: #EEEDE9;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.lesli-view-widgets-calendar-content .days li .event{
|
|
48
|
+
color: #F5A1A3;
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
51
|
+
<div class="lesli-view-widgets-calendar">
|
|
52
|
+
<div class="box">
|
|
53
|
+
<div class="lesli-view-widgets-calendar-content">
|
|
54
|
+
<ul class="weekday">
|
|
55
|
+
<li><a href="#" title="Sun" data-value="7">Sun</a></li>
|
|
56
|
+
<li><a href="#" title="Mon" data-value="1">Mon</a></li>
|
|
57
|
+
<li><a href="#" title="Tue" data-value="2">Tue</a></li>
|
|
58
|
+
<li><a href="#" title="Wed" data-value="3">Wed</a></li>
|
|
59
|
+
<li><a href="#" title="Thu" data-value="4">Thu</a></li>
|
|
60
|
+
<li><a href="#" title="Fri" data-value="5">Fri</a></li>
|
|
61
|
+
<li><a href="#" title="Say" data-value="6">Sat</a></li>
|
|
62
|
+
</ul>
|
|
63
|
+
<ul class="days" id="lesli-view-widgets-calendar-days">
|
|
64
|
+
</ul>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<script>
|
|
69
|
+
(() => {
|
|
70
|
+
|
|
71
|
+
const current = new Date();
|
|
72
|
+
|
|
73
|
+
const daysEl = document.getElementById('lesli-view-widgets-calendar-days');
|
|
74
|
+
|
|
75
|
+
// Example event days (YYYY-MM-DD)
|
|
76
|
+
const events = new Set([
|
|
77
|
+
'2026-01-08',
|
|
78
|
+
'2026-01-10',
|
|
79
|
+
'2026-01-27'
|
|
80
|
+
]);
|
|
81
|
+
|
|
82
|
+
function renderCalendar(date) {
|
|
83
|
+
daysEl.innerHTML = '';
|
|
84
|
+
|
|
85
|
+
const year = date.getFullYear();
|
|
86
|
+
const month = date.getMonth();
|
|
87
|
+
|
|
88
|
+
// Monday-based week
|
|
89
|
+
const firstDay = new Date(year, month, 1);
|
|
90
|
+
|
|
91
|
+
const start = firstDay.getDay(); // 0 = Sunday, 6 = Saturday
|
|
92
|
+
|
|
93
|
+
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
94
|
+
|
|
95
|
+
// Empty cells before first day
|
|
96
|
+
for (let i = 0; i < start; i++) {
|
|
97
|
+
daysEl.appendChild(document.createElement('li'));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Days
|
|
101
|
+
for (let day = 1; day <= daysInMonth; day++) {
|
|
102
|
+
const li = document.createElement('li');
|
|
103
|
+
const a = document.createElement('a');
|
|
104
|
+
|
|
105
|
+
const dateStr = `${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`;
|
|
106
|
+
|
|
107
|
+
a.textContent = day;
|
|
108
|
+
a.href = '#';
|
|
109
|
+
a.dataset.value = day;
|
|
110
|
+
|
|
111
|
+
if (events.has(dateStr)) a.classList.add('event');
|
|
112
|
+
|
|
113
|
+
if (
|
|
114
|
+
day === new Date().getDate() &&
|
|
115
|
+
month === new Date().getMonth() &&
|
|
116
|
+
year === new Date().getFullYear()
|
|
117
|
+
) {
|
|
118
|
+
a.classList.add('selected');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
a.addEventListener('click', e => {
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
document
|
|
124
|
+
.querySelectorAll('.days a.selected')
|
|
125
|
+
.forEach(el => el.classList.remove('selected'));
|
|
126
|
+
a.classList.add('selected');
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
li.appendChild(a);
|
|
130
|
+
daysEl.appendChild(li);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
renderCalendar(current);
|
|
134
|
+
})();
|
|
135
|
+
</script>
|
|
@@ -0,0 +1,44 @@
|
|
|
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 Widgets
|
|
35
|
+
class Calendar < ViewComponent::Base
|
|
36
|
+
attr_reader :title, :number
|
|
37
|
+
|
|
38
|
+
def initialize(title=nil, number=nil)
|
|
39
|
+
@title = title
|
|
40
|
+
@number = number
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
.lesli-view-widgets-chart {
|
|
3
|
+
}
|
|
4
|
+
</style>
|
|
5
|
+
|
|
6
|
+
<%
|
|
7
|
+
# Determine the chart component class dynamically
|
|
8
|
+
chart_component = case type
|
|
9
|
+
when :bar
|
|
10
|
+
LesliView::Charts::Bar
|
|
11
|
+
when :line
|
|
12
|
+
LesliView::Charts::Line
|
|
13
|
+
else
|
|
14
|
+
nil # Handle unknown types gracefully
|
|
15
|
+
end
|
|
16
|
+
%>
|
|
17
|
+
|
|
18
|
+
<div class="lesli-view-widgets-chart">
|
|
19
|
+
<% if chart_component %>
|
|
20
|
+
<%= render(chart_component.new(
|
|
21
|
+
title: title,
|
|
22
|
+
labels: data.map{ |i| i[0] },
|
|
23
|
+
serie: data.map{ |i| i[1] },
|
|
24
|
+
height: '132px',
|
|
25
|
+
compact: true
|
|
26
|
+
)) %>
|
|
27
|
+
<% end %>
|
|
28
|
+
</div>
|
|
@@ -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 Widgets
|
|
35
|
+
class Chart < ViewComponent::Base
|
|
36
|
+
attr_reader :title, :data, :type
|
|
37
|
+
|
|
38
|
+
def initialize(title=nil, data=nil, type: :bar)
|
|
39
|
+
@title = title
|
|
40
|
+
@data = data
|
|
41
|
+
@type = type
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
.lesli-view-widgets-count p {
|
|
3
|
+
font-size: 4rem;
|
|
4
|
+
font-weight: 600;
|
|
5
|
+
}
|
|
6
|
+
</style>
|
|
7
|
+
<div class="lesli-view-widgets-count">
|
|
8
|
+
<div class="box">
|
|
9
|
+
<h6 class="is-title is-size-6 mb-0">
|
|
10
|
+
<%= title %>
|
|
11
|
+
</h6>
|
|
12
|
+
<p class="has-text-centered">
|
|
13
|
+
<%= number %>
|
|
14
|
+
</p>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,44 @@
|
|
|
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 Widgets
|
|
35
|
+
class Count < ViewComponent::Base
|
|
36
|
+
attr_reader :title, :number
|
|
37
|
+
|
|
38
|
+
def initialize(title=nil, number=nil)
|
|
39
|
+
@title = title
|
|
40
|
+
@number = number
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
.lesli-view-widgets-date p.date {
|
|
3
|
+
font-weight: 200;
|
|
4
|
+
font-size: 4.2rem;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.lesli-view-widgets-date p.month {
|
|
8
|
+
font-weight: 300;
|
|
9
|
+
font-size: 1.8rem;
|
|
10
|
+
color: #d2d2d2;
|
|
11
|
+
}
|
|
12
|
+
</style>
|
|
13
|
+
<div class="lesli-view-widgets-date">
|
|
14
|
+
<div class="box has-text-centered">
|
|
15
|
+
<p class="date">
|
|
16
|
+
<%= @date.day %>
|
|
17
|
+
</h6>
|
|
18
|
+
<p class="month">
|
|
19
|
+
<%= @date.strftime("%B") %>
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,43 @@
|
|
|
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 Widgets
|
|
35
|
+
class Date < ViewComponent::Base
|
|
36
|
+
attr_reader :date
|
|
37
|
+
|
|
38
|
+
def initialize(date = Time.now)
|
|
39
|
+
@date = date
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
|
|
3
|
+
.lesli-view-widgets-weather .box p.temperature {
|
|
4
|
+
font-weight: 200;
|
|
5
|
+
font-size: 4.2rem;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.lesli-view-widgets-weather .box p.city {
|
|
9
|
+
font-weight: 300;
|
|
10
|
+
font-size: 1.8rem;
|
|
11
|
+
color: #d2d2d2;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.lesli-view-widgets-weather .box .icon {
|
|
15
|
+
width: 50px;
|
|
16
|
+
height: 50px;
|
|
17
|
+
float: right;
|
|
18
|
+
font-size: 1.8rem;
|
|
19
|
+
margin: 20px 20px 0 0;
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.lesli-view-widgets-weather .box .icon.sun {
|
|
24
|
+
color: white;
|
|
25
|
+
background: #ffcd41;
|
|
26
|
+
box-shadow: rgba(255, 255, 0, 0.2) 0 0 0 17px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.lesli-view-widgets-weather .box .icon.cloud {
|
|
30
|
+
color: white;
|
|
31
|
+
background: #7cc8ff;
|
|
32
|
+
box-shadow: rgba(124, 200, 255, 0.25) 0 0 0 17px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
</style>
|
|
36
|
+
<div class="lesli-view-widgets-weather">
|
|
37
|
+
<div class="box">
|
|
38
|
+
<span class="icon cloud">
|
|
39
|
+
<span class="ri-showers-line"></span>
|
|
40
|
+
</span>
|
|
41
|
+
<p class="temperature">26º</p>
|
|
42
|
+
<p class="city">Guatemala</p>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
@@ -0,0 +1,43 @@
|
|
|
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 Widgets
|
|
35
|
+
class Weather < ViewComponent::Base
|
|
36
|
+
attr_reader :date
|
|
37
|
+
|
|
38
|
+
def initialize(date = Time.now)
|
|
39
|
+
@date = date
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
data/lib/lesli_view.rb
CHANGED
|
@@ -37,6 +37,11 @@ require "lesli_view/forms/builder"
|
|
|
37
37
|
require "lesli_view/forms/builder_horizontal"
|
|
38
38
|
|
|
39
39
|
|
|
40
|
+
# items
|
|
41
|
+
require "lesli_view/items/discussion"
|
|
42
|
+
require "lesli_view/items/discussions"
|
|
43
|
+
|
|
44
|
+
|
|
40
45
|
# loading layout
|
|
41
46
|
require "lesli_view/layout/container"
|
|
42
47
|
|
|
@@ -45,6 +50,13 @@ require "lesli_view/layout/container"
|
|
|
45
50
|
require "lesli_view/partials/engine_spec"
|
|
46
51
|
|
|
47
52
|
|
|
53
|
+
# widgets
|
|
54
|
+
require "lesli_view/widgets/date"
|
|
55
|
+
require "lesli_view/widgets/count"
|
|
56
|
+
require "lesli_view/widgets/chart"
|
|
57
|
+
require "lesli_view/widgets/weather"
|
|
58
|
+
require "lesli_view/widgets/calendar"
|
|
59
|
+
|
|
48
60
|
module LesliView
|
|
49
61
|
class Error < StandardError; end
|
|
50
62
|
# Your code goes here...
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lesli_view
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- The Lesli Development Team
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: view_component
|
|
@@ -16,14 +15,14 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - "~>"
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 4.
|
|
18
|
+
version: '4.1'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - "~>"
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 4.
|
|
25
|
+
version: '4.1'
|
|
27
26
|
description: Web Elements & Components for The Lesli Framework.
|
|
28
27
|
email:
|
|
29
28
|
- hello@lesli.tech
|
|
@@ -70,11 +69,26 @@ files:
|
|
|
70
69
|
- lib/lesli_view/forms/fieldset.rb
|
|
71
70
|
- lib/lesli_view/forms/form.scss
|
|
72
71
|
- lib/lesli_view/forms/inputs.rb
|
|
72
|
+
- lib/lesli_view/items/discussion.html.erb
|
|
73
|
+
- lib/lesli_view/items/discussion.rb
|
|
74
|
+
- lib/lesli_view/items/discussions.html.erb
|
|
75
|
+
- lib/lesli_view/items/discussions.rb
|
|
76
|
+
- lib/lesli_view/items/discussions.scss
|
|
73
77
|
- lib/lesli_view/layout/container.html.erb
|
|
74
78
|
- lib/lesli_view/layout/container.rb
|
|
75
79
|
- lib/lesli_view/partials/engine_spec.html.erb
|
|
76
80
|
- lib/lesli_view/partials/engine_spec.rb
|
|
77
81
|
- lib/lesli_view/version.rb
|
|
82
|
+
- lib/lesli_view/widgets/calendar.html.erb
|
|
83
|
+
- lib/lesli_view/widgets/calendar.rb
|
|
84
|
+
- lib/lesli_view/widgets/chart.html.erb
|
|
85
|
+
- lib/lesli_view/widgets/chart.rb
|
|
86
|
+
- lib/lesli_view/widgets/count.html.erb
|
|
87
|
+
- lib/lesli_view/widgets/count.rb
|
|
88
|
+
- lib/lesli_view/widgets/date.html.erb
|
|
89
|
+
- lib/lesli_view/widgets/date.rb
|
|
90
|
+
- lib/lesli_view/widgets/weather.html.erb
|
|
91
|
+
- lib/lesli_view/widgets/weather.rb
|
|
78
92
|
- license
|
|
79
93
|
- readme.md
|
|
80
94
|
homepage: https://www.lesli.dev/
|
|
@@ -84,7 +98,6 @@ metadata:
|
|
|
84
98
|
homepage_uri: https://www.lesli.dev/
|
|
85
99
|
changelog_uri: https://github.com/LesliTech/LesliView
|
|
86
100
|
source_code_uri: https://github.com/LesliTech/LesliView
|
|
87
|
-
post_install_message:
|
|
88
101
|
rdoc_options: []
|
|
89
102
|
require_paths:
|
|
90
103
|
- lib
|
|
@@ -99,8 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
99
112
|
- !ruby/object:Gem::Version
|
|
100
113
|
version: '0'
|
|
101
114
|
requirements: []
|
|
102
|
-
rubygems_version: 3.
|
|
103
|
-
signing_key:
|
|
115
|
+
rubygems_version: 3.7.1
|
|
104
116
|
specification_version: 4
|
|
105
117
|
summary: Web Elements & Components for The Lesli Framework.
|
|
106
118
|
test_files: []
|