tybo 0.0.15 → 0.0.17

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: 7990c81a756b0316b1150ab17965be0a8be6d74936d72ea54726e4f6e4e2f03c
4
- data.tar.gz: 1fc4afcea2505ad972fb39d93a439aa160a0d1e7571291523a624cde13fad6d0
3
+ metadata.gz: 72f7e1aca69b08b783173fc24f6e56eaaf1fd35eb9476d9eb679ed580dcaf3e1
4
+ data.tar.gz: 10e6527c3ee590a649867460dfee235faba9bbbaa83b3c1456335be95e60def6
5
5
  SHA512:
6
- metadata.gz: fb95ff41dec41d72c231b135e044bd422db89e3736cffecef1c7eb3d7826835ef1fd64374b722d4ef8de3fef334962ddb2a304fc4979b060adf162695ea93bc9
7
- data.tar.gz: c83a7f207112c795db11ad9c68be50052e635aa87cae32aaef9e6da912bc7d8fe721d38c8d0bd4072bb5f62e5637de3266aed94655e97d55fb9150e4f0c87064
6
+ metadata.gz: 7f84debfec057a1acb7a81c7780bc639649e877d96e807700e46930c2ae6b7e302a8a3f23209ce2c51c5966ef8dda3c6eb59224924fd0c89f420da96d0176094
7
+ data.tar.gz: 120b781f5d6a5fbd195cd00968ca930cdc39e255a8b12f790d15111a03a4d27985a77c217d950bef2b0d1011ad8a768c83ff4de0175db038ab89c6373ed935a1
@@ -38,7 +38,7 @@
38
38
  </div>
39
39
 
40
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" %>
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
42
  </div>
43
43
  <% end %>
44
44
  </div>
@@ -70,7 +70,7 @@ class BoGenerator < Rails::Generators::NamedBase
70
70
  def permited_params
71
71
  params = {}
72
72
  action_text_columns = has_one_assoc&.select { |a| a.options[:class_name] == 'ActionText::RichText' }
73
- model_columns&.map do |col|
73
+ permitted_columns&.map do |col|
74
74
  params["#{col}".to_sym] = nil
75
75
  end
76
76
  action_text_columns&.map do |col|
@@ -100,7 +100,7 @@ class BoGenerator < Rails::Generators::NamedBase
100
100
  bo_model.reflect_on_all_associations(:has_one)
101
101
  end
102
102
 
103
- def permited_columns
103
+ def permitted_columns
104
104
  model_columns - excluded_columns
105
105
  end
106
106
 
@@ -68,7 +68,10 @@ module <%= options[:namespace].camelize %>
68
68
  private
69
69
 
70
70
  def set_<%= class_name.underscore %>
71
- @<%= class_name.underscore %> = <%= class_name %>.find(params[:id])
71
+ @<%= class_name.underscore %> = authorized_scope(
72
+ <%= class_name %>.all,
73
+ with: Bo::<%= options[:namespace].camelize %>::<%= class_name %>Policy
74
+ ).find(params[:id])
72
75
  end
73
76
 
74
77
  def <%= class_name.underscore %>_params
@@ -82,9 +85,5 @@ module <%= options[:namespace].camelize %>
82
85
  <%- end -%>
83
86
  )
84
87
  end
85
-
86
- def namespace
87
- @namespace ||= Bo::<%= options[:namespace].camelize %>
88
- end
89
88
  end
90
89
  end
@@ -2,11 +2,11 @@
2
2
  <%%
3
3
  current_page = if <%= class_name.underscore
4
4
  %>.persisted?
5
- { label: "Détails", path: <%= "#{options[:namespace]}_#{class_name.underscore}_path(#{class_name.underscore})"%> }
5
+ { label: I18n.t('bo.show'), path: <%= "#{options[:namespace]}_#{class_name.underscore}_path(#{class_name.underscore})"%> }
6
6
  else
7
- { label: "Nouvelle <%= class_name.underscore %>", path: <%= "new_#{options[:namespace]}_#{class_name.underscore}_path" %> }
7
+ { label: I18n.t('bo.<%= class_name.underscore %>.new').capitalize, path: <%= "new_#{options[:namespace]}_#{class_name.underscore}_path" %> }
8
8
  end
9
- form.with_title(<%= class_name.underscore %>.persisted? ? <%= class_name.underscore %>.<%=bo_model_title(bo_model)%> : 'Nouvelle <%= class_name.underscore %>')
9
+ form.with_title(<%= class_name.underscore %>.persisted? ? <%= class_name.underscore %>.<%=bo_model_title(bo_model)%> : I18n.t('bo.<%= class_name.underscore %>.new').capitalize)
10
10
  form.with_breadcrumb([
11
11
  { label: I18n.t('bo.<%= class_name.underscore %>.others').capitalize, path: <%= "#{options[:namespace]}_#{class_name.pluralize.underscore}_path"%> },
12
12
  current_page
@@ -5,4 +5,10 @@ class <%= class_name %>Controller < ApplicationController
5
5
  layout '<%= class_name.underscore %>'
6
6
  before_action :authenticate_<%= class_name.underscore %>!
7
7
  authorize :user, through: :current_<%= class_name.underscore %>
8
+
9
+ private
10
+
11
+ def namespace
12
+ @namespace ||= Bo::<%= class_name %>
13
+ end
8
14
  end
data/lib/tybo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tybo
2
- VERSION = '0.0.15'
2
+ VERSION = '0.0.17'
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.15
4
+ version: 0.0.17
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-02-15 00:00:00.000000000 Z
12
+ date: 2023-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails