spud_photos 0.0.3 → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/spud/admin/photos.js +17 -10
- data/app/assets/stylesheets/spud/admin/photos.css +21 -33
- data/app/controllers/spud/admin/photo_albums_controller.rb +2 -2
- data/app/controllers/spud/admin/photo_galleries_controller.rb +1 -0
- data/app/views/spud/admin/photo_albums/_album.html.erb +1 -1
- data/app/views/spud/admin/photo_albums/_form.html.erb +2 -3
- data/app/views/spud/admin/photo_galleries/_form.html.erb +2 -3
- data/lib/spud_photos/version.rb +1 -1
- metadata +12 -12
@@ -10,25 +10,32 @@ Spud.Admin.Photos = new function(){
|
|
10
10
|
$('.spud_admin_photo_ui_thumbs_sortable').sortable({
|
11
11
|
connectWith:'.spud_admin_photo_ui_thumbs_sortable'
|
12
12
|
});
|
13
|
-
$('body').on('submit', '#spud_admin_photo_album_form', self.submittedPhotoAlbumForm)
|
13
|
+
$('body').on('submit', '#spud_admin_photo_album_form', self.submittedPhotoAlbumForm);
|
14
|
+
$('body').on('submit', '#spud_admin_photo_gallery_form', self.submittedPhotoGalleryForm);
|
14
15
|
$('body').on('submit', '#spud_admin_photo_form', self.submittedPhotoForm);
|
15
16
|
$('body').on('click', '.spud_admin_photos_btn_remove', self.clickedPhotoRemoveFromLibrary)
|
16
17
|
$('body').on('click', '.spud_admin_photo_ui_thumbs_selectable .spud_admin_photo_ui_thumb', self.selectedPhotoUiThumb);
|
17
18
|
$('body').on('click', '#spud_admin_photo_album_action_library', self.clickedPhotoLibrary);
|
18
19
|
|
19
20
|
// html5 drag and drop file
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
if(FormData){
|
22
|
+
$('#spud_admin_photo_upload_queue').show();
|
23
|
+
var droparea = document.getElementById('spud_admin_photo_upload_queue');
|
24
|
+
droparea.addEventListener('dragenter', self.stopDndPropagation, false);
|
25
|
+
droparea.addEventListener('dragexit', self.stopDndPropagation, false);
|
26
|
+
droparea.addEventListener('dragover', self.stopDndPropagation, false);
|
27
|
+
droparea.addEventListener('drop', self.droppedFile, false);
|
28
|
+
}
|
25
29
|
};
|
26
30
|
|
27
|
-
this.submittedPhotoAlbumForm = function(){
|
28
|
-
|
29
|
-
$('#spud_photo_album_order').val(ids.toArray().join());
|
31
|
+
this.submittedPhotoAlbumForm = function(e){
|
32
|
+
|
30
33
|
};
|
31
34
|
|
35
|
+
this.submittedPhotoGalleryForm = function(e){
|
36
|
+
$('#spud_admin_photo_albums_available .spud_admin_photo_ui_thumb').remove();
|
37
|
+
}
|
38
|
+
|
32
39
|
this.clickedPhotoRemoveFromLibrary = function(e){
|
33
40
|
$(this).parents('.spud_admin_photo_ui_thumb').fadeOut(200, function(){
|
34
41
|
$(this).remove();
|
@@ -202,7 +209,7 @@ Spud.Admin.Photos = new function(){
|
|
202
209
|
}
|
203
210
|
});
|
204
211
|
dialog.dialog({
|
205
|
-
width:
|
212
|
+
width: 675,
|
206
213
|
modal: true,
|
207
214
|
height: 450,
|
208
215
|
title: 'My Photo Library',
|
@@ -1,16 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
margin-right: 18px;
|
4
|
-
float: left;
|
5
|
-
}
|
6
|
-
.spud_admin_photos_selection_right{
|
7
|
-
width: 400px;
|
8
|
-
float: left;
|
9
|
-
}
|
10
|
-
.spud_admin_photos_selection_left h4, .spud_admin_photos_selection_right h4{
|
11
|
-
font-weight: normal;
|
12
|
-
margin: 15px 0;
|
13
|
-
}
|
1
|
+
/* Thumbnails
|
2
|
+
---------------------------- */
|
14
3
|
.spud_admin_photo_ui_thumbs{
|
15
4
|
height: 300px;
|
16
5
|
padding: 0;
|
@@ -75,11 +64,6 @@
|
|
75
64
|
overflow: hidden;
|
76
65
|
text-overflow: ellipsis;
|
77
66
|
}
|
78
|
-
.spud_admin_photo_ui_thumb input[type=checkbox]{
|
79
|
-
position: absolute;
|
80
|
-
top: 4px;
|
81
|
-
left: 4px;
|
82
|
-
}
|
83
67
|
.spud_admin_photo_ui_thumb_controls{
|
84
68
|
position: absolute;
|
85
69
|
bottom: 0;
|
@@ -105,24 +89,9 @@
|
|
105
89
|
display: inline-block;
|
106
90
|
margin: 0 4px;
|
107
91
|
}
|
108
|
-
.spud_admin_photos_album_fieldset{
|
109
|
-
position: relative;
|
110
|
-
}
|
111
|
-
.spud_admin_photos_album_fieldset .spud_admin_photo_create{
|
112
|
-
position: absolute;
|
113
|
-
top: 0;
|
114
|
-
right: 0;
|
115
|
-
}
|
116
|
-
|
117
|
-
#spud_admin_photo_album_actions{
|
118
|
-
|
119
|
-
}
|
120
92
|
|
121
93
|
/* Upload Queue
|
122
94
|
---------------------------- */
|
123
|
-
#spud_admin_photo_album_form{
|
124
|
-
|
125
|
-
}
|
126
95
|
.spud_admin_photo_progress{
|
127
96
|
margin: 10px 0;
|
128
97
|
}
|
@@ -136,4 +105,23 @@
|
|
136
105
|
float: right;
|
137
106
|
border: 1px solid #cacaca;
|
138
107
|
overflow-y: scroll;
|
108
|
+
}
|
109
|
+
|
110
|
+
/* Gallery Form
|
111
|
+
---------------------------- */
|
112
|
+
.spud_admin_photos_selection_left{
|
113
|
+
width: 520px;
|
114
|
+
margin-right: 18px;
|
115
|
+
float: left;
|
116
|
+
}
|
117
|
+
.spud_admin_photos_selection_right{
|
118
|
+
width: 400px;
|
119
|
+
float: left;
|
120
|
+
}
|
121
|
+
.spud_admin_photos_selection_left h4, .spud_admin_photos_selection_right h4{
|
122
|
+
font-weight: normal;
|
123
|
+
margin: 15px 0;
|
124
|
+
}
|
125
|
+
#spud_admin_photo_gallery_form .spud_admin_photo_ui_thumb_controls{
|
126
|
+
display: none;
|
139
127
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class Spud::Admin::PhotoAlbumsController < Spud::Admin::ApplicationController
|
2
2
|
|
3
3
|
before_filter :get_album, :only => [:show, :edit, :update, :destroy, :library]
|
4
|
+
add_breadcrumb 'Photo Albums', :spud_admin_photo_albums_path
|
4
5
|
respond_to :html, :json, :xml
|
5
6
|
layout 'spud/admin/spud_photos'
|
6
7
|
|
@@ -22,7 +23,6 @@ class Spud::Admin::PhotoAlbumsController < Spud::Admin::ApplicationController
|
|
22
23
|
@photo_album = SpudPhotoAlbum.new(params[:spud_photo_album])
|
23
24
|
if @photo_album.save
|
24
25
|
set_photo_order
|
25
|
-
@photo_album.spud_photo_albums_photos = photo_albums_photos
|
26
26
|
end
|
27
27
|
respond_with @photo_album, :location => spud_admin_photo_albums_path
|
28
28
|
end
|
@@ -52,7 +52,7 @@ class Spud::Admin::PhotoAlbumsController < Spud::Admin::ApplicationController
|
|
52
52
|
private
|
53
53
|
|
54
54
|
def set_photo_order
|
55
|
-
order_ids = params[:
|
55
|
+
order_ids = params[:spud_photo_album][:photo_ids] || []
|
56
56
|
@photo_album.spud_photo_albums_photos.each do |obj|
|
57
57
|
logger.debug "##### ID: #{obj.spud_photo_id.to_s}"
|
58
58
|
index = order_ids.index(obj.spud_photo_id.to_s)
|
@@ -2,6 +2,7 @@ class Spud::Admin::PhotoGalleriesController < Spud::Admin::ApplicationController
|
|
2
2
|
|
3
3
|
before_filter :get_gallery, :only => [:show, :edit, :update, :destroy]
|
4
4
|
before_filter :get_albums, :only => [:new, :create, :edit, :update]
|
5
|
+
add_breadcrumb 'Photo Galleries', :spud_admin_photo_galleries_path
|
5
6
|
respond_to :html, :json, :xml
|
6
7
|
layout 'spud/admin/spud_photos'
|
7
8
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div id="spud_admin_photo_album_<%= album.id %>" class="spud_admin_photo_ui_thumb" style="background-image:url('<%= album.top_photo_url(:spud_admin_small) %>')">
|
2
2
|
<h5><%= album.title %></h5>
|
3
3
|
<div style="display:none;">
|
4
|
-
<%=
|
4
|
+
<%= hidden_field_tag 'spud_photo_gallery[album_ids][]', album.id %>
|
5
5
|
</div>
|
6
6
|
<div class="spud_admin_photo_ui_thumb_controls">
|
7
7
|
<%= link_to 'Edit', edit_spud_admin_photo_album_path(album), :class => 'spud_admin_photos_btn_edit' %>
|
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
<%= error_messages_for(f.object) %>
|
4
4
|
|
5
|
-
<%= hidden_field_tag :spud_photo_album_order %>
|
6
|
-
|
7
5
|
<fieldset>
|
8
6
|
<legend>Photo Album Info</legend>
|
9
7
|
<div class="control-group">
|
@@ -18,9 +16,10 @@
|
|
18
16
|
<legend>Selected Photos</legend>
|
19
17
|
<div id="spud_admin_photo_album_actions" class="control-group">
|
20
18
|
<%= link_to "Photo Library", spud_admin_photos_path, :class => "btn btn-primary", :id => 'spud_admin_photo_album_action_library' %>
|
21
|
-
<%= link_to "Upload Photo", new_spud_admin_photo_path, :class => "ajax btn btn-
|
19
|
+
<%= link_to "Upload Photo", new_spud_admin_photo_path, :class => "ajax btn btn-success", :title => "New Photo" %>
|
22
20
|
</div>
|
23
21
|
<div id="spud_admin_photo_upload_queue">
|
22
|
+
<p>Drag and drop photos here to upload</p>
|
24
23
|
<h5 id="spud_admin_photo_upload_queue_label">Queued Uploads: <span>0</span></h5>
|
25
24
|
<div id="spud_admin_photo_upload_queue_bars"></div>
|
26
25
|
</div>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= form_for @photo_gallery, :url => path, :html => {:class => 'form-horizontal', :id => 'spud_admin_photo_gallery_form'} do |f| %>
|
2
2
|
|
3
|
-
<%=error_messages_for(f.object)%>
|
3
|
+
<%= error_messages_for(f.object) %>
|
4
4
|
|
5
5
|
<fieldset>
|
6
6
|
<legend>Gallery Info</legend>
|
@@ -31,10 +31,9 @@
|
|
31
31
|
</div>
|
32
32
|
</fieldset>
|
33
33
|
|
34
|
-
|
35
34
|
<div class="form-actions">
|
36
35
|
<%= f.submit "Save Photo Gallery", :class=>"btn btn-primary form-btn", "data-loading-text" => "Saving..." %>
|
37
|
-
or <%=link_to "cancel", request.referer, :class => "btn" %>
|
36
|
+
or <%= link_to "cancel", request.referer, :class => "btn" %>
|
38
37
|
</div>
|
39
38
|
|
40
39
|
<% end %>
|
data/lib/spud_photos/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spud_photos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.1'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70266355207680 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.2.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70266355207680
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: spud_core
|
27
|
-
requirement: &
|
27
|
+
requirement: &70266355207040 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -35,10 +35,10 @@ dependencies:
|
|
35
35
|
version: 0.9.0
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *70266355207040
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: paperclip
|
41
|
-
requirement: &
|
41
|
+
requirement: &70266355206380 !ruby/object:Gem::Requirement
|
42
42
|
none: false
|
43
43
|
requirements:
|
44
44
|
- - ! '>='
|
@@ -46,10 +46,10 @@ dependencies:
|
|
46
46
|
version: '0'
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
|
-
version_requirements: *
|
49
|
+
version_requirements: *70266355206380
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: mysql2
|
52
|
-
requirement: &
|
52
|
+
requirement: &70266355205840 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
54
54
|
requirements:
|
55
55
|
- - ! '>='
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
version: '0'
|
58
58
|
type: :development
|
59
59
|
prerelease: false
|
60
|
-
version_requirements: *
|
60
|
+
version_requirements: *70266355205840
|
61
61
|
description: Spud Photos is a feature complete photo management/gallery for the spud
|
62
62
|
engine. Manage multiple galleries, albums, and photos. Use HTML 5 to drag and drop
|
63
63
|
many images at once.
|
@@ -171,7 +171,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
171
171
|
version: '0'
|
172
172
|
segments:
|
173
173
|
- 0
|
174
|
-
hash:
|
174
|
+
hash: 355640415439906538
|
175
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
176
|
none: false
|
177
177
|
requirements:
|
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
version: '0'
|
181
181
|
segments:
|
182
182
|
- 0
|
183
|
-
hash:
|
183
|
+
hash: 355640415439906538
|
184
184
|
requirements: []
|
185
185
|
rubyforge_project:
|
186
186
|
rubygems_version: 1.8.10
|