tybo 0.2.0 → 0.2.3
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/components/form_component.html.erb +1 -1
- data/app/components/forms/has_one_form_component.html.erb +3 -3
- data/app/components/input/datetime_component.html.erb +6 -0
- data/app/components/input/datetime_component.rb +16 -0
- data/app/components/input/file_component.rb +1 -1
- data/lib/generators/bo/templates/_form.html.erb +7 -3
- data/lib/generators/bo/templates/index.html.erb +1 -1
- data/lib/generators/bo/templates/item.html.erb +0 -1
- data/lib/generators/tybo_install/templates/tailwind.config.js +1 -1
- data/lib/tybo/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44038010e0e9d54bf36dd444aa448f4d8896971d3063007fd6ae9f7f07e3d13c
|
4
|
+
data.tar.gz: 2a4b09953926cf89540b0f5c73bce9e7c9d9abc461deb42e2a41785e0dc07666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad7c27eafab3934de5b3dba9869eb9b47627cc66754dc3cf57cd78ced19e641d4fb805e66599141796d5e379c18d6480c8cf5f4a8461a83a38dff2ea1dadbe52
|
7
|
+
data.tar.gz: 44cf9f73f175fd796c8809b9dd6c640f5d6e4394251ee2b889a93912d6a0ff25e6b6d95e9a428f78ba6bef9b8f0c68900a679aa3f4b37caf4d80de4012c7a022
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<div class="space-y-
|
1
|
+
<div class="py-3 space-y-1 sm:space-y-2">
|
2
2
|
<div>
|
3
3
|
<h3 class="text-lg font-medium leading-6 text-gray-900"><%= @title %></h3>
|
4
4
|
</div>
|
5
|
-
<div
|
6
|
-
<div class="sm:items-start sm:gap-4 sm:border-t sm:border-gray-200
|
5
|
+
<div>
|
6
|
+
<div class="sm:items-start sm:gap-4 sm:border-t sm:border-gray-200">
|
7
7
|
<%= content %>
|
8
8
|
</div>
|
9
9
|
</div>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<div class="my-5">
|
2
|
+
<label class="block text-sm font-medium text-gray-700 string required text-sm font-medium text-gray-600">
|
3
|
+
<%= @label %>
|
4
|
+
</label>
|
5
|
+
<%= @form.datetime_field @field, class: "mt-1 block border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-tybo-500 focus:border-tybo-500 sm:text-sm string required" %>
|
6
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Input
|
4
|
+
class DatetimeComponent < ViewComponent::Base
|
5
|
+
def initialize(item:, field:, form:)
|
6
|
+
@item = item
|
7
|
+
@field = field
|
8
|
+
@form = form
|
9
|
+
@label = label
|
10
|
+
end
|
11
|
+
|
12
|
+
def label
|
13
|
+
I18n.t("bo.#{@item.class.name.underscore}.attributes.#{@field}")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,8 +1,12 @@
|
|
1
1
|
<%%= simple_form_for [:<%= options[:namespace] %>, <%= class_name.underscore %>], html: { class: "<%= class_name.underscore %> form" } do |f| %>
|
2
2
|
<!-- Model columns -->
|
3
|
-
<%- bo_model.
|
4
|
-
<%- next if excluded_columns.include?(column.to_sym) || bo_model.reflect_on_all_associations.map(&:foreign_key).include?(column) -%>
|
5
|
-
|
3
|
+
<%- bo_model.columns.each do |column| -%>
|
4
|
+
<%- next if excluded_columns.include?(column.name.to_sym) || bo_model.reflect_on_all_associations.map(&:foreign_key).include?(column.name) -%>
|
5
|
+
<%- if column.type == :datetime -%>
|
6
|
+
<%%= render(Input::DatetimeComponent.new(item: <%= class_name.underscore %>, field: '<%= column.name %>', form: f)) %>
|
7
|
+
<%- else -%>
|
8
|
+
<%%= f.input :<%= column.name %>,label: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= column.name %>') %>
|
9
|
+
<%- end -%>
|
6
10
|
<%- end -%>
|
7
11
|
<!-- belongs_to Associations -->
|
8
12
|
<%- belongs_to_assoc.each do |association| -%>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<!-- Search Bar -->
|
11
11
|
<%%= render('search_bar') %>
|
12
12
|
<!-- Table -->
|
13
|
-
<%%= turbo_frame_tag "<%= class_name.underscore.pluralize %>", class: "shadow overflow-hidden rounded border-b border-gray-200" do %>
|
13
|
+
<%%= turbo_frame_tag "<%= class_name.underscore.pluralize %>", target: '_top', class: "shadow overflow-hidden rounded border-b border-gray-200" do %>
|
14
14
|
<%%= render('table') %>
|
15
15
|
<div class="py-2">
|
16
16
|
<%%== render partial: 'shared/pagination', locals: { pagy: @pagy } %>
|
@@ -10,7 +10,6 @@
|
|
10
10
|
{ label: I18n.t('bo.<%= class_name.underscore %>.others').capitalize, path: <%= "#{options[:namespace]}_#{class_name.pluralize.underscore}_path"%> },
|
11
11
|
current_page
|
12
12
|
]) %>
|
13
|
-
<br>
|
14
13
|
<%%= render "form", <%= class_name.underscore %>: @<%= class_name.underscore %> %>
|
15
14
|
<%% end %>
|
16
15
|
<%% end %>
|
@@ -8,7 +8,7 @@ module.exports = {
|
|
8
8
|
'./app/helpers/**/*.rb',
|
9
9
|
'./app/javascript/**/*.js',
|
10
10
|
'./app/views/**/*.{erb,haml,html,slim}',
|
11
|
-
'./app/components/**/*.html
|
11
|
+
'./app/components/**/*.{erb,haml,html,rb}',
|
12
12
|
output.trim() + '/app/**/*.{erb,haml,html,rb}'
|
13
13
|
],
|
14
14
|
theme: {
|
data/lib/tybo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tybo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michel Delpierre
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-08-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -189,6 +189,8 @@ files:
|
|
189
189
|
- app/components/index_header_component.rb
|
190
190
|
- app/components/index_header_export_component.html.erb
|
191
191
|
- app/components/index_header_export_component.rb
|
192
|
+
- app/components/input/datetime_component.html.erb
|
193
|
+
- app/components/input/datetime_component.rb
|
192
194
|
- app/components/input/file_component.html.erb
|
193
195
|
- app/components/input/file_component.rb
|
194
196
|
- app/components/sidebar_component.html.erb
|
@@ -300,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
300
302
|
- !ruby/object:Gem::Version
|
301
303
|
version: '0'
|
302
304
|
requirements: []
|
303
|
-
rubygems_version: 3.
|
305
|
+
rubygems_version: 3.4.10
|
304
306
|
signing_key:
|
305
307
|
specification_version: 4
|
306
308
|
summary: A tailwind custom admin engine for Ruby on Rails
|