tb_photos 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/{README.markdown → README.md} +0 -0
- data/Rakefile +1 -1
- data/app/assets/javascripts/admin/photos/photos.js +14 -16
- data/app/controllers/admin/photo_albums_controller.rb +11 -15
- data/app/controllers/admin/photo_galleries_controller.rb +15 -17
- data/app/controllers/admin/photos_controller.rb +23 -28
- data/app/controllers/photo_albums_controller.rb +12 -18
- data/app/controllers/photo_galleries_controller.rb +0 -2
- data/app/helpers/admin/photos_helper.rb +2 -4
- data/app/models/spud_photo.rb +21 -23
- data/app/models/spud_photo_album.rb +15 -19
- data/app/models/spud_photo_albums_photo.rb +1 -1
- data/app/models/spud_photo_galleries_album.rb +1 -1
- data/app/models/spud_photo_gallery.rb +10 -16
- data/app/views/admin/photo_albums/_album.html.erb +1 -1
- data/app/views/admin/photo_galleries/index.html.erb +1 -1
- data/app/views/admin/photos/show.js.erb +3 -3
- data/app/views/layouts/admin/spud_photos.html.erb +3 -3
- data/config/routes.rb +5 -7
- data/db/migrate/20120228232120_create_spud_photos.rb +2 -2
- data/db/migrate/20120228232329_create_spud_photo_albums.rb +4 -4
- data/db/migrate/20120228232344_create_spud_photo_galleries.rb +4 -4
- data/db/migrate/20120405042046_upgrade_photo_relationships.rb +4 -4
- data/db/migrate/20121127210314_rename_order_to_sort_order.rb +1 -1
- data/db/migrate/20140730201754_add_fingerprint_to_spud_photos.rb +1 -1
- data/lib/generators/spud/photos/views_generator.rb +1 -2
- data/lib/spud_photos/configuration.rb +8 -8
- data/lib/spud_photos/engine.rb +15 -20
- data/lib/spud_photos/version.rb +3 -3
- data/lib/tb_photos.rb +3 -3
- data/spec/dummy/config.ru +1 -1
- data/spec/dummy/config/application.rb +2 -3
- data/spec/dummy/config/boot.rb +1 -1
- data/spec/dummy/config/environments/test.rb +2 -2
- data/spec/dummy/config/routes.rb +1 -2
- data/spec/dummy/script/rails +2 -2
- data/spec/spec_helper.rb +6 -6
- metadata +43 -33
- data/app/views/admin/photo_albums/destroy.js.erb +0 -1
- data/app/views/admin/photo_galleries/destroy.js.erb +0 -1
- data/app/views/admin/photos/destroy.js.erb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6312c612b6dea2c5a897ea003594296012b7068b4e988c60e01222f1677884c7
|
4
|
+
data.tar.gz: acefd2270d72b9f3973367277b05f065cea62aec278ad4f54a09755234957938
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2494ec2f3d04bf6fd51c28fca5e396bac7f0a40b85c023b02464406cb05be5119dda330f40bd3d4aa31a953d8d012ef2aa45396f66eecad8e6305b321499b0f
|
7
|
+
data.tar.gz: 3a0852322e35fc2cd01ca74dc0d6882d4e57cdfed47a1bee26e66f96f59b0abf9bd41db090a2b815628256e074ab9486a951d78e2ac46d92c92d484b6cfc311b
|
File without changes
|
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
20
20
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
21
|
end
|
22
22
|
|
23
|
-
APP_RAKEFILE = File.expand_path(
|
23
|
+
APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__)
|
24
24
|
load 'rails/tasks/engine.rake'
|
25
25
|
|
26
26
|
Bundler::GemHelper.install_tasks
|
@@ -2,12 +2,10 @@
|
|
2
2
|
|
3
3
|
var html5upload = false;
|
4
4
|
|
5
|
-
var self =
|
5
|
+
var self = tb.photos = {
|
6
6
|
init: function(){
|
7
7
|
// event handlers
|
8
|
-
|
9
|
-
connectWith:'.admin-photo-ui-thumbs-sortable'
|
10
|
-
});
|
8
|
+
Sortable.create(document.querySelector('#admin-photos-selected'));
|
11
9
|
$('body').on('submit', '#admin-photo-album-form', submittedPhotoAlbumForm);
|
12
10
|
$('body').on('submit', '#admin-photo-gallery-form', submittedPhotoGalleryForm);
|
13
11
|
$('body').on('submit', '#admin-photo-form', submittedPhotoForm);
|
@@ -84,7 +82,7 @@ var self = spud.admin.photos = {
|
|
84
82
|
var target = $('#admin-photos-selected, #admin-photos');
|
85
83
|
target.prepend(html);
|
86
84
|
}
|
87
|
-
|
85
|
+
tb.modal.hide();
|
88
86
|
}
|
89
87
|
};
|
90
88
|
|
@@ -117,14 +115,14 @@ var validatePhoto = function(file) {
|
|
117
115
|
if(allowedTypes.indexOf(file.type) < 0) {
|
118
116
|
errors.push("Unsupported file format");
|
119
117
|
}
|
120
|
-
var maxAllowedSize =
|
118
|
+
var maxAllowedSize = tb.photos.max_image_upload_size_bytes;
|
121
119
|
if(maxAllowedSize && file.size > maxAllowedSize) {
|
122
|
-
errors.push("Your file size of " + self.getFileSizeHumanized(file.size) + " exceeded the maximum limit of " +
|
120
|
+
errors.push("Your file size of " + self.getFileSizeHumanized(file.size) + " exceeded the maximum limit of " + tb.photos.max_image_upload_size_humanized);
|
123
121
|
}
|
124
122
|
}
|
125
123
|
else{
|
126
124
|
if($('.admin-photo-form-current-photo').length === 0){
|
127
|
-
errors.push("No file found");
|
125
|
+
errors.push("No file found");
|
128
126
|
}
|
129
127
|
}
|
130
128
|
return errors;
|
@@ -186,11 +184,11 @@ var submittedPhotoForm = function(e){
|
|
186
184
|
if(photoValidationErrors.length) {
|
187
185
|
return generateFileUploadErrors(photoValidationErrors);
|
188
186
|
}
|
189
|
-
|
187
|
+
|
190
188
|
if(file){
|
191
189
|
progressBar = progressBarForUpload(file.name);
|
192
190
|
fd.append('spud_photo[photo]', file);
|
193
|
-
form.append(progressBar);
|
191
|
+
form.append(progressBar);
|
194
192
|
}
|
195
193
|
else{
|
196
194
|
progressBar = progressBarForUpload('');
|
@@ -250,7 +248,7 @@ var onPhotoUploadComplete = function(e, progressBar){
|
|
250
248
|
var target = $('#admin-photos-selected, #admin-photos');
|
251
249
|
target.prepend(photo.html).fadeIn(200);
|
252
250
|
}
|
253
|
-
|
251
|
+
tb.modal.hide();
|
254
252
|
}
|
255
253
|
// validation error
|
256
254
|
else{
|
@@ -282,11 +280,11 @@ var clickedPhotoAddOrEdit = function(e){
|
|
282
280
|
};
|
283
281
|
|
284
282
|
var photoUploadFormLoaded = function(html){
|
285
|
-
|
283
|
+
tb.modal.displayWithOptions({
|
286
284
|
title: 'Upload Photo',
|
287
285
|
html: html
|
288
286
|
});
|
289
|
-
$(".admin-photo-form-max-size").text('Maximum upload size: '+
|
287
|
+
$(".admin-photo-form-max-size").text('Maximum upload size: '+ tb.photos.max_image_upload_size_humanized);
|
290
288
|
};
|
291
289
|
|
292
290
|
/*
|
@@ -311,7 +309,7 @@ var photoLibraryLoaded = function(html){
|
|
311
309
|
dupe.remove();
|
312
310
|
}
|
313
311
|
});
|
314
|
-
|
312
|
+
tb.modal.displayWithOptions({
|
315
313
|
title: 'My Photo Library',
|
316
314
|
html: html,
|
317
315
|
buttons:{
|
@@ -327,7 +325,7 @@ var addSelectedPhotosFromLibrary = function(e){
|
|
327
325
|
.prependTo('#admin-photos-selected')
|
328
326
|
.hide()
|
329
327
|
.fadeIn(200);
|
330
|
-
|
328
|
+
tb.modal.hide();
|
331
329
|
};
|
332
330
|
|
333
331
|
var deleteSelectedPhotosFromLibrary = function(e){
|
@@ -343,7 +341,7 @@ var deleteSelectedPhotosFromLibrary = function(e){
|
|
343
341
|
$(this).remove();
|
344
342
|
});
|
345
343
|
for(var i=0; i<ids.length; i++){
|
346
|
-
|
344
|
+
tb.photos.markPhotoAsDeleted(ids[i]);
|
347
345
|
}
|
348
346
|
},
|
349
347
|
error: function(jqXHR, textStatus, errorThrown){
|
@@ -1,6 +1,5 @@
|
|
1
1
|
class Admin::PhotoAlbumsController < Admin::ApplicationController
|
2
|
-
|
3
|
-
before_filter :get_album, :only => [:show, :edit, :update, :destroy, :library]
|
2
|
+
before_action :album, only: [:show, :edit, :update, :destroy, :library]
|
4
3
|
add_breadcrumb 'Photo Albums', :admin_photo_albums_path
|
5
4
|
layout 'admin/spud_photos'
|
6
5
|
belongs_to_spud_app :photo_albums
|
@@ -21,10 +20,8 @@ class Admin::PhotoAlbumsController < Admin::ApplicationController
|
|
21
20
|
|
22
21
|
def create
|
23
22
|
@photo_album = SpudPhotoAlbum.new(photo_album_params)
|
24
|
-
if @photo_album.save
|
25
|
-
|
26
|
-
end
|
27
|
-
respond_with @photo_album, :location => admin_photo_albums_path
|
23
|
+
write_photo_order if @photo_album.save
|
24
|
+
respond_with @photo_album, location: admin_photo_albums_path
|
28
25
|
end
|
29
26
|
|
30
27
|
def edit
|
@@ -34,24 +31,24 @@ class Admin::PhotoAlbumsController < Admin::ApplicationController
|
|
34
31
|
def update
|
35
32
|
@photo_album.update_attributes(photo_album_params)
|
36
33
|
if @photo_album.save
|
37
|
-
|
38
|
-
flash[:notice] = 'Album updated successfully'
|
34
|
+
write_photo_order
|
35
|
+
flash[:notice] = 'Album updated successfully'
|
39
36
|
end
|
40
|
-
respond_with @photo_album, :
|
37
|
+
respond_with @photo_album, location: admin_photo_albums_path
|
41
38
|
end
|
42
39
|
|
43
40
|
def destroy
|
44
41
|
flash.now[:notice] = 'Album deleted successfully' if @photo_album.destroy
|
45
|
-
respond_with @photo_album, :
|
42
|
+
respond_with @photo_album, location: admin_photo_albums_path
|
46
43
|
end
|
47
44
|
|
48
|
-
def
|
45
|
+
def album
|
49
46
|
@photo_album = SpudPhotoAlbum.find(params[:id])
|
50
47
|
end
|
51
48
|
|
52
|
-
private
|
49
|
+
private
|
53
50
|
|
54
|
-
def
|
51
|
+
def write_photo_order
|
55
52
|
order_ids = params[:spud_photo_album][:photo_ids] || []
|
56
53
|
@photo_album.spud_photo_albums_photos.each do |obj|
|
57
54
|
index = order_ids.index(obj.spud_photo_id.to_s)
|
@@ -60,7 +57,6 @@ private
|
|
60
57
|
end
|
61
58
|
|
62
59
|
def photo_album_params
|
63
|
-
params.require(:spud_photo_album).permit(:title, :url_name, :
|
60
|
+
params.require(:spud_photo_album).permit(:title, :url_name, photo_ids: [])
|
64
61
|
end
|
65
|
-
|
66
62
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
class Admin::PhotoGalleriesController < Admin::ApplicationController
|
2
|
-
|
3
|
-
|
4
|
-
before_filter :get_albums, :only => [:new, :create, :edit, :update]
|
2
|
+
before_action :gallery, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :albums, only: [:new, :create, :edit, :update]
|
5
4
|
add_breadcrumb 'Photo Galleries', :admin_photo_galleries_path
|
6
5
|
layout 'admin/spud_photos'
|
7
6
|
belongs_to_spud_app :photo_galleries
|
@@ -10,49 +9,48 @@ class Admin::PhotoGalleriesController < Admin::ApplicationController
|
|
10
9
|
@photo_galleries = SpudPhotoGallery.all
|
11
10
|
respond_with @photo_galleries
|
12
11
|
end
|
13
|
-
|
12
|
+
|
14
13
|
def show
|
15
14
|
respond_with @photo_gallery
|
16
15
|
end
|
17
|
-
|
16
|
+
|
18
17
|
def new
|
19
18
|
@photo_gallery = SpudPhotoGallery.new
|
20
19
|
respond_with @photo_gallery
|
21
20
|
end
|
22
|
-
|
21
|
+
|
23
22
|
def create
|
24
23
|
@photo_gallery = SpudPhotoGallery.new(photo_gallery_params)
|
25
24
|
flash[:notice] = 'Gallery created successfully' if @photo_gallery.save
|
26
|
-
respond_with @photo_gallery, :
|
25
|
+
respond_with @photo_gallery, location: admin_photo_galleries_path
|
27
26
|
end
|
28
|
-
|
27
|
+
|
29
28
|
def edit
|
30
29
|
respond_with @photo_gallery
|
31
30
|
end
|
32
|
-
|
31
|
+
|
33
32
|
def update
|
34
33
|
@photo_gallery.update_attributes(photo_gallery_params)
|
35
34
|
flash[:notice] = 'Gallery updated successfully' if @photo_gallery.save
|
36
|
-
respond_with @photo_gallery, :
|
35
|
+
respond_with @photo_gallery, location: admin_photo_galleries_path
|
37
36
|
end
|
38
|
-
|
37
|
+
|
39
38
|
def destroy
|
40
39
|
flash.now[:notice] = 'Gallery deleted successfully' if @photo_gallery.destroy
|
41
|
-
respond_with @photo_gallery, :
|
40
|
+
respond_with @photo_gallery, location: admin_photo_galleries_path
|
42
41
|
end
|
43
42
|
|
44
|
-
private
|
43
|
+
private
|
45
44
|
|
46
|
-
def
|
45
|
+
def gallery
|
47
46
|
@photo_gallery = SpudPhotoGallery.find(params[:id])
|
48
47
|
end
|
49
48
|
|
50
|
-
def
|
49
|
+
def albums
|
51
50
|
@photo_albums = SpudPhotoAlbum.all
|
52
51
|
end
|
53
52
|
|
54
53
|
def photo_gallery_params
|
55
|
-
params.require(:spud_photo_gallery).permit(:title, :url_name, :
|
54
|
+
params.require(:spud_photo_gallery).permit(:title, :url_name, album_ids: [])
|
56
55
|
end
|
57
|
-
|
58
56
|
end
|
@@ -1,9 +1,7 @@
|
|
1
1
|
class Admin::PhotosController < Admin::ApplicationController
|
2
|
-
|
3
|
-
include RespondsToParent
|
4
2
|
belongs_to_spud_app :photo_albums
|
5
3
|
|
6
|
-
|
4
|
+
before_action :photo, only: [:show, :edit, :update, :destroy]
|
7
5
|
layout false
|
8
6
|
|
9
7
|
def index
|
@@ -18,7 +16,7 @@ class Admin::PhotosController < Admin::ApplicationController
|
|
18
16
|
def new
|
19
17
|
@photo = SpudPhoto.new
|
20
18
|
respond_with @photo do |format|
|
21
|
-
format.js { render 'new', :
|
19
|
+
format.js { render 'new', layout: false }
|
22
20
|
end
|
23
21
|
end
|
24
22
|
|
@@ -27,16 +25,14 @@ class Admin::PhotosController < Admin::ApplicationController
|
|
27
25
|
if photo_file.present?
|
28
26
|
fingerprint = Digest::MD5.hexdigest(photo_file.read)
|
29
27
|
photo_file.rewind
|
30
|
-
@photo = SpudPhoto.where(:
|
31
|
-
end
|
32
|
-
|
33
|
-
if @photo.blank?
|
34
|
-
@photo = SpudPhoto.new(photo_params)
|
28
|
+
@photo = SpudPhoto.where(photo_fingerprint: fingerprint).first
|
35
29
|
end
|
36
30
|
|
31
|
+
@photo = SpudPhoto.new(photo_params) if @photo.blank?
|
32
|
+
|
37
33
|
if @photo.save
|
38
34
|
success = true
|
39
|
-
flash[:notice] = 'SpudPhoto created successfully'
|
35
|
+
flash[:notice] = 'SpudPhoto created successfully'
|
40
36
|
end
|
41
37
|
if request.xhr?
|
42
38
|
render json_for_photo(success)
|
@@ -49,15 +45,15 @@ class Admin::PhotosController < Admin::ApplicationController
|
|
49
45
|
|
50
46
|
def edit
|
51
47
|
respond_with @photo do |format|
|
52
|
-
format.js { render 'edit', :
|
48
|
+
format.js { render 'edit', layout: false }
|
53
49
|
end
|
54
50
|
end
|
55
|
-
|
51
|
+
|
56
52
|
def update
|
57
53
|
@photo.update_attributes(photo_params)
|
58
54
|
if @photo.save
|
59
55
|
success = true
|
60
|
-
flash[:notice] = 'SpudPhoto updated successfully'
|
56
|
+
flash[:notice] = 'SpudPhoto updated successfully'
|
61
57
|
end
|
62
58
|
if request.xhr?
|
63
59
|
render json_for_photo(success)
|
@@ -70,37 +66,36 @@ class Admin::PhotosController < Admin::ApplicationController
|
|
70
66
|
|
71
67
|
def destroy
|
72
68
|
flash[:notice] = 'SpudPhoto deleted successfully' if @photo.destroy
|
73
|
-
respond_with @photo, :
|
69
|
+
respond_with @photo, location: admin_photos_path
|
74
70
|
end
|
75
71
|
|
76
72
|
def mass_destroy
|
77
|
-
@photos = SpudPhoto.where(:
|
73
|
+
@photos = SpudPhoto.where(id: params[:spud_photo_ids])
|
78
74
|
flash[:notice] = 'Photos deleted successfully' if @photos.destroy_all
|
79
|
-
respond_with @photos, :
|
75
|
+
respond_with @photos, location: admin_photos_path
|
80
76
|
end
|
81
77
|
|
82
|
-
private
|
78
|
+
private
|
83
79
|
|
84
|
-
def
|
80
|
+
def photo
|
85
81
|
@photo = SpudPhoto.find(params[:id])
|
86
82
|
end
|
87
|
-
|
83
|
+
|
88
84
|
def json_for_photo(success)
|
89
85
|
if success
|
90
|
-
|
91
|
-
:
|
92
|
-
:
|
93
|
-
}}
|
86
|
+
{ status: 200, json: {
|
87
|
+
id: @photo.id,
|
88
|
+
html: render_to_string(partial: 'photo', locals: { photo: @photo }, layout: nil)
|
89
|
+
} }
|
94
90
|
else
|
95
|
-
|
96
|
-
:
|
97
|
-
:
|
98
|
-
}}
|
91
|
+
{ status: 422, json: {
|
92
|
+
id: 0,
|
93
|
+
html: render_to_string(partial: 'form', layout: nil)
|
94
|
+
} }
|
99
95
|
end
|
100
96
|
end
|
101
97
|
|
102
98
|
def photo_params
|
103
99
|
params.require(:spud_photo).permit(:title, :caption, :photo)
|
104
100
|
end
|
105
|
-
|
106
101
|
end
|
@@ -1,37 +1,31 @@
|
|
1
1
|
class PhotoAlbumsController < ApplicationController
|
2
|
-
|
3
2
|
respond_to :html, :json, :xml
|
4
3
|
layout Spud::Photos.base_layout
|
5
4
|
|
6
|
-
if Spud::Photos.galleries_enabled
|
7
|
-
before_filter :get_gallery
|
8
|
-
end
|
5
|
+
before_action :gallery if Spud::Photos.galleries_enabled
|
9
6
|
|
10
7
|
def index
|
11
|
-
if @photo_gallery
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
8
|
+
@photo_albums = if @photo_gallery
|
9
|
+
@photo_gallery.albums.ordered
|
10
|
+
else
|
11
|
+
SpudPhotoAlbum.ordered
|
12
|
+
end
|
16
13
|
respond_with @photo_albums
|
17
14
|
end
|
18
15
|
|
19
16
|
def show
|
20
|
-
@photo_album = SpudPhotoAlbum.find_by(:
|
17
|
+
@photo_album = SpudPhotoAlbum.find_by(url_name: params[:id])
|
21
18
|
if @photo_album.blank?
|
22
|
-
raise Spud::NotFoundError
|
19
|
+
raise Spud::NotFoundError, item: 'photo album'
|
23
20
|
else
|
24
21
|
respond_with @photo_album
|
25
22
|
end
|
26
23
|
end
|
27
24
|
|
28
|
-
private
|
25
|
+
private
|
29
26
|
|
30
|
-
def
|
31
|
-
@photo_gallery = SpudPhotoGallery.find_by(:
|
32
|
-
if @photo_gallery.blank?
|
33
|
-
raise Spud::NotFoundError.new(:item => 'photo gallery')
|
34
|
-
end
|
27
|
+
def gallery
|
28
|
+
@photo_gallery = SpudPhotoGallery.find_by(url_name: params[:photo_gallery_id])
|
29
|
+
raise Spud::NotFoundError, item: 'photo gallery' if @photo_gallery.blank?
|
35
30
|
end
|
36
|
-
|
37
31
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
class PhotoGalleriesController < ApplicationController
|
2
|
-
|
3
2
|
respond_to :html, :json, :xml
|
4
3
|
layout Spud::Photos.base_layout
|
5
4
|
|
@@ -7,5 +6,4 @@ class PhotoGalleriesController < ApplicationController
|
|
7
6
|
@photo_galleries = SpudPhotoGallery.ordered
|
8
7
|
respond_with @photo_galleries
|
9
8
|
end
|
10
|
-
|
11
9
|
end
|
data/app/models/spud_photo.rb
CHANGED
@@ -1,36 +1,34 @@
|
|
1
1
|
class SpudPhoto < ActiveRecord::Base
|
2
|
-
|
3
2
|
extend ActionView::Helpers::NumberHelper
|
4
3
|
|
5
|
-
has_many :spud_photo_albums_photos, :
|
4
|
+
has_many :spud_photo_albums_photos, dependent: :destroy
|
6
5
|
has_many :albums,
|
7
|
-
|
8
|
-
|
6
|
+
through: :spud_photo_albums_photos,
|
7
|
+
source: :spud_photo_album
|
9
8
|
|
10
|
-
has_attached_file :photo,
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
has_attached_file :photo,
|
10
|
+
styles: ->(attachment) { attachment.instance.dynamic_styles },
|
11
|
+
convert_options: Spud::Photos.convert_options,
|
12
|
+
source_file_options: Spud::Photos.source_file_options,
|
13
|
+
storage: Spud::Photos.paperclip_storage,
|
14
|
+
s3_credentials: Spud::Photos.s3_credentials,
|
15
|
+
url: Spud::Photos.storage_url,
|
16
|
+
path: Spud::Photos.storage_path
|
18
17
|
|
19
18
|
validates_attachment :photo,
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
presence: true,
|
20
|
+
content_type: { content_type: ['image/jpg', 'image/jpeg', 'image/png'] },
|
21
|
+
size: {
|
22
|
+
less_than: Spud::Photos.max_image_upload_size,
|
23
|
+
message: 'size cannot exceed ' + number_to_human_size(Spud::Photos.max_image_upload_size),
|
24
|
+
if: proc { |_p| Spud::Photos.max_image_upload_size > 0 }
|
25
|
+
}
|
27
26
|
|
28
27
|
def dynamic_styles
|
29
28
|
admin_styles = {
|
30
|
-
:
|
31
|
-
:
|
29
|
+
spud_admin_small: { geometry: '125x125#', format: :jpg, source_file_options: '-density 72', convert_options: '-strip -quality 85' },
|
30
|
+
spud_admin_medium: { geometry: '300x200', format: :jpg, source_file_options: '-density 72', convert_options: '-strip -quality 85' }
|
32
31
|
}
|
33
|
-
|
32
|
+
admin_styles.merge(Spud::Photos.config.photo_styles)
|
34
33
|
end
|
35
|
-
|
36
34
|
end
|
@@ -1,41 +1,38 @@
|
|
1
1
|
class SpudPhotoAlbum < ActiveRecord::Base
|
2
|
-
|
3
|
-
has_many :
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
:source => :spud_photo
|
2
|
+
has_many :spud_photo_albums_photos, dependent: :destroy
|
3
|
+
has_many :photos,
|
4
|
+
-> { order('spud_photo_albums_photos.sort_order asc') },
|
5
|
+
through: :spud_photo_albums_photos,
|
6
|
+
source: :spud_photo
|
8
7
|
|
9
8
|
has_many :spud_photo_galleries_albums
|
10
9
|
has_many :galleries,
|
11
|
-
|
12
|
-
|
10
|
+
through: :spud_photo_galleries_albums,
|
11
|
+
source: :spud_photo_gallery
|
13
12
|
|
14
|
-
|
15
|
-
|
13
|
+
validates :title, :url_name, presence: true
|
14
|
+
validates :title, :url_name, uniqueness: true
|
16
15
|
before_validation :set_url_name
|
17
16
|
after_save :update_photo_order
|
18
17
|
|
19
|
-
scope :ordered, ->{ order('created_at desc') }
|
18
|
+
scope :ordered, -> { order('created_at desc') }
|
20
19
|
|
21
20
|
def top_photo_url(style)
|
22
|
-
|
23
|
-
return photos.first.photo.url(style)
|
24
|
-
end
|
21
|
+
return photos.first.photo.url(style) unless photos.empty?
|
25
22
|
end
|
26
23
|
|
27
24
|
def photos_available
|
28
25
|
if photo_ids.any?
|
29
|
-
|
26
|
+
SpudPhoto.where('id not in (?)', photo_ids)
|
30
27
|
else
|
31
|
-
|
28
|
+
SpudPhoto.all
|
32
29
|
end
|
33
30
|
end
|
34
31
|
|
35
|
-
private
|
32
|
+
private
|
36
33
|
|
37
34
|
def set_url_name
|
38
|
-
self.url_name =
|
35
|
+
self.url_name = title.parameterize
|
39
36
|
end
|
40
37
|
|
41
38
|
def update_photo_order
|
@@ -45,5 +42,4 @@ private
|
|
45
42
|
# order += 1
|
46
43
|
# end
|
47
44
|
end
|
48
|
-
|
49
45
|
end
|
@@ -1,36 +1,30 @@
|
|
1
1
|
class SpudPhotoGallery < ActiveRecord::Base
|
2
|
-
|
3
|
-
has_many :spud_photo_galleries_albums, :dependent => :destroy
|
2
|
+
has_many :spud_photo_galleries_albums, dependent: :destroy
|
4
3
|
has_many :albums,
|
5
|
-
|
6
|
-
|
4
|
+
through: :spud_photo_galleries_albums,
|
5
|
+
source: :spud_photo_album
|
7
6
|
|
8
|
-
|
9
|
-
|
7
|
+
validates :title, :url_name, presence: true
|
8
|
+
validates :title, :url_name, uniqueness: true
|
10
9
|
before_validation :set_url_name
|
11
10
|
|
12
|
-
scope :ordered, ->{ order('created_at desc') }
|
11
|
+
scope :ordered, -> { order('created_at desc') }
|
13
12
|
|
14
13
|
def top_photo_url(style)
|
15
|
-
unless albums.empty?
|
16
|
-
return albums.first.top_photo_url(style)
|
17
|
-
end
|
14
|
+
return albums.first.top_photo_url(style) unless albums.empty?
|
18
15
|
end
|
19
16
|
|
20
17
|
def albums_available
|
21
18
|
if album_ids.any?
|
22
|
-
|
19
|
+
SpudPhotoAlbum.where('id not in (?)', album_ids)
|
23
20
|
else
|
24
|
-
|
21
|
+
SpudPhotoAlbum.all
|
25
22
|
end
|
26
23
|
end
|
27
24
|
|
28
25
|
private
|
29
26
|
|
30
27
|
def set_url_name
|
31
|
-
|
32
|
-
self.url_name = self.title.parameterize
|
33
|
-
end
|
28
|
+
self.url_name = title.parameterize if title
|
34
29
|
end
|
35
|
-
|
36
30
|
end
|
@@ -5,6 +5,6 @@
|
|
5
5
|
</div>
|
6
6
|
<div class="admin-photo-ui-thumb-controls">
|
7
7
|
<%= link_to '', edit_admin_photo_album_path(album), :class => 'admin-photos-btn-edit' %>
|
8
|
-
<%= link_to '', admin_photo_album_path(album), :
|
8
|
+
<%= link_to '', admin_photo_album_path(album), method: :delete, :class => 'admin-photos-btn-delete', :data => {:confirm => 'Are you sure?'} %>
|
9
9
|
</div>
|
10
10
|
</div>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<h5><%= gallery.title %></h5>
|
10
10
|
<div class="admin-photo-ui-thumb-controls">
|
11
11
|
<%= link_to '', edit_admin_photo_gallery_path(gallery), :class => 'admin-photos-btn-edit' %>
|
12
|
-
<%= link_to '', admin_photo_gallery_path(gallery), :method => :delete, :class => 'admin-photos-btn-delete', :
|
12
|
+
<%= link_to '', admin_photo_gallery_path(gallery), :method => :delete, :class => 'admin-photos-btn-delete', :data => {:confirm => 'Are you sure?'} %>
|
13
13
|
</div>
|
14
14
|
</div>
|
15
15
|
<% end %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% if @photo.errors.any? %>
|
2
|
-
|
2
|
+
tb.photos.photoLegacyUploadErrors("<%= escape_javascript(render 'form') %>");
|
3
3
|
<% else %>
|
4
|
-
|
5
|
-
<% end %>
|
4
|
+
tb.photos.photoLegacyUploadComplete(<%= @photo.id %>, "<%= escape_javascript(render :partial => 'photo', :locals => {:photo => @photo}) %>");
|
5
|
+
<% end %>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<%= content_for :head do %>
|
2
2
|
<script type="text/javascript">
|
3
|
-
$(document).ready(
|
4
|
-
|
5
|
-
|
3
|
+
$(document).ready(tb.photos.init);
|
4
|
+
tb.photos.max_image_upload_size_humanized = tb.photos.getFileSizeHumanized(<%= Spud::Photos.max_image_upload_size %>);
|
5
|
+
tb.photos.max_image_upload_size_bytes = <%= Spud::Photos.max_image_upload_size %>;
|
6
6
|
</script>
|
7
7
|
<% end %>
|
8
8
|
<%= render :template => 'layouts/admin/detail' %>
|
data/config/routes.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
Rails.application.routes.draw do
|
2
|
-
|
3
2
|
namespace :admin do
|
4
3
|
resources :photos do
|
5
|
-
get 'library', :
|
6
|
-
post 'mass_destroy', :
|
4
|
+
get 'library', on: :collection
|
5
|
+
post 'mass_destroy', on: :collection
|
7
6
|
end
|
8
7
|
resources :photo_albums
|
9
8
|
resources :photo_galleries
|
@@ -11,12 +10,11 @@ Rails.application.routes.draw do
|
|
11
10
|
|
12
11
|
scope Spud::Photos.config.base_path do
|
13
12
|
if Spud::Photos.config.galleries_enabled
|
14
|
-
resources :photo_galleries, :
|
15
|
-
resources :photo_albums, :
|
13
|
+
resources :photo_galleries, only: :index, path: '/' do
|
14
|
+
resources :photo_albums, only: [:index, :show], path: '/'
|
16
15
|
end
|
17
16
|
else
|
18
|
-
resources :photo_albums, :
|
17
|
+
resources :photo_albums, only: [:index, :show], path: '/'
|
19
18
|
end
|
20
19
|
end
|
21
|
-
|
22
20
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class CreateSpudPhotos < ActiveRecord::Migration
|
1
|
+
class CreateSpudPhotos < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :spud_photos do |t|
|
4
4
|
t.string :title
|
@@ -10,4 +10,4 @@ class CreateSpudPhotos < ActiveRecord::Migration
|
|
10
10
|
t.timestamps
|
11
11
|
end
|
12
12
|
end
|
13
|
-
end
|
13
|
+
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
class CreateSpudPhotoAlbums < ActiveRecord::Migration
|
1
|
+
class CreateSpudPhotoAlbums < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :spud_photo_albums do |t|
|
4
4
|
t.string :title
|
5
5
|
t.string :url_name
|
6
6
|
t.timestamps
|
7
7
|
end
|
8
|
-
create_table :spud_photo_albums_photos, :
|
8
|
+
create_table :spud_photo_albums_photos, id: false do |t|
|
9
9
|
t.integer :spud_photo_album_id
|
10
10
|
t.integer :spud_photo_id
|
11
11
|
end
|
12
|
-
add_index :spud_photo_albums, :url_name, :
|
13
|
-
add_index :spud_photo_albums_photos, :spud_photo_album_id, :
|
12
|
+
add_index :spud_photo_albums, :url_name, name: 'idx_album_url_name'
|
13
|
+
add_index :spud_photo_albums_photos, :spud_photo_album_id, name: 'idx_album_id'
|
14
14
|
end
|
15
15
|
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
class CreateSpudPhotoGalleries < ActiveRecord::Migration
|
1
|
+
class CreateSpudPhotoGalleries < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :spud_photo_galleries do |t|
|
4
4
|
t.string :title
|
5
5
|
t.string :url_name
|
6
6
|
t.timestamps
|
7
7
|
end
|
8
|
-
create_table :spud_photo_galleries_albums, :
|
8
|
+
create_table :spud_photo_galleries_albums, id: false do |t|
|
9
9
|
t.integer :spud_photo_gallery_id
|
10
10
|
t.integer :spud_photo_album_id
|
11
11
|
end
|
12
|
-
add_index :spud_photo_galleries, :url_name, :
|
13
|
-
add_index :spud_photo_galleries_albums, :spud_photo_gallery_id, :
|
12
|
+
add_index :spud_photo_galleries, :url_name, name: 'idx_gallery_url_name'
|
13
|
+
add_index :spud_photo_galleries_albums, :spud_photo_gallery_id, name: 'idx_gallery_id'
|
14
14
|
end
|
15
15
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
class UpgradePhotoRelationships < ActiveRecord::Migration
|
1
|
+
class UpgradePhotoRelationships < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
add_column :spud_photo_albums_photos, :id, :primary_key
|
4
|
-
add_column :spud_photo_albums_photos, :order, :integer, :
|
4
|
+
add_column :spud_photo_albums_photos, :order, :integer, default: 0
|
5
5
|
add_column :spud_photo_galleries_albums, :id, :primary_key
|
6
|
-
add_column :spud_photo_galleries_albums, :order, :integer, :
|
6
|
+
add_column :spud_photo_galleries_albums, :order, :integer, default: 0
|
7
7
|
end
|
8
|
-
end
|
8
|
+
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails/generators/migration'
|
2
2
|
|
3
3
|
class Spud::Photos::ViewsGenerator < ::Rails::Generators::Base
|
4
|
-
|
5
4
|
source_root File.expand_path('../../../../../app/views', __FILE__)
|
6
5
|
|
7
6
|
def install
|
@@ -11,4 +10,4 @@ class Spud::Photos::ViewsGenerator < ::Rails::Generators::Base
|
|
11
10
|
copy_file 'photo_albums/index.html.erb', 'app/views/photo_albums/index.html.erb'
|
12
11
|
copy_file 'photo_albums/show.html.erb', 'app/views/photo_albums/show.html.erb'
|
13
12
|
end
|
14
|
-
end
|
13
|
+
end
|
@@ -2,25 +2,25 @@ module Spud
|
|
2
2
|
module Photos
|
3
3
|
include ActiveSupport::Configurable
|
4
4
|
require 'active_support/core_ext/numeric/bytes'
|
5
|
-
config_accessor :photo_styles, :convert_options, :source_file_options, :galleries_enabled, :base_layout, :base_path
|
5
|
+
config_accessor :photo_styles, :convert_options, :source_file_options, :galleries_enabled, :base_layout, :base_path, :s3_credentials, :storage_path, :storage_url, :paperclip_storage, :enable_full_page_caching, :page_caches_to_sweep, :max_image_upload_size
|
6
6
|
self.photo_styles = {
|
7
|
-
:
|
8
|
-
:
|
9
|
-
:
|
7
|
+
small: '50x50#',
|
8
|
+
medium: '200x200#',
|
9
|
+
large: '400x400#'
|
10
10
|
}
|
11
11
|
self.convert_options = {
|
12
|
-
:
|
12
|
+
all: '-strip'
|
13
13
|
}
|
14
14
|
self.source_file_options = {
|
15
|
-
:
|
15
|
+
all: '-density 72'
|
16
16
|
}
|
17
17
|
self.galleries_enabled = false
|
18
18
|
self.base_layout = 'application'
|
19
19
|
self.base_path = 'photos'
|
20
20
|
self.paperclip_storage = :filesystem
|
21
21
|
self.s3_credentials = "#{Rails.root}/config/s3.yml"
|
22
|
-
self.storage_path =
|
23
|
-
self.storage_url =
|
22
|
+
self.storage_path = ':rails_root/public/system/spud_photos/:id/:style/:basename.:extension'
|
23
|
+
self.storage_url = '/system/spud_photos/:id/:style/:basename.:extension'
|
24
24
|
self.enable_full_page_caching = false
|
25
25
|
self.page_caches_to_sweep = []
|
26
26
|
self.max_image_upload_size = 5.megabytes
|
data/lib/spud_photos/engine.rb
CHANGED
@@ -5,31 +5,26 @@ module Spud
|
|
5
5
|
module Photos
|
6
6
|
class Engine < Rails::Engine
|
7
7
|
engine_name :tb_photos
|
8
|
-
initializer :assets_photos do |
|
9
|
-
|
10
|
-
|
8
|
+
initializer :assets_photos do |_config|
|
9
|
+
TbCore.append_admin_javascripts('admin/photos/application')
|
10
|
+
TbCore.append_admin_stylesheets('admin/photos/application')
|
11
11
|
end
|
12
12
|
initializer :admin do
|
13
|
-
|
14
|
-
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
|
20
|
-
# :name => 'Photos',
|
21
|
-
# :thumbnail => 'spud/photos/photo_albums_thumb.png',
|
22
|
-
# :url => '/spud/admin/photos',
|
23
|
-
# :retina => true,
|
24
|
-
# :order => 83
|
13
|
+
Rails.application.config.assets.precompile += %w( admin/photos/photo_albums_thumb.png )
|
14
|
+
TbCore.config.admin_applications += [{
|
15
|
+
name: 'Photo Albums',
|
16
|
+
thumbnail: 'admin/photos/photo_albums_thumb.png',
|
17
|
+
url: '/admin/photo_albums',
|
18
|
+
retina: true,
|
19
|
+
order: 82
|
25
20
|
}]
|
26
21
|
if Spud::Photos.config.galleries_enabled
|
27
22
|
Spud::Core.config.admin_applications += [{
|
28
|
-
:
|
29
|
-
:
|
30
|
-
:
|
31
|
-
:
|
32
|
-
:
|
23
|
+
name: 'Photo Galleries',
|
24
|
+
thumbnail: 'admin/photos/photo_albums_thumb.png',
|
25
|
+
url: '/admin/photo_galleries',
|
26
|
+
retina: true,
|
27
|
+
order: 81
|
33
28
|
}]
|
34
29
|
end
|
35
30
|
end
|
data/lib/spud_photos/version.rb
CHANGED
data/lib/tb_photos.rb
CHANGED
data/spec/dummy/config.ru
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path('../boot', __FILE__)
|
|
3
3
|
require 'rails/all'
|
4
4
|
|
5
5
|
Bundler.require
|
6
|
-
require
|
6
|
+
require 'tb_photos'
|
7
7
|
|
8
8
|
module Dummy
|
9
9
|
class Application < Rails::Application
|
@@ -31,7 +31,7 @@ module Dummy
|
|
31
31
|
config.i18n.enforce_available_locales = true
|
32
32
|
|
33
33
|
# Configure the default encoding used in templates for Ruby 1.9.
|
34
|
-
config.encoding =
|
34
|
+
config.encoding = 'utf-8'
|
35
35
|
|
36
36
|
# Configure sensitive parameters which will be filtered from the log file.
|
37
37
|
config.filter_parameters += [:password]
|
@@ -54,4 +54,3 @@ module Dummy
|
|
54
54
|
config.assets.version = '1.0'
|
55
55
|
end
|
56
56
|
end
|
57
|
-
|
data/spec/dummy/config/boot.rb
CHANGED
@@ -9,7 +9,7 @@ Dummy::Application.configure do
|
|
9
9
|
|
10
10
|
# Configure static asset server for tests with Cache-Control for performance
|
11
11
|
config.serve_static_assets = true
|
12
|
-
config.static_cache_control =
|
12
|
+
config.static_cache_control = 'public, max-age=3600'
|
13
13
|
|
14
14
|
# Do not eager load code on boot. This avoids loading your whole application
|
15
15
|
# just for the purpose of running a single test. If you are using a tool that
|
@@ -24,7 +24,7 @@ Dummy::Application.configure do
|
|
24
24
|
config.action_dispatch.show_exceptions = false
|
25
25
|
|
26
26
|
# Disable request forgery protection in test environment
|
27
|
-
config.action_controller.allow_forgery_protection
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
28
28
|
|
29
29
|
# Tell Action Mailer not to deliver emails to the real world.
|
30
30
|
# The :test delivery method accumulates sent emails in the
|
data/spec/dummy/config/routes.rb
CHANGED
data/spec/dummy/script/rails
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
3
|
|
4
|
-
APP_PATH = File.expand_path('../../config/application',
|
5
|
-
require File.expand_path('../../config/boot',
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
6
|
require 'rails/commands'
|
data/spec/spec_helper.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# Track code coverage
|
2
2
|
require 'simplecov'
|
3
|
-
|
3
|
+
SimpleCov.start 'rails' do
|
4
4
|
# root "dummy/"
|
5
|
-
add_filter
|
5
|
+
add_filter '/factories/'
|
6
6
|
end
|
7
7
|
|
8
8
|
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
9
|
-
ENV[
|
10
|
-
require File.expand_path(
|
9
|
+
ENV['RAILS_ENV'] = 'test'
|
10
|
+
require File.expand_path('../dummy/config/environment', __FILE__)
|
11
11
|
require 'rspec/rails'
|
12
12
|
require 'rspec/autorun'
|
13
13
|
require 'database_cleaner'
|
@@ -17,8 +17,8 @@ require 'mocha'
|
|
17
17
|
|
18
18
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
19
19
|
# in spec/support/ and its subdirectories.
|
20
|
-
ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
|
21
|
-
Dir[File.join(ENGINE_RAILS_ROOT,
|
20
|
+
ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../')
|
21
|
+
Dir[File.join(ENGINE_RAILS_ROOT, 'spec/support/**/*.rb'), File.join(ENGINE_RAILS_ROOT, 'factories/*')].each { |f| require f }
|
22
22
|
|
23
23
|
RSpec.configure do |config|
|
24
24
|
config.mock_with :mocha
|
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tb_photos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Woods
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.0.0.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.0.0.1
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: tb_core
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
|
-
- - "
|
31
|
+
- - ">="
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
33
|
+
version: '1.4'
|
20
34
|
type: :runtime
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
|
-
- - "
|
38
|
+
- - ">="
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
40
|
+
version: '1.4'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: paperclip
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -126,13 +140,13 @@ description: Twice Baked is a feature complete photo management/gallery for the
|
|
126
140
|
engine. Manage multiple galleries, albums, and photos. Use HTML 5 to drag and drop
|
127
141
|
many images at once.
|
128
142
|
email:
|
129
|
-
- greg@
|
143
|
+
- greg.woods@moserit.com
|
130
144
|
executables: []
|
131
145
|
extensions: []
|
132
146
|
extra_rdoc_files: []
|
133
147
|
files:
|
134
148
|
- MIT-LICENSE
|
135
|
-
- README.
|
149
|
+
- README.md
|
136
150
|
- Rakefile
|
137
151
|
- app/assets/images/admin/photos/photo_albums_thumb.png
|
138
152
|
- app/assets/javascripts/admin/photos/application.js
|
@@ -155,19 +169,16 @@ files:
|
|
155
169
|
- app/models/spud_photo_gallery.rb
|
156
170
|
- app/views/admin/photo_albums/_album.html.erb
|
157
171
|
- app/views/admin/photo_albums/_form.html.erb
|
158
|
-
- app/views/admin/photo_albums/destroy.js.erb
|
159
172
|
- app/views/admin/photo_albums/edit.html.erb
|
160
173
|
- app/views/admin/photo_albums/index.html.erb
|
161
174
|
- app/views/admin/photo_albums/new.html.erb
|
162
175
|
- app/views/admin/photo_galleries/_album.html.erb
|
163
176
|
- app/views/admin/photo_galleries/_form.html.erb
|
164
|
-
- app/views/admin/photo_galleries/destroy.js.erb
|
165
177
|
- app/views/admin/photo_galleries/edit.html.erb
|
166
178
|
- app/views/admin/photo_galleries/index.html.erb
|
167
179
|
- app/views/admin/photo_galleries/new.html.erb
|
168
180
|
- app/views/admin/photos/_form.html.erb
|
169
181
|
- app/views/admin/photos/_photo.html.erb
|
170
|
-
- app/views/admin/photos/destroy.js.erb
|
171
182
|
- app/views/admin/photos/edit.html.erb
|
172
183
|
- app/views/admin/photos/index.html.erb
|
173
184
|
- app/views/admin/photos/new.html.erb
|
@@ -218,10 +229,10 @@ files:
|
|
218
229
|
- spec/dummy/public/favicon.ico
|
219
230
|
- spec/dummy/script/rails
|
220
231
|
- spec/spec_helper.rb
|
221
|
-
homepage: http://bitbucket.org/
|
232
|
+
homepage: http://bitbucket.org/moser-inc/tb_photos
|
222
233
|
licenses: []
|
223
234
|
metadata: {}
|
224
|
-
post_install_message:
|
235
|
+
post_install_message:
|
225
236
|
rdoc_options: []
|
226
237
|
require_paths:
|
227
238
|
- lib
|
@@ -236,38 +247,37 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
236
247
|
- !ruby/object:Gem::Version
|
237
248
|
version: '0'
|
238
249
|
requirements: []
|
239
|
-
|
240
|
-
|
241
|
-
signing_key:
|
250
|
+
rubygems_version: 3.0.8
|
251
|
+
signing_key:
|
242
252
|
specification_version: 4
|
243
253
|
summary: Twice Baked Engine
|
244
254
|
test_files:
|
255
|
+
- spec/spec_helper.rb
|
256
|
+
- spec/dummy/app/controllers/application_controller.rb
|
257
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
245
258
|
- spec/dummy/app/assets/javascripts/application.js
|
246
259
|
- spec/dummy/app/assets/stylesheets/application.css
|
247
|
-
- spec/dummy/app/controllers/application_controller.rb
|
248
260
|
- spec/dummy/app/helpers/application_helper.rb
|
249
|
-
- spec/dummy/
|
250
|
-
- spec/dummy/config/
|
251
|
-
- spec/dummy/config/boot.rb
|
252
|
-
- spec/dummy/config/database.yml
|
253
|
-
- spec/dummy/config/environment.rb
|
254
|
-
- spec/dummy/config/environments/development.rb
|
261
|
+
- spec/dummy/config/routes.rb
|
262
|
+
- spec/dummy/config/locales/en.yml
|
255
263
|
- spec/dummy/config/environments/production.rb
|
264
|
+
- spec/dummy/config/environments/development.rb
|
256
265
|
- spec/dummy/config/environments/test.rb
|
266
|
+
- spec/dummy/config/environment.rb
|
267
|
+
- spec/dummy/config/application.rb
|
268
|
+
- spec/dummy/config/database.yml
|
269
|
+
- spec/dummy/config/boot.rb
|
257
270
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
258
|
-
- spec/dummy/config/initializers/inflections.rb
|
259
271
|
- spec/dummy/config/initializers/mime_types.rb
|
260
|
-
- spec/dummy/config/initializers/secret_token.rb
|
261
272
|
- spec/dummy/config/initializers/session_store.rb
|
262
273
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
263
|
-
- spec/dummy/config/
|
264
|
-
- spec/dummy/config/
|
274
|
+
- spec/dummy/config/initializers/secret_token.rb
|
275
|
+
- spec/dummy/config/initializers/inflections.rb
|
265
276
|
- spec/dummy/config.ru
|
266
|
-
- spec/dummy/
|
277
|
+
- spec/dummy/script/rails
|
278
|
+
- spec/dummy/Rakefile
|
279
|
+
- spec/dummy/public/favicon.ico
|
267
280
|
- spec/dummy/public/422.html
|
268
281
|
- spec/dummy/public/500.html
|
269
|
-
- spec/dummy/public/
|
270
|
-
- spec/dummy/Rakefile
|
282
|
+
- spec/dummy/public/404.html
|
271
283
|
- spec/dummy/README.rdoc
|
272
|
-
- spec/dummy/script/rails
|
273
|
-
- spec/spec_helper.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
spud.admin.photos.markPhotoAlbumAsDeleted(<%= @photo_album.id %>);
|
@@ -1 +0,0 @@
|
|
1
|
-
spud.admin.photos.markPhotoGalleryAsDeleted(<%= @photo_gallery.id %>);
|
@@ -1 +0,0 @@
|
|
1
|
-
spud.admin.photos.markPhotoAsDeleted(<%= @photo.id %>);
|