tybo 0.0.30 → 0.0.32

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: ba87b228afc0fbf8d86b0e7a131014e3b3ea48dc2371b1683370a84abfc325b0
4
- data.tar.gz: e74cb37337e05ec1cb5ab8b2c58b68aa481c351c639c5ef2bcb547e5308fafd8
3
+ metadata.gz: 820a3568bdf02ff7722f5d5b7e31a76dbc2da30de5ef47002f84a93e0a9d11f0
4
+ data.tar.gz: 3c0aacd3db2708b759960999d2c6f05edae6116cea7283e049a96a4cadcff048
5
5
  SHA512:
6
- metadata.gz: ebe56be83770dc24bc3a86df204b1706b8c877f35b9c75730400976381dc57d92e84d2c39080076099db1b06f3cc90c5cb6c896b7d243e7bed9d89b5f9d4b347
7
- data.tar.gz: 5deda09e96c218454755eb4b9bfa0b8cb151fdf32b4f54dcf39f1a961d2e7700d2564ee57ef20aa4e389f2eadcfc5e385aab61e2252b3fba37c810b83a91f592
6
+ metadata.gz: c48320ea3af74d67e8e059c3bda0ca72de0830f9ab370b662c9036d118b817a15a3c7f83950f23157a522ec8bcd8396cac9a54dd5b13d54d36437d9f61fab36b
7
+ data.tar.gz: 4428949fbe3ce2f526d10ca3f2601ff9d59bd74316a25666a557b29a6f63e0c02065c0ef323d3727a690681bfea398c5e30686927bbd95a322035a8d0c8d9794
@@ -0,0 +1,13 @@
1
+ <div class="flex flex-1 flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none lg:px-20 xl:px-24">
2
+ <div class="mx-auto w-full max-w-sm lg:w-96">
3
+ <%= render('layouts/flash') %>
4
+ <%= image_tag Tybo.configuration.logo_url, class: 'h-12 w-auto'%>
5
+ <h2 class="mt-6 text-3xl font-bold tracking-tight text-gray-900"><%= @title %></h2>
6
+ <div class="mt-8">
7
+ <div class="mt-6">
8
+ <%= content %>
9
+ </div>
10
+ </div>
11
+ </div>
12
+ </div>
13
+ <%= render(CoverComponent.new) %>
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ module Devise
3
+ class FormComponent < ViewComponent::Base
4
+ def initialize(title:)
5
+ @title = title
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ <div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 pt-5">
2
+ <label class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">
3
+ <%= @label %>
4
+ </label>
5
+ <div class="mt-1 sm:col-span-2 sm:mt-0">
6
+ <%= content %>
7
+ </div>
8
+ </div>
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ module Forms
3
+ class SearchInputComponent < ViewComponent::Base
4
+ def initialize(label:)
5
+ @label = label
6
+ end
7
+ end
8
+ end
@@ -1,34 +1,18 @@
1
- <div class="flex min-h-full">
2
- <div class="flex flex-1 flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none lg:px-20 xl:px-24">
3
- <div class="mx-auto w-full max-w-sm lg:w-96">
4
- <div>
5
- <%= render('layouts/flash') %>
6
- <%= image_tag Tybo.configuration.logo_url, class: 'h-12 w-auto'%>
7
- <h2 class="mt-6 text-3xl font-bold tracking-tight text-gray-900">Créer un nouveau mot de passe</h2>
8
- </div>
9
-
10
- <div class="mt-8">
11
- <div class="mt-6">
12
- <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
13
- <%= f.input :reset_password_token, as: :hidden %>
14
- <%= f.input :password,
15
- label: 'Mot de passe',
16
- required: true,
17
- autofocus: true,
18
- hint: ("#{@minimum_password_length} caractères minimum" if @minimum_password_length),
19
- class: 'block text-sm font-medium text-gray-700' %>
20
- <%= f.input :password_confirmation,
21
- label: 'Confirmez votre mot de passe',
22
- required: true,
23
- class: 'block text-sm font-medium text-gray-700' %>
24
- </div>
25
- <div class="mt-5">
26
- <%= f.button :submit, "Sauvegarder", class: "flex w-full justify-center rounded-md border border-transparent bg-tybo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-tybo-700 focus:outline-none focus:ring-2 focus:ring-tybo-500 focus:ring-offset-2", data: { turbo: false } %>
27
- </div>
28
- <% end %>
29
- </div>
30
- </div>
1
+ <%= render(Devise::FormComponent.new(title: I18n.t("bo.devise.password.new") )) do %>
2
+ <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
3
+ <%= f.input :reset_password_token, as: :hidden %>
4
+ <%= f.input :password,
5
+ label: 'Mot de passe',
6
+ required: true,
7
+ autofocus: true,
8
+ hint: ("#{@minimum_password_length} caractères minimum" if @minimum_password_length),
9
+ class: 'block text-sm font-medium text-gray-700' %>
10
+ <%= f.input :password_confirmation,
11
+ label: 'Confirmez votre mot de passe',
12
+ required: true,
13
+ class: 'block text-sm font-medium text-gray-700' %>
14
+ <div class="mt-5">
15
+ <%= f.button :submit, "Sauvegarder", class: "flex w-full justify-center rounded-md border border-transparent bg-tybo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-tybo-700 focus:outline-none focus:ring-2 focus:ring-tybo-500 focus:ring-offset-2", data: { turbo: false } %>
31
16
  </div>
32
- </div>
33
- <%= render(CoverComponent.new) %>
34
- </div>
17
+ <% end %>
18
+ <% end %>
@@ -1,32 +1,15 @@
1
- <div class="flex min-h-full">
2
- <div class="flex flex-1 flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none lg:px-20 xl:px-24">
3
- <div class="mx-auto w-full max-w-sm lg:w-96">
4
- <div>
5
- <%= render('layouts/flash') %>
6
- <%= image_tag Tybo.configuration.logo_url, class: 'h-12 w-auto'%>
7
- <h2 class="mt-6 text-3xl font-bold tracking-tight text-gray-900">Forgot your password?</h2>
8
- </div>
9
-
10
- <div class="mt-8">
11
- <div class="mt-6">
12
- <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
13
- <div>
14
- <%= f.input :email,
15
- required: false,
16
- autofocus: true,
17
- input_html: { autocomplete: "email" },
18
- class: 'block text-sm font-medium text-gray-700' %>
19
- </div>
1
+ <%= render(Devise::FormComponent.new(title: I18n.t("bo.devise.forgot_password") )) do %>
2
+ <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
3
+ <div>
4
+ <%= f.input :email,
5
+ required: false,
6
+ autofocus: true,
7
+ input_html: { autocomplete: "email" },
8
+ class: 'block text-sm font-medium text-gray-700' %>
9
+ </div>
20
10
 
21
- </div>
22
- <div class="mt-5">
23
- <%= f.button :submit, I18n.t("devise.passwords.new.send_me_reset_password_instructions"), class: "flex w-full justify-center rounded-md border border-transparent bg-tybo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-tybo-700 focus:outline-none focus:ring-2 focus:ring-tybo-500 focus:ring-offset-2", data: { turbo: false } %>
24
- </div>
25
- <% end %>
26
- </div>
27
- </div>
28
- <%= render "devise/shared/links" %>
11
+ <div class="mt-5">
12
+ <%= f.button :submit, I18n.t("devise.passwords.new.send_me_reset_password_instructions"), class: "flex w-full justify-center rounded-md border border-transparent bg-tybo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-tybo-700 focus:outline-none focus:ring-2 focus:ring-tybo-500 focus:ring-offset-2", data: { turbo: false } %>
29
13
  </div>
30
- </div>
31
- <%= render(CoverComponent.new) %>
32
- </div>
14
+ <% end %>
15
+ <% end %>
@@ -1,49 +1,35 @@
1
- <div class="flex min-h-full">
2
- <div class="flex flex-1 flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none lg:px-20 xl:px-24">
3
- <div class="mx-auto w-full max-w-sm lg:w-96">
4
- <%= render('layouts/flash') %>
5
- <%= image_tag Tybo.configuration.logo_url, class: 'h-12 w-auto'%>
6
- <h2 class="mt-6 text-3xl font-bold tracking-tight text-gray-900"><%=I18n.t("bo.devise.sign_in_as.#{resource_name}")%></h2>
7
- </div>
8
- <div class="mt-8">
9
- <div class="mt-6">
10
- <%= simple_form_for(resource, as: resource_name, url: session_path(resource_name), html: {class: 'space-y-6'}) do |f| %>
11
- <div>
12
- <%= f.input :email,
13
- required: false,
14
- autofocus: true,
15
- input_html: { autocomplete: "email" },
16
- class: 'block text-sm font-medium text-gray-700' %>
17
- </div>
18
-
19
- <div class="space-y-1">
20
- <%= f.input :password,
21
- required: false,
22
- input_html: { autocomplete: "current-password" },
23
- class: 'block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-tybo-500 focus:outline-none focus:ring-tybo-500 sm:text-sm' %>
24
- </div>
25
- </div>
1
+ <%= render(Devise::FormComponent.new(title: I18n.t("bo.devise.sign_in_as.#{resource_name}") )) do %>
2
+ <%= simple_form_for(resource, as: resource_name, url: session_path(resource_name), html: {class: 'space-y-6'}) do |f| %>
3
+ <div>
4
+ <%= f.input :email,
5
+ required: false,
6
+ autofocus: true,
7
+ input_html: { autocomplete: "email" },
8
+ class: 'block text-sm font-medium text-gray-700' %>
9
+ </div>
26
10
 
27
- <div class="flex items-center justify-between">
28
- <div class="flex items-center">
29
- <input id="remember_me" name="remember_me" type="checkbox" class="h-4 w-4 rounded border-gray-300 text-tybo-600 focus:ring-tybo-500">
30
- <label for="remember_me" class="ml-2 block text-sm text-gray-900"><%=I18n.t("activerecord.attributes.user.remember_me")%></label>
31
- </div>
11
+ <div class="space-y-1">
12
+ <%= f.input :password,
13
+ required: false,
14
+ input_html: { autocomplete: "current-password" },
15
+ class: 'block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-tybo-500 focus:outline-none focus:ring-tybo-500 sm:text-sm' %>
16
+ </div>
32
17
 
33
- <div class="text-sm">
34
- <a href="<%= new_password_path(resource)%>" class="font-medium text-tybo-600 hover:text-tybo-500", data-turbo='false' >
35
- <%=I18n.t("devise.passwords.new.forgot_your_password")%>
36
- </a>
37
- </div>
38
- </div>
18
+ <div class="flex items-center justify-between">
19
+ <div class="flex items-center">
20
+ <input id="remember_me" name="remember_me" type="checkbox" class="h-4 w-4 rounded border-gray-300 text-tybo-600 focus:ring-tybo-500">
21
+ <label for="remember_me" class="ml-2 block text-sm text-gray-900"><%=I18n.t("activerecord.attributes.user.remember_me")%></label>
22
+ </div>
39
23
 
40
- <div class="mt-5">
41
- <%= f.button :submit, I18n.t("devise.sessions.new.sign_in"), class: "flex w-full justify-center rounded-md border border-transparent bg-tybo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-tybo-700 focus:outline-none focus:ring-2 focus:ring-tybo-500 focus:ring-offset-2", data: { turbo: false } %>
42
- </div>
43
- <% end %>
44
- </div>
24
+ <div class="text-sm">
25
+ <a href="<%= new_password_path(resource)%>" class="font-medium text-tybo-600 hover:text-tybo-500", data-turbo='false' >
26
+ <%=I18n.t("devise.passwords.new.forgot_your_password")%>
27
+ </a>
45
28
  </div>
46
29
  </div>
47
- </div>
48
- <%= render(CoverComponent.new) %>
49
- </div>
30
+
31
+ <div class="mt-5">
32
+ <%= f.button :submit, I18n.t("devise.sessions.new.sign_in"), class: "flex w-full justify-center rounded-md border border-transparent bg-tybo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-tybo-700 focus:outline-none focus:ring-2 focus:ring-tybo-500 focus:ring-offset-2", data: { turbo: false } %>
33
+ </div>
34
+ <% end %>
35
+ <% end %>
@@ -14,23 +14,13 @@
14
14
  <%- type.second.sort_by(&:type).each do |col| -%>
15
15
  <%- next if bo_model.reflect_on_all_associations.map(&:foreign_key).include?(col.name) -%>
16
16
  <%- if col.type == :string || col.type == :text -%>
17
- <div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 pt-5">
18
- <label class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">
19
- <%%= I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>') %>
20
- </label>
21
- <div class="mt-1 sm:col-span-2 sm:mt-0">
22
- <%%= f.text_field :<%= col.name %>_cont, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:max-w-xs sm:text-sm" %>
23
- </div>
24
- </div>
17
+ <%%= render(Forms::SearchInputComponent.new(label: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'))) do %>
18
+ <%%= f.text_field :<%= col.name %>_cont, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:max-w-xs sm:text-sm" %>
19
+ <%% end %>
25
20
  <%- elsif col.type ==:integer -%>
26
- <div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 pt-5">
27
- <label class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">
28
- <%%= I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>') %>
29
- </label>
30
- <div class="mt-1 sm:col-span-2 sm:mt-0">
31
- <%%= f.number_field :<%= col.name %>_eq, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:max-w-xs sm:text-sm" %>
32
- </div>
33
- </div>
21
+ <%%= render(Forms::SearchInputComponent.new(label: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'))) do %>
22
+ <%%= f.number_field :<%= col.name %>_eq, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:max-w-xs sm:text-sm" %>
23
+ <%% end %>
34
24
  <%- elsif col.type == :boolean -%>
35
25
  <div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 pt-5">
36
26
  <label class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">
data/lib/tybo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tybo
2
- VERSION = '0.0.30'
2
+ VERSION = '0.0.32'
3
3
  end
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.0.30
4
+ version: 0.0.32
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-03-16 00:00:00.000000000 Z
12
+ date: 2023-03-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: '7.0'
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 7.0.4.1
23
+ version: 7.0.4.3
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  version: '7.0'
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 7.0.4.1
33
+ version: 7.0.4.3
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: puma
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -139,6 +139,8 @@ files:
139
139
  - app/components/cover_component.rb
140
140
  - app/components/current_user_mini_card_component.html.erb
141
141
  - app/components/current_user_mini_card_component.rb
142
+ - app/components/devise/form_component.html.erb
143
+ - app/components/devise/form_component.rb
142
144
  - app/components/form_component.html.erb
143
145
  - app/components/form_component.rb
144
146
  - app/components/forms/breadcrumb_component.html.erb
@@ -151,6 +153,8 @@ files:
151
153
  - app/components/forms/has_many_form_component.rb
152
154
  - app/components/forms/has_one_form_component.html.erb
153
155
  - app/components/forms/has_one_form_component.rb
156
+ - app/components/forms/search_input_component.html.erb
157
+ - app/components/forms/search_input_component.rb
154
158
  - app/components/forms/submit_button_component.html.erb
155
159
  - app/components/forms/submit_button_component.rb
156
160
  - app/components/forms/subtitle_component.html.erb