tybo 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -1
- data/app/components/sidebar_component.html.erb +1 -1
- data/app/controllers/tybo/application_controller.rb +2 -0
- data/app/controllers/tybo/login_controller.rb +1 -0
- data/lib/generators/bo/bo_generator.rb +2 -2
- data/lib/generators/bo/templates/_form.html.erb +1 -1
- data/lib/generators/bo/templates/namespace_policy.rb +6 -6
- data/lib/generators/bo_namespace/bo_namespace_generator.rb +2 -0
- data/lib/generators/bo_namespace/templates/policy.rb +2 -0
- data/lib/generators/tybo_install/templates/tybo_config.rb +5 -2
- data/lib/generators/tybo_install/tybo_install_generator.rb +1 -0
- data/lib/tybo/configuration.rb +1 -1
- data/lib/tybo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7990c81a756b0316b1150ab17965be0a8be6d74936d72ea54726e4f6e4e2f03c
|
4
|
+
data.tar.gz: 1fc4afcea2505ad972fb39d93a439aa160a0d1e7571291523a624cde13fad6d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb95ff41dec41d72c231b135e044bd422db89e3736cffecef1c7eb3d7826835ef1fd64374b722d4ef8de3fef334962ddb2a304fc4979b060adf162695ea93bc9
|
7
|
+
data.tar.gz: c83a7f207112c795db11ad9c68be50052e635aa87cae32aaef9e6da912bc7d8fe721d38c8d0bd4072bb5f62e5637de3266aed94655e97d55fb9150e4f0c87064
|
data/README.md
CHANGED
@@ -48,7 +48,12 @@ add your policy logic in ApplicationController eg:
|
|
48
48
|
|
49
49
|
## Customize
|
50
50
|
|
51
|
-
**Update images**: change
|
51
|
+
**Update images**: change image url in `config/initializer/tybo.rb`
|
52
|
+
```
|
53
|
+
config.logo_url = 'your_logo.png'
|
54
|
+
config.nav_logo_url = 'your_nav_logo.png'
|
55
|
+
config.cover_url = 'your_cover.png'
|
56
|
+
```
|
52
57
|
|
53
58
|
**Customize colors**: Change the `tybo` colors class in `tailwind.config.js`,
|
54
59
|
you can use https://uicolors.app/create to generate complete palette
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="flex-1 flex flex-col min-h-0 bg-tybo">
|
3
3
|
<div class="flex-1 flex flex-col pt-5 pb-4 overflow-y-auto">
|
4
4
|
<div class="flex items-center flex-shrink-0 px-4">
|
5
|
-
<%= image_tag(Tybo.configuration.
|
5
|
+
<%= image_tag(Tybo.configuration.nav_logo_url, alt: "logo", class: 'mx-auto h-15 w-auto') %>
|
6
6
|
</div>
|
7
7
|
|
8
8
|
<nav class="mt-5 flex-1 px-2 space-y-1" aria-label="Sidebar">
|
@@ -69,7 +69,7 @@ class BoGenerator < Rails::Generators::NamedBase
|
|
69
69
|
|
70
70
|
def permited_params
|
71
71
|
params = {}
|
72
|
-
action_text_columns= has_one_assoc&.select {|a| a.options[:class_name] == 'ActionText::RichText'}
|
72
|
+
action_text_columns = has_one_assoc&.select { |a| a.options[:class_name] == 'ActionText::RichText' }
|
73
73
|
model_columns&.map do |col|
|
74
74
|
params["#{col}".to_sym] = nil
|
75
75
|
end
|
@@ -82,7 +82,7 @@ class BoGenerator < Rails::Generators::NamedBase
|
|
82
82
|
has_one_assoc&.map do |association|
|
83
83
|
next if association.options[:class_name] == 'ActionText::RichText'
|
84
84
|
|
85
|
-
attributes = association.klass.column_names.map(&:to_sym).delete_if {|attr| excluded_columns.include?(attr)}
|
85
|
+
attributes = association.klass.column_names.map(&:to_sym).delete_if { |attr| excluded_columns.include?(attr) }
|
86
86
|
params["#{association.name.to_s.singularize}_attributes".to_sym] = attributes
|
87
87
|
end
|
88
88
|
params
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<!-- Model columns -->
|
3
3
|
<%- bo_model.column_names.each do |column| -%>
|
4
4
|
<%- next if excluded_columns.include?(column.to_sym) || bo_model.reflect_on_all_associations.map(&:foreign_key).include?(column) -%>
|
5
|
-
<%%= f.input :<%= column
|
5
|
+
<%%= f.input :<%= column %>,label: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= column %>') %>
|
6
6
|
<%- end -%>
|
7
7
|
<!-- belongs_to Associations -->
|
8
8
|
<%- belongs_to_assoc.each do |association| -%>
|
@@ -1,27 +1,27 @@
|
|
1
1
|
module Bo
|
2
2
|
class <%= options[:namespace].camelize %>Policy < ActionPolicy::Base
|
3
3
|
def show?
|
4
|
-
|
4
|
+
raise "Add custom policy scope in #{__FILE__}"
|
5
5
|
end
|
6
6
|
|
7
7
|
def new?
|
8
|
-
|
8
|
+
raise "Add custom policy scope in #{__FILE__}"
|
9
9
|
end
|
10
10
|
|
11
11
|
def edit?
|
12
|
-
|
12
|
+
raise "Add custom policy scope in #{__FILE__}"
|
13
13
|
end
|
14
14
|
|
15
15
|
def create?
|
16
|
-
|
16
|
+
raise "Add custom policy scope in #{__FILE__}"
|
17
17
|
end
|
18
18
|
|
19
19
|
def update?
|
20
|
-
|
20
|
+
raise "Add custom policy scope in #{__FILE__}"
|
21
21
|
end
|
22
22
|
|
23
23
|
def destroy?
|
24
|
-
|
24
|
+
raise "Add custom policy scope in #{__FILE__}"
|
25
25
|
end
|
26
26
|
|
27
27
|
relation_scope(&:all)
|
@@ -1,6 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Tybo.configure do |config|
|
2
4
|
# customise logo and cover url
|
3
5
|
# should be an external url or image should be present in (app/assets/images)
|
4
|
-
# config.logo_url =
|
5
|
-
# config.
|
6
|
+
# config.logo_url = 'logo.png'
|
7
|
+
# config.nav_logo_url = 'nav_logo.png'
|
8
|
+
# config.cover_url = 'cover.png'
|
6
9
|
end
|
data/lib/tybo/configuration.rb
CHANGED
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.0.
|
4
|
+
version: 0.0.15
|
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-
|
12
|
+
date: 2023-02-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|