enjoy_cms 0.3.1.2 → 0.3.2
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/Gemfile.lock +1 -1
- data/lib/enjoy/admin/gallery.rb +13 -10
- data/lib/enjoy/admin/news.rb +25 -16
- data/lib/enjoy/admin/page.rb +11 -6
- data/lib/enjoy/version.rb +1 -1
- data/lib/generators/enjoy/templates/ability.erb +3 -1
- data/template.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e33a4e7ad3766cc568450aa9727d67007767e578
|
|
4
|
+
data.tar.gz: 5b1163592a2342e6909390363095a0cd94766e8a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 716b95fed34f32026ebe624807e5fca67c89e94dbc58fe4cf46ee1f29cc93576f0cfb63879989216e240073502605df41f2095baeb06aee772747471bda3593a
|
|
7
|
+
data.tar.gz: 2c89eea1c204394f1bc0321e830bde1936bca3e274fae3c31145799d2deed2b7441641ab490e45fb89fa46a63c948930552ead100ebbee82a3b2bd41b5cb306a
|
data/Gemfile.lock
CHANGED
data/lib/enjoy/admin/gallery.rb
CHANGED
|
@@ -7,18 +7,21 @@ module Enjoy
|
|
|
7
7
|
field :enabled, :toggle
|
|
8
8
|
|
|
9
9
|
field :name, :string
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
group :URL do
|
|
11
|
+
active false
|
|
12
|
+
field :slugs, :enum do
|
|
13
|
+
enum_method do
|
|
14
|
+
:slugs
|
|
15
|
+
end
|
|
16
|
+
visible do
|
|
17
|
+
bindings[:view].current_user.admin?
|
|
18
|
+
end
|
|
19
|
+
multiple do
|
|
20
|
+
true
|
|
21
|
+
end
|
|
19
22
|
end
|
|
23
|
+
field :text_slug
|
|
20
24
|
end
|
|
21
|
-
field :text_slug
|
|
22
25
|
|
|
23
26
|
field :image, :jcrop do
|
|
24
27
|
jcrop_options :image_jcrop_options
|
data/lib/enjoy/admin/news.rb
CHANGED
|
@@ -18,30 +18,39 @@ module Enjoy
|
|
|
18
18
|
jcrop_options :image_jcrop_options
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
group :content do
|
|
22
|
+
active false
|
|
23
|
+
field :excerpt, :enjoy_html
|
|
24
|
+
# field :excerpt_html, :ck_editor
|
|
25
|
+
# field :excerpt_clear, :toggle
|
|
26
|
+
end
|
|
27
|
+
group :URL do
|
|
28
|
+
active false
|
|
29
|
+
field :slugs, :enum do
|
|
30
|
+
enum_method do
|
|
31
|
+
:slugs
|
|
32
|
+
end
|
|
33
|
+
visible do
|
|
34
|
+
bindings[:view].current_user.admin?
|
|
35
|
+
end
|
|
36
|
+
multiple do
|
|
37
|
+
true
|
|
38
|
+
end
|
|
33
39
|
end
|
|
40
|
+
field :text_slug
|
|
34
41
|
end
|
|
35
|
-
field :text_slug
|
|
36
42
|
|
|
37
43
|
list do
|
|
38
44
|
sort_by :time
|
|
39
45
|
end
|
|
40
46
|
|
|
41
47
|
edit do
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
group :text do
|
|
49
|
+
active false
|
|
50
|
+
field :content, :enjoy_html
|
|
51
|
+
# field :content_html, :ck_editor
|
|
52
|
+
# field :content_clear, :toggle
|
|
53
|
+
end
|
|
45
54
|
fields.each_pair do |name, type|
|
|
46
55
|
if type.nil?
|
|
47
56
|
field name
|
data/lib/enjoy/admin/page.rb
CHANGED
|
@@ -21,14 +21,19 @@ module Enjoy
|
|
|
21
21
|
|
|
22
22
|
edit do
|
|
23
23
|
field :name
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
|
|
25
|
+
group :content do
|
|
26
|
+
active false
|
|
27
|
+
field :excerpt, :enjoy_html
|
|
28
|
+
# field :excerpt_html, :ck_editor
|
|
29
|
+
# field :excerpt_clear, :toggle
|
|
30
|
+
field :content, :enjoy_html
|
|
31
|
+
# field :content_html, :ck_editor
|
|
32
|
+
# field :content_clear, :toggle
|
|
33
|
+
end
|
|
30
34
|
|
|
31
35
|
group :menu do
|
|
36
|
+
active false
|
|
32
37
|
label I18n.t('enjoy.menu')
|
|
33
38
|
field :menus
|
|
34
39
|
field :fullpath, :string do
|
data/lib/enjoy/version.rb
CHANGED
|
@@ -7,6 +7,8 @@ class Ability
|
|
|
7
7
|
can :access, :rails_admin # grant access to rails_admin
|
|
8
8
|
can :dashboard # grant access to the dashboard
|
|
9
9
|
|
|
10
|
+
can :comments, :all #RailsAdminComments
|
|
11
|
+
|
|
10
12
|
if user.admin?
|
|
11
13
|
admin_ui(user)
|
|
12
14
|
elsif user.manager?
|
|
@@ -40,7 +42,7 @@ class Ability
|
|
|
40
42
|
[
|
|
41
43
|
Enjoy::Page, Enjoy::News,
|
|
42
44
|
Enjoy::Seo, Enjoy::SitemapData,
|
|
43
|
-
RailsAdminSettings::
|
|
45
|
+
RailsAdminSettings::Setting
|
|
44
46
|
]
|
|
45
47
|
end
|
|
46
48
|
end
|
data/template.rb
CHANGED
|
@@ -406,7 +406,7 @@ inject_into_file 'app/models/user.rb', before: /^end/ do <<-TEXT
|
|
|
406
406
|
edit do
|
|
407
407
|
field :email, :string do
|
|
408
408
|
visible do
|
|
409
|
-
bindings[:controller].current_user.admin? or (bindings[:controller].current_user.manager? bindings[:controller].current_user == bindings[:object])
|
|
409
|
+
bindings[:controller].current_user.admin? or (bindings[:controller].current_user.manager? and bindings[:controller].current_user == bindings[:object])
|
|
410
410
|
end
|
|
411
411
|
end
|
|
412
412
|
field :name, :string
|