ecm_pictures 0.0.20 → 0.0.21

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.
@@ -1,85 +1,86 @@
1
- include ActiveAdmin::ActsAsList::Helper
1
+ include ActiveAdmin::ActsAsList::Helper if defined?(::ActiveAdmin)
2
2
 
3
- if defined?(ActiveAdmin)
4
- ActiveAdmin.register Ecm::Pictures::PictureGallery do
5
- menu :parent => I18n.t('ecm.pictures.active_admin.menu')
6
-
7
- config.sort_order = 'position'
8
- sortable_member_actions
9
-
10
- form :html => { :enctype => "multipart/form-data" } do |f|
11
- f.inputs do
12
- f.input :name
13
- f.input :description
14
- f.input :link_images
15
- end
16
-
17
- f.inputs do
18
- f.has_many :pictures do |p|
19
- p.input :name
20
- #if !p.object.id.nil?
21
- if p.object.persisted?
22
- p.input :_destroy, :as => :boolean, :label => I18n.t('active_admin.delete')
23
- end
24
- p.input :image, :as => :file, :hint => p.template.image_tag(p.object.image.url(:thumb))
25
- p.input :description
3
+ ActiveAdmin.register Ecm::Pictures::PictureGallery do
4
+ menu :parent => I18n.t('ecm.pictures.active_admin.menu')
5
+
6
+ config.sort_order = 'position'
7
+ sortable_member_actions
8
+
9
+ form :html => { :enctype => "multipart/form-data" } do |f|
10
+ f.inputs do
11
+ f.input :name
12
+ f.input :description
13
+ f.input :link_images
14
+ end
15
+
16
+ f.inputs do
17
+ f.has_many :pictures do |p|
18
+ p.input :name
19
+ if p.object.persisted?
20
+ p.input :_destroy, :as => :boolean, :label => I18n.t('active_admin.delete')
26
21
  end
27
- end
28
-
29
- f.buttons
22
+ p.input :image, :as => :file, :hint => p.template.image_tag(p.object.image.url(:thumb))
23
+ p.input :description
30
24
  end
31
-
32
- index do
33
- sortable_columns
34
- column :name
35
- column :pictures_count
36
- column :link_images do |picture_gallery|
37
- I18n.t(picture_gallery.link_images)
25
+ end
26
+
27
+ f.buttons
28
+ end
29
+
30
+ index do
31
+ sortable_columns
32
+ column :name
33
+ column :pictures_count
34
+ column :link_images do |picture_gallery|
35
+ I18n.t(picture_gallery.link_images)
36
+ end
37
+ column :created_at
38
+ column :updated_at
39
+ default_actions
40
+ end
41
+
42
+ show do
43
+ panel Ecm::Pictures::PictureGallery.human_attribute_name(:description) do
44
+ div do
45
+ ecm_pictures_picture_gallery.description
38
46
  end
39
- column :created_at
40
- column :updated_at
41
- default_actions
42
47
  end
43
-
44
- show do
45
- attributes_table do
46
- row :name
47
- row :pictures_count
48
- row :link_images do |picture_gallery|
49
- I18n.t(picture_gallery.link_images)
50
- end
51
- row :created_at
52
- row :updated_at
48
+
49
+ panel Ecm::Pictures::PictureGallery.human_attribute_name(:display_code) do
50
+ div do
51
+ ecm_pictures_picture_gallery.display_code
53
52
  end
54
-
55
- panel Ecm::Pictures::PictureGallery.human_attribute_name(:description) do
56
- div do
57
- ecm_pictures_picture_gallery.description
53
+ end
54
+
55
+ panel Ecm::Pictures::PictureGallery.human_attribute_name(:pictures) do
56
+ table_for ecm_pictures_picture_gallery.pictures, :i18n => Ecm::Pictures::Picture do
57
+ sortable_columns
58
+ column :thumbnail do |picture|
59
+ link_to(image_tag(picture.image.url(:thumb)), admin_ecm_pictures_picture_path(picture))
58
60
  end
59
- end
60
-
61
- panel Ecm::Pictures::PictureGallery.human_attribute_name(:display_code) do
62
- div do
63
- ecm_pictures_picture_gallery.display_code
61
+ column :name
62
+ column :image_file_size, :sortable => :image_file_size do |picture|
63
+ number_to_human_size(picture.image_file_size)
64
64
  end
65
- end
66
-
67
- panel Ecm::Pictures::PictureGallery.human_attribute_name(:pictures) do
68
- table_for ecm_pictures_picture_gallery.pictures, :i18n => Ecm::Pictures::Picture do
69
- sortable_columns
70
- column :thumbnail do |picture|
71
- link_to(image_tag(picture.image.url(:thumb)), admin_ecm_pictures_picture_path(picture))
72
- end
73
- column :name
74
- column :image_file_size, :sortable => :image_file_size do |picture|
75
- number_to_human_size(picture.image_file_size)
76
- end
77
- column :created_at
78
- column do |picture|
79
- link_to I18n.t('active_admin.view'), admin_ecm_pictures_picture_path(picture), :class => "member_link view_link"
80
- end
65
+ column :created_at
66
+ column do |picture|
67
+ link_to(I18n.t('active_admin.view'), [:admin, picture], :class => "member_link view_link") +
68
+ link_to(I18n.t('active_admin.edit'), [:edit, :admin, picture], :class => "member_link edit_link")
81
69
  end
82
70
  end
83
71
  end
84
- end
85
- end
72
+ end # show
73
+
74
+ sidebar Ecm::Pictures::PictureGallery.human_attribute_name(:details), :only => :show do
75
+ attributes_table_for ecm_pictures_picture_gallery do
76
+ row :name
77
+ row :pictures_count
78
+ row :link_images do |picture_gallery|
79
+ I18n.t(picture_gallery.link_images)
80
+ end
81
+ row :created_at
82
+ row :updated_at
83
+ end
84
+ end # sidebar
85
+ end if defined?(::ActiveAdmin)
86
+
@@ -1,53 +1,61 @@
1
- include ActiveAdmin::ActsAsList::Helper
2
-
3
- if defined?(ActiveAdmin)
4
- ActiveAdmin.register Ecm::Pictures::Picture do
5
- menu :parent => I18n.t('ecm.pictures.active_admin.menu')
6
-
7
- # active_admin-acts_as_list
8
- config.sort_order = 'picture_gallery_id, position'
9
- sortable_member_actions
10
-
11
- form :html => { :enctype => "multipart/form-data" } do |f|
12
- f.inputs do
13
- f.input :picture_gallery
14
- f.input :name
15
- f.input :image, :as => :file, :hint => f.template.image_tag(f.object.image.url(:thumb))
16
- f.input :description
17
- end
18
-
19
- f.buttons
20
- end
21
-
22
- index do
23
- column :thumbnail do |picture|
24
- link_to(image_tag(picture.image.url(:thumb)), admin_ecm_pictures_picture_path(picture))
25
- end
26
- column :picture_gallery
27
- column :name
28
- column :image_file_size, :sortable => :image_file_size do |picture|
29
- number_to_human_size(picture.image_file_size)
1
+ include ActiveAdmin::ActsAsList::Helper if defined?(::ActiveAdmin)
2
+
3
+ ActiveAdmin.register Ecm::Pictures::Picture do
4
+ menu :parent => I18n.t('ecm.pictures.active_admin.menu')
5
+
6
+ # active_admin-acts_as_list
7
+ config.sort_order = 'picture_gallery_id, position'
8
+ sortable_member_actions
9
+
10
+ form :html => { :enctype => "multipart/form-data" } do |f|
11
+ f.inputs do
12
+ f.input :picture_gallery
13
+ f.input :name
14
+ f.input :image, :as => :file, :hint => f.template.image_tag(f.object.image.url(:thumb))
15
+ f.input :description
16
+ end
17
+
18
+ f.buttons
19
+ end
20
+
21
+ index do
22
+ selectable_column
23
+ column :thumbnail do |picture|
24
+ link_to(image_tag(picture.image.url(:thumb)), admin_ecm_pictures_picture_path(picture))
25
+ end
26
+ column :picture_gallery
27
+ column :name
28
+ column :image_file_size, :sortable => :image_file_size do |picture|
29
+ number_to_human_size(picture.image_file_size)
30
+ end
31
+ column :created_at
32
+ default_actions
33
+ end
34
+
35
+ show do
36
+ panel Ecm::Pictures::Picture.human_attribute_name(:image) do
37
+ div { image_tag ecm_pictures_picture.image.url }
38
+ end
39
+
40
+ panel Ecm::Pictures::Picture.human_attribute_name(:description) do
41
+ div do
42
+ ecm_pictures_picture.description
30
43
  end
31
- column :created_at
32
- default_actions
33
44
  end
34
-
35
- show do
36
- attributes_table do
37
- row :picture_gallery
38
- row :name
39
- row :image_file_name
40
- row :image_file_size do |picture|
41
- number_to_human_size(picture.image_file_size)
42
- end
43
- row :image_fingerprint
45
+ end
46
+
47
+ sidebar Ecm::Pictures::Picture.human_attribute_name(:details), :only => :show do
48
+ attributes_table_for ecm_pictures_picture do
49
+ row :picture_gallery
50
+ row :name
51
+ row :image_file_name
52
+ row :image_file_size do |picture|
53
+ number_to_human_size(picture.image_file_size)
44
54
  end
45
-
46
- panel Ecm::Pictures::Picture.human_attribute_name(:description) do
47
- div do
48
- ecm_pictures_picture.description
49
- end
50
- end
55
+ row :image_fingerprint
56
+ row :created_at
57
+ row :updated_at
51
58
  end
52
- end
53
- end
59
+ end # sidebar
60
+ end if defined?(::ActiveAdmin)
61
+
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Pictures
3
- VERSION = "0.0.20"
3
+ VERSION = "0.0.21"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_pictures
3
3
  version: !ruby/object:Gem::Version
4
- hash: 55
4
+ hash: 53
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 20
10
- version: 0.0.20
9
+ - 21
10
+ version: 0.0.21
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roberto Vasquez Angel