thecore_print_with_template 0.1.1 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/models/print_template.rb +13 -15
- data/config/initializers/abilities_thecore_print_with_template_concern.rb +15 -18
- data/lib/thecore_print_with_template.rb +1 -2
- data/lib/thecore_print_with_template/engine.rb +1 -1
- data/lib/thecore_print_with_template/version.rb +1 -1
- metadata +5 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 80b2c0ba815906ae32667dfc31b1bcbab19b1f5ca313bf8a88584ba4ae1c8799
|
4
|
+
data.tar.gz: 700b55270c544ab7b872e33755c1a0bbf6ac8a8ab57c589925497846c512348a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2231e2d09bc5204d88b1bc5db7e4e31a4f16dc58e1e40a0d9bbaee8343a3cd2e0e98f5858be0f669fcb1c1c5891f3907437f37855be3961f56d424527912afa5
|
7
|
+
data.tar.gz: 037bee3f664b5fe708470ce302ec8551155b8d338ded2586da3b6c37b11519de124524ddd9d82221d88f611b3de02de66084ea29c7331263425dbee10b8a47f1
|
@@ -28,24 +28,22 @@ class PrintTemplate < ApplicationRecord
|
|
28
28
|
# pivot
|
29
29
|
# end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
parent Printer
|
31
|
+
rails_admin do
|
32
|
+
navigation_label I18n.t("admin.settings.label")
|
33
|
+
navigation_icon 'fa fa-file-text'
|
34
|
+
parent Printer
|
36
35
|
|
37
|
-
|
38
|
-
|
36
|
+
field :name
|
37
|
+
field :description
|
39
38
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
edit do
|
40
|
+
field :template
|
41
|
+
field :translation_matrix
|
42
|
+
end
|
44
43
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
44
|
+
show do
|
45
|
+
field :template
|
46
|
+
field :translation_matrix
|
49
47
|
end
|
50
48
|
end
|
51
49
|
end
|
@@ -1,23 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
# a specific role, brings specific powers
|
16
|
-
end
|
1
|
+
module Abilities
|
2
|
+
class ThecorePrintWithTemplatesCommon
|
3
|
+
include CanCan::Ability
|
4
|
+
def initialize user
|
5
|
+
if user
|
6
|
+
# if the user is logged in, it can do certain tasks regardless his role
|
7
|
+
if user.admin?
|
8
|
+
# if the user is an admin, it can do a lot of things, usually
|
9
|
+
end
|
10
|
+
|
11
|
+
if user.has_role? :role
|
12
|
+
# a specific role, brings specific powers
|
13
|
+
end
|
14
|
+
end
|
17
15
|
end
|
18
16
|
end
|
19
|
-
end
|
20
17
|
end
|
21
18
|
|
22
19
|
# include the extension
|
23
|
-
TheCoreAbilities.send(:include, ThecorePrintWithTemplateAbilitiesConcern)
|
20
|
+
# TheCoreAbilities.send(:include, ThecorePrintWithTemplateAbilitiesConcern)
|
@@ -2,7 +2,7 @@ module ThecorePrintWithTemplate
|
|
2
2
|
class Engine < ::Rails::Engine
|
3
3
|
|
4
4
|
initializer 'thecore_print_with_template.add_to_migrations' do |app|
|
5
|
-
unless app.root.to_s
|
5
|
+
unless app.root.to_s.match root.to_s
|
6
6
|
# APPEND TO MAIN APP MIGRATIONS FROM THIS GEM
|
7
7
|
config.paths['db/migrate'].expanded.each do |expanded_path|
|
8
8
|
app.config.paths['db/migrate'] << expanded_path
|
metadata
CHANGED
@@ -1,43 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_print_with_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: thecore
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.4'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.4'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: thecore_print_commons
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0
|
19
|
+
version: '2.0'
|
34
20
|
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0
|
26
|
+
version: '2.0'
|
41
27
|
description: Thecorized thecore_print_with_template full description.
|
42
28
|
email:
|
43
29
|
- gabriele.tassoni@gmail.com
|
@@ -81,8 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: '0'
|
83
69
|
requirements: []
|
84
|
-
|
85
|
-
rubygems_version: 2.6.14
|
70
|
+
rubygems_version: 3.0.3
|
86
71
|
signing_key:
|
87
72
|
specification_version: 4
|
88
73
|
summary: Thecorized thecore_print_with_template
|