tybo 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- 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/tybo_install/templates/tailwind.config.js +1 -1
- data/lib/tybo/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99b6c52df41ad55c9a50c8f5e76dbcdf18972f4a417360ac5902f3cb203842ad
|
4
|
+
data.tar.gz: f4f9ef0ee8f3029e925b5158714b44776ac4d7ff6234fcf9328652640c137e04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42012ad58801a47d31b21905d1036b55dee575ca37f4540cb34dfb8080b004499b5da05d096ab72e5b685c3db847f3dc068991a26a23dd06bd098a045badbdcc
|
7
|
+
data.tar.gz: c163a4ddb426ffcc1f886289222a78990f08adb3b2db512b35385a2c58c9b8cb73faf3a69fc478e8e14b730a5b469182c143073f06a4083622626ae81e2b9fe4
|
@@ -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 } %>
|
@@ -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.2
|
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-06-07 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
|