ecm_pictures 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2012 YOURNAME
1
+ Copyright 2012 Roberto Vasquez Angel
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -1,4 +1,4 @@
1
- = EcmPictureGallery
1
+ = Ecm::Pictures
2
2
 
3
3
  = Purpose
4
4
 
@@ -1,26 +1,41 @@
1
1
  class Ecm::Pictures::Picture < ActiveRecord::Base
2
2
  self.table_name = 'ecm_pictures_pictures'
3
-
3
+
4
4
  # associations
5
5
  belongs_to :picture_gallery, :counter_cache => true
6
-
6
+
7
+ # attributes
8
+ attr_accessible :description,
9
+ :image,
10
+ :name,
11
+ :picture_gallery_id
12
+
7
13
  # acts as list
8
14
  acts_as_list :scope => :picture_gallery
9
15
 
16
+ # callbacks
17
+ before_validation :set_name_from_image_file_name, :if => Proc.new { |p| p.name.nil? }
18
+
10
19
  # default scope
11
20
  default_scope :order => "picture_gallery_id, position"
12
-
21
+
13
22
  # friendly id
14
23
  extend FriendlyId
15
24
  friendly_id :name, :use => :slugged
16
-
25
+
17
26
  # paperclip
18
- has_attached_file :image, :styles => { :medium => "300x300>", :thumb => "100x100>" }
19
-
20
- # attributes
21
- attr_accessible :description, :image, :name, :picture_gallery_id
22
-
27
+ has_attached_file :image,
28
+ :styles => { :medium => "300x300>", :thumb => "100x100>" }
29
+
23
30
  # validations
24
31
  # validates :image, :attachment_presence => true
25
32
  validates_attachment_presence :image
33
+ validates :name, :presence => true
34
+
35
+ private
36
+
37
+ def set_name_from_image_file_name
38
+ self.name = File.basename(image_file_name, File.extname(image_file_name)) unless image_file_name.nil?
39
+ end
26
40
  end
41
+
@@ -1,34 +1,41 @@
1
1
  class Ecm::Pictures::PictureGallery < ActiveRecord::Base
2
2
  self.table_name = 'ecm_pictures_picture_galleries'
3
-
3
+
4
4
  # associations
5
5
  has_many :pictures, :dependent => :destroy
6
6
  accepts_nested_attributes_for :pictures, :allow_destroy => true
7
-
7
+
8
+ # attributes
9
+ attr_accessible :description,
10
+ :link_images,
11
+ :name,
12
+ :pictures_attributes
13
+
8
14
  # acts as list
9
15
  acts_as_list
10
16
  default_scope :order => 'position ASC'
11
-
12
- # defaults
17
+
18
+ # callbacks
13
19
  after_initialize :set_defaults
14
-
20
+
15
21
  # friendly id
16
22
  extend FriendlyId
17
23
  friendly_id :name, :use => :slugged
18
-
19
- # attributes
20
- attr_accessible :description, :link_images, :name , :pictures_attributes
21
-
24
+
22
25
  # validations
23
- validates :name, :presence => true
24
-
26
+ validates :name, :presence => true,
27
+ :uniqueness => true
28
+
25
29
  def display_code
26
30
  "<%= render_picture_gallery '#{self.name}' %>"
27
31
  end
28
-
32
+
33
+ private
34
+
29
35
  def set_defaults
30
36
  if new_record?
31
37
  self.link_images = true if self.link_images.nil?
32
38
  end
33
- end
39
+ end
34
40
  end
41
+
@@ -1,18 +1,20 @@
1
1
  de:
2
2
  activerecord:
3
+ models:
4
+ ecm/pictures/picture:
5
+ one: Bild
6
+ other: Bilder
3
7
  attributes:
4
8
  ecm/pictures/picture:
5
- created_at: "Erstellt am"
6
- description: "Beschreibung"
7
- image: "Datei"
8
- image_file_size: "Größe"
9
- image_fingerprint: "Fingerabdruck"
10
- name: "Name"
11
- picture_gallery: "Gallerie"
12
- position: "Position"
13
- thumbnail: "Vorschau"
14
- updated_at: "Aktualisiert am"
15
- models:
16
- ecm/pictures/picture:
17
- one: "Bild"
18
- other: "Bilder"
9
+ created_at: Erstellt am
10
+ description: Beschreibung
11
+ image: Datei
12
+ image_file: Datei
13
+ image_file_name: Dateiname
14
+ image_file_size: Größe
15
+ image_fingerprint: Fingerabdruck
16
+ name: Name
17
+ picture_gallery: Gallerie
18
+ position: Position
19
+ thumbnail: Vorschau
20
+ updated_at: Aktualisiert am
@@ -1,17 +1,17 @@
1
1
  de:
2
2
  activerecord:
3
+ models:
4
+ ecm/pictures/picture_gallery:
5
+ one: Bildgallerie
6
+ other: Bildgallerien
3
7
  attributes:
4
8
  ecm/pictures/picture_gallery:
5
- created_at: "Erstellt am"
6
- description: "Beschreibung"
7
- display_code: "Anzeigecode"
8
- link_images: "Bilder verlinken"
9
- name: "Name"
10
- pictures: "Bilder"
11
- pictures_count: "Bilder"
12
- position: "Position"
13
- updated_at: "Aktualisiert am"
14
- models:
15
- ecm/pictures/picture_gallery:
16
- one: "Bildgallerie"
17
- other: "Bildgallerien"
9
+ created_at: Erstellt am
10
+ description: Beschreibung
11
+ display_code: Anzeigecode
12
+ link_images: Bilder verlinken
13
+ name: Name
14
+ pictures: Bilder
15
+ pictures_count: Bilder
16
+ position: Position
17
+ updated_at: Aktualisiert am
@@ -1,20 +1,8 @@
1
- require 'rubygems'
2
-
3
- require 'acts_as_list'
4
- require 'active_admin-acts_as_list'
5
- require 'friendly_id'
6
- require 'paperclip'
7
-
8
- # Ecm::Admin should do this!
9
- require 'activeadmin'
10
- require 'sass-rails'
11
- require 'meta_search'
12
-
13
1
  module Ecm
14
2
  module Pictures
15
3
  class Engine < Rails::Engine
16
4
  paths["config/locales"] << File.dirname(__FILE__) + '/../../../config/locales'
17
-
5
+
18
6
  # Enabling assets precompiling under rails 3.1 or greater
19
7
  if Rails.version >= '3.1'
20
8
  initializer "ecm_pictures.asset_pipeline" do |app|
@@ -22,16 +10,17 @@ module Ecm
22
10
  app.config.assets.precompile << 'ecm_pictures.css'
23
11
  end
24
12
  end
25
-
13
+
26
14
  config.to_prepare do
27
15
  ApplicationController.helper(Ecm::PicturesHelper)
28
- end
29
-
16
+ end
17
+
30
18
  initializer :ecm_pictures_engine do
31
19
  ActiveAdmin.setup do |active_admin_config|
32
- active_admin_config.load_paths += Dir[File.dirname(__FILE__) + '/../../../app/admin']
20
+ active_admin_config.load_paths += Dir[File.dirname(__FILE__) + '/active_admin']
33
21
  end
34
- end
22
+ end
35
23
  end
36
- end
24
+ end
37
25
  end
26
+
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Pictures
3
- VERSION = "0.0.15"
3
+ VERSION = "0.0.16"
4
4
  end
5
5
  end
data/lib/ecm_pictures.rb CHANGED
@@ -1,2 +1,14 @@
1
+ require 'rubygems'
2
+
3
+ require 'acts_as_list'
4
+ require 'active_admin-acts_as_list'
5
+ require 'friendly_id'
6
+ require 'paperclip'
7
+
8
+ # Ecm::Admin should do this!
9
+ require 'activeadmin'
10
+ require 'sass-rails'
11
+ require 'meta_search'
12
+
1
13
  require 'ecm/pictures/engine'
2
14
  require 'ecm/pictures/version'
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_pictures
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 63
4
5
  prerelease:
5
- version: 0.0.15
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 16
10
+ version: 0.0.16
6
11
  platform: ruby
7
12
  authors:
8
13
  - Roberto Vasquez Angel
@@ -10,7 +15,7 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2012-06-23 00:00:00 Z
18
+ date: 2012-09-20 00:00:00 Z
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: rails
@@ -20,51 +25,75 @@ dependencies:
20
25
  requirements:
21
26
  - - ~>
22
27
  - !ruby/object:Gem::Version
28
+ hash: 5
29
+ segments:
30
+ - 3
31
+ - 2
32
+ - 5
23
33
  version: 3.2.5
24
34
  type: :runtime
25
35
  version_requirements: *id001
26
36
  - !ruby/object:Gem::Dependency
27
- name: paperclip
37
+ name: acts_as_list
28
38
  prerelease: false
29
39
  requirement: &id002 !ruby/object:Gem::Requirement
30
40
  none: false
31
41
  requirements:
32
42
  - - ~>
33
43
  - !ruby/object:Gem::Version
34
- version: "2.7"
44
+ hash: 23
45
+ segments:
46
+ - 0
47
+ - 1
48
+ - 6
49
+ version: 0.1.6
35
50
  type: :runtime
36
51
  version_requirements: *id002
37
52
  - !ruby/object:Gem::Dependency
38
- name: friendly_id
53
+ name: active_admin-acts_as_list
39
54
  prerelease: false
40
55
  requirement: &id003 !ruby/object:Gem::Requirement
41
56
  none: false
42
57
  requirements:
43
58
  - - ~>
44
59
  - !ruby/object:Gem::Version
45
- version: 4.0.1
60
+ hash: 21
61
+ segments:
62
+ - 0
63
+ - 0
64
+ - 5
65
+ version: 0.0.5
46
66
  type: :runtime
47
67
  version_requirements: *id003
48
68
  - !ruby/object:Gem::Dependency
49
- name: acts_as_list
69
+ name: friendly_id
50
70
  prerelease: false
51
71
  requirement: &id004 !ruby/object:Gem::Requirement
52
72
  none: false
53
73
  requirements:
54
74
  - - ~>
55
75
  - !ruby/object:Gem::Version
56
- version: 0.1.6
76
+ hash: 61
77
+ segments:
78
+ - 4
79
+ - 0
80
+ - 1
81
+ version: 4.0.1
57
82
  type: :runtime
58
83
  version_requirements: *id004
59
84
  - !ruby/object:Gem::Dependency
60
- name: active_admin-acts_as_list
85
+ name: paperclip
61
86
  prerelease: false
62
87
  requirement: &id005 !ruby/object:Gem::Requirement
63
88
  none: false
64
89
  requirements:
65
90
  - - ~>
66
91
  - !ruby/object:Gem::Version
67
- version: 0.0.5
92
+ hash: 13
93
+ segments:
94
+ - 2
95
+ - 7
96
+ version: "2.7"
68
97
  type: :runtime
69
98
  version_requirements: *id005
70
99
  - !ruby/object:Gem::Dependency
@@ -75,108 +104,214 @@ dependencies:
75
104
  requirements:
76
105
  - - ">="
77
106
  - !ruby/object:Gem::Version
107
+ hash: 3
108
+ segments:
109
+ - 0
78
110
  version: "0"
79
111
  type: :development
80
112
  version_requirements: *id006
81
113
  - !ruby/object:Gem::Dependency
82
- name: rspec-rails
114
+ name: thin
83
115
  prerelease: false
84
116
  requirement: &id007 !ruby/object:Gem::Requirement
85
117
  none: false
86
118
  requirements:
87
119
  - - ">="
88
120
  - !ruby/object:Gem::Version
121
+ hash: 3
122
+ segments:
123
+ - 0
89
124
  version: "0"
90
125
  type: :development
91
126
  version_requirements: *id007
92
127
  - !ruby/object:Gem::Dependency
93
- name: capybara
128
+ name: yard
94
129
  prerelease: false
95
130
  requirement: &id008 !ruby/object:Gem::Requirement
96
131
  none: false
97
132
  requirements:
98
133
  - - ">="
99
134
  - !ruby/object:Gem::Version
135
+ hash: 3
136
+ segments:
137
+ - 0
100
138
  version: "0"
101
139
  type: :development
102
140
  version_requirements: *id008
103
141
  - !ruby/object:Gem::Dependency
104
- name: guard-rspec
142
+ name: activeadmin
105
143
  prerelease: false
106
144
  requirement: &id009 !ruby/object:Gem::Requirement
107
145
  none: false
108
146
  requirements:
109
147
  - - ">="
110
148
  - !ruby/object:Gem::Version
149
+ hash: 3
150
+ segments:
151
+ - 0
111
152
  version: "0"
112
153
  type: :development
113
154
  version_requirements: *id009
114
155
  - !ruby/object:Gem::Dependency
115
- name: guard-spork
156
+ name: sass-rails
116
157
  prerelease: false
117
158
  requirement: &id010 !ruby/object:Gem::Requirement
118
159
  none: false
119
160
  requirements:
120
161
  - - ">="
121
162
  - !ruby/object:Gem::Version
163
+ hash: 3
164
+ segments:
165
+ - 0
122
166
  version: "0"
123
167
  type: :development
124
168
  version_requirements: *id010
125
169
  - !ruby/object:Gem::Dependency
126
- name: factory_girl_rails
170
+ name: coffee-rails
127
171
  prerelease: false
128
172
  requirement: &id011 !ruby/object:Gem::Requirement
129
173
  none: false
130
174
  requirements:
131
175
  - - ">="
132
176
  - !ruby/object:Gem::Version
177
+ hash: 3
178
+ segments:
179
+ - 0
133
180
  version: "0"
134
181
  type: :development
135
182
  version_requirements: *id011
136
183
  - !ruby/object:Gem::Dependency
137
- name: thin
184
+ name: capybara
138
185
  prerelease: false
139
186
  requirement: &id012 !ruby/object:Gem::Requirement
140
187
  none: false
141
188
  requirements:
142
189
  - - ">="
143
190
  - !ruby/object:Gem::Version
191
+ hash: 3
192
+ segments:
193
+ - 0
144
194
  version: "0"
145
195
  type: :development
146
196
  version_requirements: *id012
147
197
  - !ruby/object:Gem::Dependency
148
- name: activeadmin
198
+ name: rspec-rails
149
199
  prerelease: false
150
200
  requirement: &id013 !ruby/object:Gem::Requirement
151
201
  none: false
152
202
  requirements:
153
- - - ">="
203
+ - - ~>
154
204
  - !ruby/object:Gem::Version
155
- version: "0"
205
+ hash: 3
206
+ segments:
207
+ - 2
208
+ - 0
209
+ version: "2.0"
156
210
  type: :development
157
211
  version_requirements: *id013
158
212
  - !ruby/object:Gem::Dependency
159
- name: sass-rails
213
+ name: shoulda-matchers
160
214
  prerelease: false
161
215
  requirement: &id014 !ruby/object:Gem::Requirement
162
216
  none: false
163
217
  requirements:
164
218
  - - ">="
165
219
  - !ruby/object:Gem::Version
220
+ hash: 3
221
+ segments:
222
+ - 0
166
223
  version: "0"
167
224
  type: :development
168
225
  version_requirements: *id014
169
226
  - !ruby/object:Gem::Dependency
170
- name: meta_search
227
+ name: factory_girl_rails
171
228
  prerelease: false
172
229
  requirement: &id015 !ruby/object:Gem::Requirement
173
230
  none: false
174
231
  requirements:
175
- - - ">="
232
+ - - ~>
176
233
  - !ruby/object:Gem::Version
177
- version: 1.1.0.pre
234
+ hash: 15
235
+ segments:
236
+ - 1
237
+ - 0
238
+ version: "1.0"
178
239
  type: :development
179
240
  version_requirements: *id015
241
+ - !ruby/object:Gem::Dependency
242
+ name: ffaker
243
+ prerelease: false
244
+ requirement: &id016 !ruby/object:Gem::Requirement
245
+ none: false
246
+ requirements:
247
+ - - ">="
248
+ - !ruby/object:Gem::Version
249
+ hash: 3
250
+ segments:
251
+ - 0
252
+ version: "0"
253
+ type: :development
254
+ version_requirements: *id016
255
+ - !ruby/object:Gem::Dependency
256
+ name: forgery
257
+ prerelease: false
258
+ requirement: &id017 !ruby/object:Gem::Requirement
259
+ none: false
260
+ requirements:
261
+ - - "="
262
+ - !ruby/object:Gem::Version
263
+ hash: 11
264
+ segments:
265
+ - 0
266
+ - 5
267
+ - 0
268
+ version: 0.5.0
269
+ type: :development
270
+ version_requirements: *id017
271
+ - !ruby/object:Gem::Dependency
272
+ name: rb-inotify
273
+ prerelease: false
274
+ requirement: &id018 !ruby/object:Gem::Requirement
275
+ none: false
276
+ requirements:
277
+ - - ~>
278
+ - !ruby/object:Gem::Version
279
+ hash: 47
280
+ segments:
281
+ - 0
282
+ - 8
283
+ - 8
284
+ version: 0.8.8
285
+ type: :development
286
+ version_requirements: *id018
287
+ - !ruby/object:Gem::Dependency
288
+ name: guard-rspec
289
+ prerelease: false
290
+ requirement: &id019 !ruby/object:Gem::Requirement
291
+ none: false
292
+ requirements:
293
+ - - ">="
294
+ - !ruby/object:Gem::Version
295
+ hash: 3
296
+ segments:
297
+ - 0
298
+ version: "0"
299
+ type: :development
300
+ version_requirements: *id019
301
+ - !ruby/object:Gem::Dependency
302
+ name: guard-bundler
303
+ prerelease: false
304
+ requirement: &id020 !ruby/object:Gem::Requirement
305
+ none: false
306
+ requirements:
307
+ - - ">="
308
+ - !ruby/object:Gem::Version
309
+ hash: 3
310
+ segments:
311
+ - 0
312
+ version: "0"
313
+ type: :development
314
+ version_requirements: *id020
180
315
  description: Provides picture galleries for active admin.
181
316
  email:
182
317
  - roberto@vasquez-angel.de
@@ -190,8 +325,6 @@ files:
190
325
  - app/helpers/ecm/pictures_helper.rb
191
326
  - app/models/ecm/pictures/picture_gallery.rb
192
327
  - app/models/ecm/pictures/picture.rb
193
- - app/admin/ecm/pictures/pictures.rb
194
- - app/admin/ecm/pictures/picture_galleries.rb
195
328
  - app/assets/images/orangebox/buttons.png
196
329
  - app/assets/images/orangebox/loading.gif
197
330
  - app/assets/stylesheets/ecm_pictures.css.scss
@@ -206,6 +339,8 @@ files:
206
339
  - db/migrate/001_create_ecm_pictures_picture_galleries.rb
207
340
  - lib/tasks/ecm_pictures_tasks.rake
208
341
  - lib/ecm_pictures.rb
342
+ - lib/ecm/pictures/active_admin/ecm_pictures_picture_galleries.rb
343
+ - lib/ecm/pictures/active_admin/ecm_pictures_pictures.rb
209
344
  - lib/ecm/pictures/engine.rb
210
345
  - lib/ecm/pictures/version.rb
211
346
  - MIT-LICENSE
@@ -224,12 +359,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
224
359
  requirements:
225
360
  - - ">="
226
361
  - !ruby/object:Gem::Version
362
+ hash: 3
363
+ segments:
364
+ - 0
227
365
  version: "0"
228
366
  required_rubygems_version: !ruby/object:Gem::Requirement
229
367
  none: false
230
368
  requirements:
231
369
  - - ">="
232
370
  - !ruby/object:Gem::Version
371
+ hash: 3
372
+ segments:
373
+ - 0
233
374
  version: "0"
234
375
  requirements: []
235
376
 
@@ -240,3 +381,4 @@ specification_version: 3
240
381
  summary: Picture galleries for active admin.
241
382
  test_files: []
242
383
 
384
+ has_rdoc: