wco_models 3.1.0.146 → 3.1.0.148
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/app/controllers/wco/application_controller.rb +4 -0
- data/app/controllers/wco/galleries_controller.rb +0 -1
- data/app/controllers/wco/leads_controller.rb +6 -2
- data/app/controllers/wco/profiles_controller.rb +10 -0
- data/app/controllers/wco/tags_controller.rb +3 -2
- data/app/models/wco/profile.rb +7 -0
- data/app/models/wco/tag.rb +2 -1
- data/app/views/wco/_main_header.haml +1 -0
- data/app/views/wco/profiles/_form.haml +9 -0
- data/app/views/wco/profiles/_header.haml +6 -0
- data/app/views/wco/profiles/edit.haml +6 -0
- data/app/views/wco/profiles/index.haml +10 -0
- data/app/views/wco/tags/_form.haml +4 -0
- data/app/views/wco/tags/edit.haml +2 -0
- data/app/views/wco/tags/index.haml +6 -1
- data/app/views/wco/tags/new.haml +6 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d659451d072adbf696dd6a317cb383990bd0d8da8460b984c38f4adc7c867ff
|
4
|
+
data.tar.gz: 80b994dce92435205be381c9fb1b83f8fe889f9e7b455766cf133576a910de7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5d4f74a454d00bda9c508502dcde00fcea82ab1ff2b07bf34176780127402e1d0788eec5fa4c9ec0df897d0fb6929edc15f8c0fda7c5cbfec33397efea190fb
|
7
|
+
data.tar.gz: dd976a05848a79c8fdd07820ccec5a0244892309d79cf3b1c6911f42f859d29fe76d7366168600ae1b145919335db004d60c278c17a63ec2df2252737d71e19a
|
@@ -17,6 +17,7 @@ class Wco::ApplicationController < ActionController::Base
|
|
17
17
|
check_authorization
|
18
18
|
|
19
19
|
before_action :current_profile
|
20
|
+
before_action :set_lists
|
20
21
|
|
21
22
|
def home
|
22
23
|
authorize! :home, Wco
|
@@ -80,4 +81,7 @@ class Wco::ApplicationController < ActionController::Base
|
|
80
81
|
["1", "t", "T", "true"].include?( which )
|
81
82
|
end
|
82
83
|
|
84
|
+
def set_lists
|
85
|
+
end
|
86
|
+
|
83
87
|
end
|
@@ -26,10 +26,14 @@ class Wco::LeadsController < Wco::ApplicationController
|
|
26
26
|
authorize! :index, Wco::Lead
|
27
27
|
@leads = Wco::Lead.all
|
28
28
|
|
29
|
+
|
30
|
+
|
29
31
|
if params[:q].present?
|
32
|
+
q = params[:q].downcase
|
30
33
|
@leads = @leads.any_of(
|
31
|
-
{ email: /#{
|
32
|
-
{ name: /#{
|
34
|
+
{ email: /#{q}/i },
|
35
|
+
{ name: /#{q}/i },
|
36
|
+
);
|
33
37
|
|
34
38
|
if 1 == @leads.length
|
35
39
|
redirect_to controller: 'wco/leads', action: 'show', id: @leads[0].id
|
@@ -1,6 +1,16 @@
|
|
1
1
|
|
2
2
|
class Wco::ProfilesController < Wco::ApplicationController
|
3
3
|
|
4
|
+
def edit
|
5
|
+
@profile = Wco::Profile.find params[:id]
|
6
|
+
authorize! :update, @profile
|
7
|
+
end
|
8
|
+
|
9
|
+
def index
|
10
|
+
@profiles = Wco::Profile.all
|
11
|
+
authorize! :index, Wco::Profile
|
12
|
+
end
|
13
|
+
|
4
14
|
def update
|
5
15
|
@profile = Wco::Profile.find params[:id]
|
6
16
|
authorize! :update, @profile
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
class Wco::TagsController < Wco::ApplicationController
|
3
3
|
|
4
|
-
before_action :set_lists
|
4
|
+
before_action :set_lists
|
5
5
|
|
6
6
|
def create
|
7
7
|
@tag = Wco::Tag.new params[:tag].permit!
|
@@ -37,7 +37,6 @@ class Wco::TagsController < Wco::ApplicationController
|
|
37
37
|
|
38
38
|
def new
|
39
39
|
authorize! :new, Wco::Tag
|
40
|
-
@new_tag = Wco::Tag.new
|
41
40
|
end
|
42
41
|
|
43
42
|
def add_to
|
@@ -91,7 +90,9 @@ class Wco::TagsController < Wco::ApplicationController
|
|
91
90
|
private
|
92
91
|
|
93
92
|
def set_lists
|
93
|
+
@new_tag = Wco::Tag.new
|
94
94
|
@tags = Wco::Tag.all.order_by( slug: :asc )
|
95
|
+
@tags_list = Wco::Tag.list
|
95
96
|
end
|
96
97
|
|
97
98
|
|
data/app/models/wco/profile.rb
CHANGED
@@ -16,6 +16,13 @@ class Wco::Profile
|
|
16
16
|
has_many :newsitems, class_name: 'Wco::Newsitem'
|
17
17
|
has_and_belongs_to_many :shared_galleries, class_name: 'Wco::Gallery', inverse_of: :shared_profiles
|
18
18
|
|
19
|
+
ROLE_ADMIN = 'admin'
|
20
|
+
ROLE_GUY = 'guy'
|
21
|
+
ROLES = [ ROLE_ADMIN, ROLE_GUY ]
|
22
|
+
field :role, type: :string, default: ROLE_GUY
|
23
|
+
def self.roles_list
|
24
|
+
[nil] + ROLES
|
25
|
+
end
|
19
26
|
|
20
27
|
def to_s
|
21
28
|
email
|
data/app/models/wco/tag.rb
CHANGED
@@ -9,7 +9,8 @@ class Wco::Tag
|
|
9
9
|
validates :slug, presence: true, uniqueness: true
|
10
10
|
index({ slug: -1 })
|
11
11
|
|
12
|
-
|
12
|
+
belongs_to :parent, class_name: 'Wco::Tag', inverse_of: :sons
|
13
|
+
has_many :sons, class_name: 'Wco::Tag', inverse_of: :parent
|
13
14
|
|
14
15
|
has_many :email_filters, class_name: 'WcoEmail::EmailFilter', inverse_of: :tag
|
15
16
|
|
data/app/views/wco/tags/new.haml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wco_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.0.
|
4
|
+
version: 3.1.0.148
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pudeyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|
@@ -574,7 +574,11 @@ files:
|
|
574
574
|
- app/views/wco/products/new.haml
|
575
575
|
- app/views/wco/products/show.haml
|
576
576
|
- app/views/wco/products/show.jbuilder
|
577
|
+
- app/views/wco/profiles/_form.haml
|
577
578
|
- app/views/wco/profiles/_form_extra.haml
|
579
|
+
- app/views/wco/profiles/_header.haml
|
580
|
+
- app/views/wco/profiles/edit.haml
|
581
|
+
- app/views/wco/profiles/index.haml
|
578
582
|
- app/views/wco/publishers/_form.haml
|
579
583
|
- app/views/wco/publishers/_header.haml
|
580
584
|
- app/views/wco/publishers/edit.haml
|