tybo 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9adcf1453a167d928120910dee95eb19b31e018593b09cff193c5fea7f1148e1
4
- data.tar.gz: 45d9027230f376f2634e42b0c9584d0e772792f36444f30b9d594200d8cbd6b1
3
+ metadata.gz: d93a3e02b0858c49f45215e8457294b3dbe7a70e66c9cdce463324a86cc65414
4
+ data.tar.gz: '09ca1b2fadff5a2bc2d8c0c32192bd506618916c9cb734341831b2e3478b1d37'
5
5
  SHA512:
6
- metadata.gz: c1fd62b3a41a0638c9da59f555198aac3d0349031095210167ecd4267255b999ad0715b57c821e96e0e7b943e85af6071dd8862c01fec8129c9a8c84cc4bd20a
7
- data.tar.gz: 9be1f03398c851dcf2c31b29e0ddebaa4d26911118c61b5d4cf214ac413cc3b7276d82332b26a5b60778ac3120e405733879934fae05844f7b571a13f71e88e7
6
+ metadata.gz: 74f8a9aaafeeea63b8a26d8336a9d77d7d945e04c106b3e2703c1d4900e1d0a0f7a11398aa87b2ee0e948c86cd8c24959737d3263eff66360baca567a61a9ce0
7
+ data.tar.gz: 237dc58da09eee1ce80bd2295778acd88cc715089726e067755b9b6340530f58dda6c84b707fc7115b450a8f5a4e81733e22da099492470f4975b18b548c240f
@@ -0,0 +1,10 @@
1
+ <div class="space-y-6 sm:space-y-5">
2
+ <div>
3
+ <h3 class="text-lg font-medium leading-6 text-gray-900"><%= @title %></h3>
4
+ </div>
5
+ <div class="space-y-6 sm:space-y-5">
6
+ <div class="sm:items-start sm:gap-4 sm:border-t sm:border-gray-200 sm:pt-5">
7
+ <%= content %>
8
+ </div>
9
+ </div>
10
+ </div>
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ module Forms
3
+ class HasOneFormComponent < ViewComponent::Base
4
+ def initialize(title:)
5
+ @title = title
6
+ end
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
- <svg class="mr-3 flex-shrink-0 h-6 w-6 text-sidebar-50" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
1
+ <svg class="mr-3 flex-shrink-0 text-white h-6 w-6 text-sidebar-50" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
2
2
  <path stroke-linecap="round" stroke-linejoin="round" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" />
3
3
  </svg>
@@ -1,3 +1,4 @@
1
- <svg class="mr-3 flex-shrink-0 h-6 w-6 text-sidebar-50" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
1
+ <svg class="mr-3 flex-shrink-0 h-6 w-6 text-white text-sidebar-50" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
2
2
  <path stroke-linecap="round" stroke-linejoin="round" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
3
3
  </svg>
4
+
@@ -1,3 +1,3 @@
1
- <svg class="mr-3 flex-shrink-0 h-6 w-6 text-sidebar-50" xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
1
+ <svg class="mr-3 flex-shrink-0 h-6 w-6 text-white text-sidebar-50" xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
2
2
  <path stroke-linecap="round" stroke-linejoin="round" d="M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z" />
3
3
  </svg>
@@ -1,3 +1,3 @@
1
- <svg class="mr-3 flex-shrink-0 h-6 w-6 text-sidebar-50" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
1
+ <svg class="mr-3 flex-shrink-0 h-6 w-6 text-white text-sidebar-50" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
2
2
  <path stroke-linecap="round" stroke-linejoin="round" d="M12 7.5h1.5m-1.5 3h1.5m-7.5 3h7.5m-7.5 3h7.5m3-9h3.375c.621 0 1.125.504 1.125 1.125V18a2.25 2.25 0 01-2.25 2.25M16.5 7.5V18a2.25 2.25 0 002.25 2.25M16.5 7.5V4.875c0-.621-.504-1.125-1.125-1.125H4.125C3.504 3.75 3 4.254 3 4.875V18a2.25 2.25 0 002.25 2.25h13.5M6 7.5h3v3H6v-3z" />
3
3
  </svg>
@@ -1,3 +1,3 @@
1
- <svg class="mr-3 flex-shrink-0 h-6 w-6 text-sidebar-50" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
1
+ <svg class="mr-3 flex-shrink-0 h-6 w-6 text-white text-sidebar-50" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
2
2
  <path stroke-linecap="round" stroke-linejoin="round" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
3
3
  </svg>
@@ -1,3 +1,3 @@
1
- <svg class="mr-3 flex-shrink-0 h-6 w-6 text-sidebar-50" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
1
+ <svg class="mr-3 flex-shrink-0 h-6 w-6 text-white text-sidebar-50" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
2
2
  <path stroke-linecap="round" stroke-linejoin="round" d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
3
3
  </svg>
@@ -1,3 +1,3 @@
1
- <svg class="mr-3 flex-shrink-0 h-6 w-6" xmlns="http://www.w3.org/2000/svg" className="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
1
+ <svg class="mr-3 flex-shrink-0 h-6 w-6 text-white" xmlns="http://www.w3.org/2000/svg" className="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
2
2
  <path strokeLinecap="round" strokeLinejoin="round" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
3
3
  </svg>
@@ -1,3 +1,3 @@
1
- <svg class="mr-3 flex-shrink-0 h-6 w-6 text-sidebar-50" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
1
+ <svg class="mr-3 flex-shrink-0 h-6 w-6 text-white text-sidebar-50" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
2
2
  <path stroke-linecap="round" stroke-linejoin="round" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"/>
3
3
  </svg>
@@ -13,7 +13,15 @@
13
13
  <%- if association.options[:class_name] == "ActionText::RichText" -%>
14
14
  <%%= f.rich_text_area :<%= association.name.to_s.singularize.to_s.remove('rich_text_' )%> %>
15
15
  <%- else -%>
16
- <%%= f.input :<%= association.foreign_key %>, collection: <%= association.klass.name %>.all.map { |item| [item.<%=bo_model_title(association.klass.name.constantize)%>, item.id] } %>
16
+ <%%= render(Forms::HasOneFormComponent.new(title: I18n.t('bo.<%= association.name %>.one') )) do %>
17
+ <%%= f.simple_fields_for :<%= association.name.to_s %> do |<%= association.name.to_s %>_form| %>
18
+ <%- association.klass.column_names.each do |column| -%>
19
+ <%- next if excluded_columns.include?(column.to_sym) || bo_model.reflect_on_all_associations.map(&:foreign_key).include?(column) -%>
20
+ <%- simple_form_alias = %w[country country_code].include?(column) ? ',as: :string' : nil -%>
21
+ <%%= <%= association.name.to_s %>_form.input :<%= column %> <%= simple_form_alias %> %>
22
+ <%- end -%>
23
+ <%% end %>
24
+ <%% end %>
17
25
  <%- end -%>
18
26
  <%- end -%>
19
27
 
data/lib/tybo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tybo
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tybo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Delpierre
8
8
  - Julien Camblan
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-02-06 00:00:00.000000000 Z
12
+ date: 2023-02-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -141,6 +141,8 @@ files:
141
141
  - app/components/forms/delete_button_component.rb
142
142
  - app/components/forms/divider_component.html.erb
143
143
  - app/components/forms/divider_component.rb
144
+ - app/components/forms/has_one_form_component.html.erb
145
+ - app/components/forms/has_one_form_component.rb
144
146
  - app/components/forms/submit_button_component.html.erb
145
147
  - app/components/forms/submit_button_component.rb
146
148
  - app/components/forms/subtitle_component.html.erb
@@ -258,7 +260,7 @@ licenses:
258
260
  - MIT
259
261
  metadata:
260
262
  homepage_uri: https://rubygems.org/gems/tybo
261
- post_install_message:
263
+ post_install_message:
262
264
  rdoc_options: []
263
265
  require_paths:
264
266
  - lib
@@ -273,8 +275,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
273
275
  - !ruby/object:Gem::Version
274
276
  version: '0'
275
277
  requirements: []
276
- rubygems_version: 3.0.3.1
277
- signing_key:
278
+ rubygems_version: 3.2.3
279
+ signing_key:
278
280
  specification_version: 4
279
281
  summary: A tailwind custom admin engine for Ruby on Rails
280
282
  test_files: []