tybo 0.0.29 → 0.0.31

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: 893f297e8e1856c21f1e1d15b3a698723a2210f7ceff54d40e704a539752ee29
4
- data.tar.gz: 969d1819fb9fc76e19ab67fe41be57a270ad34219b090c4f06262c76a1a2c277
3
+ metadata.gz: 6ac439377b1ab67c01d268ccf0f990c2a14346ec8ff76d6bdc5edd0aab15f60c
4
+ data.tar.gz: f64462c5493126d3eec82f0b3644d1ffa7462d29fdc30ef56098df2622976749
5
5
  SHA512:
6
- metadata.gz: ea19fe2f0f0ea1aaa2724c4aa7d1768e98e0c3365e6913e8ed57c301f9870156dd383da0adb30444d03c8a6b525a6354c7e36a36ab574617218b497d6a5490b8
7
- data.tar.gz: 59eeb4e00b5da3ebe6e3f4d86cfda0d8aba29c1c043fd2434454a9a416b7da2db0501e6d59b0620799f252074debf4ed7fd2210b7fb5b9c94763ba92523cf3ea
6
+ metadata.gz: 8dbddf0cf8650483c3d19e1dcd0259545b8fc3e265455c440ad5f02be4649db7a74e6e51df6007e40c0376aed1ed01aa2d2cbdd834c84d7b88931538a3f578f8
7
+ data.tar.gz: fae3b6eaf3afd0e1fd56fa55f83c905f7e18ea458ade1892ba8f351426fc2d2de61bb6267ca1d847e0ac905ed114a14aa5108ec1883177e36f2a368b4708b3bf
@@ -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
@@ -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 %>
@@ -20,7 +20,7 @@ class BoGenerator < Rails::Generators::NamedBase
20
20
  template 'show.html.erb', File.join("app/views/#{options[:namespace]}", "#{plural_name}/show.html.erb")
21
21
  template 'controller.rb', File.join("app/controllers/#{options[:namespace]}", "#{plural_name}_controller.rb")
22
22
  template 'policy.rb', File.join("app/policies/bo/#{options[:namespace]}", "#{file_name.underscore}_policy.rb")
23
- unless File.exists?("app/policies/bo/#{options[:namespace]}.rb")
23
+ unless File.exists?("app/policies/bo/#{options[:namespace]}_policy.rb")
24
24
  template 'namespace_policy.rb', "app/policies/bo/#{options[:namespace]}_policy.rb"
25
25
  end
26
26
  create_translations
@@ -64,7 +64,7 @@ class BoGenerator < Rails::Generators::NamedBase
64
64
  end
65
65
 
66
66
  def excluded_columns
67
- %i[id created_at updated_at]
67
+ %i[id created_at updated_at encrypted_password]
68
68
  end
69
69
 
70
70
  def permited_params
@@ -19,7 +19,7 @@
19
19
  <%%= tr.with_td do %>
20
20
  <%%= link_to <%="#{options[:namespace]}_#{class_name.underscore}_path(#{class_name.underscore})"%>,
21
21
  class: "text-tybo-600 hover:text-tybo-900",
22
- data: {turbo_method: :delete, turbo_confirm: "êtes vous sur ?"} do %>
22
+ data: {turbo_method: :delete, turbo_confirm: "êtes-vous sûr ?"} do %>
23
23
  <%%= render(Icons::TrashComponent.new) %>
24
24
  <%% end %>
25
25
  <%% end %>
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bo
2
4
  class <%= options[:namespace].camelize %>Policy < ActionPolicy::Base
3
5
  def show?
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bo
2
4
  module <%= options[:namespace].camelize %>
3
5
  class <%= class_name %>Policy < Bo::<%= options[:namespace].camelize %>Policy
data/lib/tybo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tybo
2
- VERSION = '0.0.29'
2
+ VERSION = '0.0.31'
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.29
4
+ version: 0.0.31
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-15 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
@@ -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