tb_photos 1.0.6 → 1.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/admin/photos/photo_albums_thumb.png +0 -0
- data/app/assets/javascripts/admin/photos/photos.js +389 -382
- data/app/assets/stylesheets/admin/photos/application.css.scss +49 -51
- data/app/controllers/admin/photo_albums_controller.rb +3 -3
- data/app/controllers/admin/photo_galleries_controller.rb +4 -3
- data/app/controllers/admin/photos_controller.rb +12 -1
- data/app/controllers/photo_albums_controller.rb +4 -4
- data/app/controllers/photo_galleries_controller.rb +1 -1
- data/app/models/spud_photo_album.rb +2 -0
- data/app/models/spud_photo_gallery.rb +2 -0
- data/app/views/admin/photo_albums/_album.html.erb +5 -5
- data/app/views/admin/photo_albums/_form.html.erb +32 -23
- data/app/views/admin/photo_albums/destroy.js.erb +1 -1
- data/app/views/admin/photo_albums/index.html.erb +1 -1
- data/app/views/admin/photo_galleries/_album.html.erb +9 -0
- data/app/views/admin/photo_galleries/_form.html.erb +21 -21
- data/app/views/admin/photo_galleries/index.html.erb +6 -6
- data/app/views/admin/photos/_form.html.erb +11 -28
- data/app/views/admin/photos/_photo.html.erb +6 -6
- data/app/views/admin/photos/index.html.erb +1 -1
- data/app/views/layouts/admin/spud_photos.html.erb +1 -1
- data/app/views/photo_albums/index.html.erb +2 -2
- data/app/views/photo_albums/show.html.erb +2 -2
- data/app/views/photo_galleries/index.html.erb +2 -2
- data/db/migrate/20140730201754_add_fingerprint_to_spud_photos.rb +6 -0
- data/lib/spud_photos/version.rb +1 -1
- metadata +6 -7
- data/app/assets/images/admin/photos/buttons/cog_16x16.png +0 -0
- data/app/assets/images/admin/photos/buttons/x_16x16.png +0 -0
- data/app/assets/images/admin/photos/photo_albums_thumb@2x.png +0 -0
@@ -1,15 +1,16 @@
|
|
1
1
|
//= require_self
|
2
2
|
|
3
|
+
$editor-height: 450px;
|
4
|
+
|
3
5
|
// Thumbnails
|
4
6
|
//////////////
|
5
|
-
.
|
6
|
-
height:
|
7
|
+
.admin-photo-ui-thumbs{
|
8
|
+
height: $editor-height;
|
7
9
|
padding: 0;
|
8
|
-
border: 1px solid #
|
9
|
-
margin: 15px 0;
|
10
|
+
border: 1px solid #EAEAEA;
|
10
11
|
overflow-y: scroll;
|
11
12
|
}
|
12
|
-
.
|
13
|
+
.admin-photo-ui-thumb{
|
13
14
|
width: 125px;
|
14
15
|
height: 125px;
|
15
16
|
float: left;
|
@@ -29,32 +30,32 @@
|
|
29
30
|
-webkit-transition-duration: 0.2s;
|
30
31
|
-webkit-transition-timing-function: ease-out;
|
31
32
|
}
|
32
|
-
.
|
33
|
-
width:
|
34
|
-
height:
|
35
|
-
background-size:
|
33
|
+
.admin-photo-ui-thumb-small{
|
34
|
+
width: 94px;
|
35
|
+
height: 94px;
|
36
|
+
background-size: 94px 94px;
|
36
37
|
margin: 12px;
|
37
38
|
}
|
38
|
-
.
|
39
|
+
.admin-photo-ui-thumb:hover{
|
39
40
|
box-shadow: 0 0 5px black;
|
40
41
|
}
|
41
|
-
.
|
42
|
+
.admin-photo-ui-thumbs-selectable .admin-photo-ui-thumb{
|
42
43
|
cursor: pointer;
|
43
44
|
}
|
44
|
-
.
|
45
|
+
.admin-photo-ui-thumbs-selectable .admin-photo-ui-thumb-controls{
|
45
46
|
display: none;
|
46
47
|
}
|
47
|
-
.
|
48
|
+
.admin-photo-ui-thumb-selected{
|
48
49
|
border: 3px solid #006CCC;
|
49
50
|
margin: 13px;
|
50
51
|
}
|
51
|
-
.
|
52
|
+
.admin-photo-ui-thumb-small.admin-photo-ui-thumb-selected{
|
52
53
|
margin: 9px;
|
53
54
|
}
|
54
|
-
.
|
55
|
+
.admin-photo-ui-thumbs-sortable .admin-photo-ui-thumb{
|
55
56
|
cursor: move;
|
56
57
|
}
|
57
|
-
.
|
58
|
+
.admin-photo-ui-thumb h5{
|
58
59
|
font-size: 12px;
|
59
60
|
color: white;
|
60
61
|
text-align: center;
|
@@ -67,7 +68,7 @@
|
|
67
68
|
text-overflow: ellipsis;
|
68
69
|
margin: 0;
|
69
70
|
}
|
70
|
-
.
|
71
|
+
.admin-photo-ui-thumb-controls{
|
71
72
|
position: absolute;
|
72
73
|
bottom: 0;
|
73
74
|
right: 0;
|
@@ -76,55 +77,52 @@
|
|
76
77
|
background: rgba(0,0,0,0.5);
|
77
78
|
border-bottom-right-radius: 15px;
|
78
79
|
}
|
79
|
-
.
|
80
|
-
|
80
|
+
.admin-photos-btn-edit, .admin-photos-btn-remove, .admin-photos-btn-delete{
|
81
|
+
color: white;
|
82
|
+
position: relative;
|
83
|
+
top: 1px;
|
84
|
+
margin: 0 2px;
|
81
85
|
height: 16px;
|
82
86
|
width: 16px;
|
83
|
-
text-indent: -7777px;
|
84
87
|
display: inline-block;
|
85
|
-
|
88
|
+
font: normal 16px/16px 'Glyphicons Halflings';
|
89
|
+
-webkit-font-smoothing: antialiased;
|
90
|
+
&:hover{
|
91
|
+
color: white;
|
92
|
+
text-decoration: none;
|
93
|
+
}
|
86
94
|
}
|
87
|
-
.
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
95
|
+
.admin-photos-btn-edit:before{
|
96
|
+
content: "\e019";
|
97
|
+
}
|
98
|
+
.admin-photos-btn-remove, .admin-photos-btn-delete{
|
99
|
+
&:before{
|
100
|
+
content: "\e014";
|
101
|
+
}
|
102
|
+
}
|
103
|
+
|
104
|
+
// Album Edit
|
105
|
+
////////////
|
106
|
+
.admin-photo-album-column{
|
107
|
+
margin-bottom: 20px;
|
94
108
|
}
|
95
109
|
|
96
110
|
// Upload Queue
|
97
111
|
//////////////
|
98
|
-
.
|
112
|
+
.admin-photo-progress{
|
99
113
|
margin: 10px 0;
|
100
114
|
}
|
101
|
-
#
|
115
|
+
#admin-photo-upload-queue{
|
102
116
|
display: none;
|
103
117
|
background: white;
|
104
118
|
padding: 15px;
|
105
|
-
|
106
|
-
|
107
|
-
height: 270px;
|
108
|
-
float: right;
|
109
|
-
border: 1px solid #cacaca;
|
119
|
+
height: $editor-height;
|
120
|
+
border: 1px solid #EAEAEA;
|
110
121
|
overflow-y: scroll;
|
111
122
|
}
|
112
|
-
|
123
|
+
|
113
124
|
// Gallery Form
|
114
125
|
//////////////
|
115
|
-
.
|
116
|
-
width: 520px;
|
117
|
-
margin-right: 18px;
|
118
|
-
float: left;
|
119
|
-
}
|
120
|
-
.spud_admin_photos_selection_right{
|
121
|
-
width: 400px;
|
122
|
-
float: left;
|
123
|
-
}
|
124
|
-
.spud_admin_photos_selection_left h4, .spud_admin_photos_selection_right h4{
|
125
|
-
font-weight: normal;
|
126
|
-
margin: 15px 0;
|
127
|
-
}
|
128
|
-
#spud_admin_photo_gallery_form .spud_admin_photo_ui_thumb_controls{
|
126
|
+
.admin-photo-albums-available .admin-photo-ui-thumb-controls{
|
129
127
|
display: none;
|
130
|
-
}
|
128
|
+
}
|
@@ -3,6 +3,7 @@ class Admin::PhotoAlbumsController < Admin::ApplicationController
|
|
3
3
|
before_filter :get_album, :only => [:show, :edit, :update, :destroy, :library]
|
4
4
|
add_breadcrumb 'Photo Albums', :admin_photo_albums_path
|
5
5
|
layout 'admin/spud_photos'
|
6
|
+
belongs_to_spud_app :photo_albums
|
6
7
|
|
7
8
|
def index
|
8
9
|
@photo_albums = SpudPhotoAlbum.all
|
@@ -34,13 +35,13 @@ class Admin::PhotoAlbumsController < Admin::ApplicationController
|
|
34
35
|
@photo_album.update_attributes(photo_album_params)
|
35
36
|
if @photo_album.save
|
36
37
|
set_photo_order
|
37
|
-
flash[:notice] = '
|
38
|
+
flash[:notice] = 'Album updated successfully'
|
38
39
|
end
|
39
40
|
respond_with @photo_album, :location => admin_photo_albums_path
|
40
41
|
end
|
41
42
|
|
42
43
|
def destroy
|
43
|
-
flash[:notice] = '
|
44
|
+
flash.now[:notice] = 'Album deleted successfully' if @photo_album.destroy
|
44
45
|
respond_with @photo_album, :location => admin_photo_albums_path
|
45
46
|
end
|
46
47
|
|
@@ -53,7 +54,6 @@ private
|
|
53
54
|
def set_photo_order
|
54
55
|
order_ids = params[:spud_photo_album][:photo_ids] || []
|
55
56
|
@photo_album.spud_photo_albums_photos.each do |obj|
|
56
|
-
#logger.debug "##### ID: #{obj.spud_photo_id.to_s}"
|
57
57
|
index = order_ids.index(obj.spud_photo_id.to_s)
|
58
58
|
obj.update_attribute(:sort_order, index)
|
59
59
|
end
|
@@ -4,6 +4,7 @@ class Admin::PhotoGalleriesController < Admin::ApplicationController
|
|
4
4
|
before_filter :get_albums, :only => [:new, :create, :edit, :update]
|
5
5
|
add_breadcrumb 'Photo Galleries', :admin_photo_galleries_path
|
6
6
|
layout 'admin/spud_photos'
|
7
|
+
belongs_to_spud_app :photo_galleries
|
7
8
|
|
8
9
|
def index
|
9
10
|
@photo_galleries = SpudPhotoGallery.all
|
@@ -21,7 +22,7 @@ class Admin::PhotoGalleriesController < Admin::ApplicationController
|
|
21
22
|
|
22
23
|
def create
|
23
24
|
@photo_gallery = SpudPhotoGallery.new(photo_gallery_params)
|
24
|
-
flash[:notice] = '
|
25
|
+
flash[:notice] = 'Gallery created successfully' if @photo_gallery.save
|
25
26
|
respond_with @photo_gallery, :location => admin_photo_galleries_path
|
26
27
|
end
|
27
28
|
|
@@ -31,12 +32,12 @@ class Admin::PhotoGalleriesController < Admin::ApplicationController
|
|
31
32
|
|
32
33
|
def update
|
33
34
|
@photo_gallery.update_attributes(photo_gallery_params)
|
34
|
-
flash[:notice] = '
|
35
|
+
flash[:notice] = 'Gallery updated successfully' if @photo_gallery.save
|
35
36
|
respond_with @photo_gallery, :location => admin_photo_galleries_path
|
36
37
|
end
|
37
38
|
|
38
39
|
def destroy
|
39
|
-
flash[:notice] = '
|
40
|
+
flash.now[:notice] = 'Gallery deleted successfully' if @photo_gallery.destroy
|
40
41
|
respond_with @photo_gallery, :location => admin_photo_galleries_path
|
41
42
|
end
|
42
43
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class Admin::PhotosController < Admin::ApplicationController
|
2
2
|
|
3
3
|
include RespondsToParent
|
4
|
+
belongs_to_spud_app :photo_albums
|
4
5
|
|
5
6
|
before_filter :get_photo, :only => [:show, :edit, :update, :destroy]
|
6
7
|
layout false
|
@@ -22,7 +23,17 @@ class Admin::PhotosController < Admin::ApplicationController
|
|
22
23
|
end
|
23
24
|
|
24
25
|
def create
|
25
|
-
|
26
|
+
photo_file = photo_params[:photo]
|
27
|
+
if photo_file.present?
|
28
|
+
fingerprint = Digest::MD5.hexdigest(photo_file.read)
|
29
|
+
photo_file.rewind
|
30
|
+
@photo = SpudPhoto.where(:photo_fingerprint => fingerprint).first
|
31
|
+
end
|
32
|
+
|
33
|
+
if @photo.blank?
|
34
|
+
@photo = SpudPhoto.new(photo_params)
|
35
|
+
end
|
36
|
+
|
26
37
|
if @photo.save
|
27
38
|
success = true
|
28
39
|
flash[:notice] = 'SpudPhoto created successfully'
|
@@ -9,15 +9,15 @@ class PhotoAlbumsController < ApplicationController
|
|
9
9
|
|
10
10
|
def index
|
11
11
|
if @photo_gallery
|
12
|
-
@photo_albums = @photo_gallery.albums.
|
12
|
+
@photo_albums = @photo_gallery.albums.ordered
|
13
13
|
else
|
14
|
-
@photo_albums = SpudPhotoAlbum.
|
14
|
+
@photo_albums = SpudPhotoAlbum.ordered
|
15
15
|
end
|
16
16
|
respond_with @photo_albums
|
17
17
|
end
|
18
18
|
|
19
19
|
def show
|
20
|
-
@photo_album = SpudPhotoAlbum.
|
20
|
+
@photo_album = SpudPhotoAlbum.find_by(:url_name => params[:id])
|
21
21
|
if @photo_album.blank?
|
22
22
|
raise Spud::NotFoundError.new(:item => 'photo album')
|
23
23
|
else
|
@@ -28,7 +28,7 @@ class PhotoAlbumsController < ApplicationController
|
|
28
28
|
private
|
29
29
|
|
30
30
|
def get_gallery
|
31
|
-
@photo_gallery = SpudPhotoGallery.
|
31
|
+
@photo_gallery = SpudPhotoGallery.find_by(:url_name => params[:photo_gallery_id])
|
32
32
|
if @photo_gallery.blank?
|
33
33
|
raise Spud::NotFoundError.new(:item => 'photo gallery')
|
34
34
|
end
|
@@ -9,6 +9,8 @@ class SpudPhotoGallery < ActiveRecord::Base
|
|
9
9
|
validates_uniqueness_of :title, :url_name
|
10
10
|
before_validation :set_url_name
|
11
11
|
|
12
|
+
scope :ordered, ->{ order('created_at desc') }
|
13
|
+
|
12
14
|
def top_photo_url(style)
|
13
15
|
unless albums.empty?
|
14
16
|
return albums.first.top_photo_url(style)
|
@@ -1,10 +1,10 @@
|
|
1
|
-
<div id="
|
1
|
+
<div id="admin-photo-album-<%= album.id %>" class="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
|
-
<div class="
|
7
|
-
<%= link_to '
|
8
|
-
<%= link_to '
|
6
|
+
<div class="admin-photo-ui-thumb-controls">
|
7
|
+
<%= link_to '', edit_admin_photo_album_path(album), :class => 'admin-photos-btn-edit' %>
|
8
|
+
<%= link_to '', admin_photo_album_path(album), :method => :delete, :class => 'admin-photos-btn-delete', :remote => true, :data => {:confirm => 'Are you sure?'} %>
|
9
9
|
</div>
|
10
|
-
</div>
|
10
|
+
</div>
|
@@ -1,36 +1,45 @@
|
|
1
|
-
<%= form_for @photo_album, :url => path, :html => {:class => 'form-horizontal', :id => '
|
2
|
-
|
3
|
-
<%= error_messages_for(f.object) %>
|
1
|
+
<%= form_for @photo_album, :url => path, :builder => TbCore::FormBuilder, :html => {:class => 'form-horizontal', :id => 'admin-photo-album-form'} do |f| %>
|
4
2
|
|
3
|
+
<%= tb_form_errors(f.object) %>
|
4
|
+
|
5
5
|
<fieldset>
|
6
6
|
<legend>Photo Album Info</legend>
|
7
|
-
|
8
|
-
<%= f.label :title, :class => "control-label" %>
|
9
|
-
<div class="controls">
|
10
|
-
<%= f.text_field :title %>
|
11
|
-
</div>
|
12
|
-
</div>
|
7
|
+
<%= f.tb_text_field :title %>
|
13
8
|
</fieldset>
|
14
9
|
|
15
|
-
<fieldset
|
10
|
+
<fieldset>
|
16
11
|
<legend>Selected Photos</legend>
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<h5 id="spud_admin_photo_upload_queue_label">Queued Uploads: <span>0</span></h5>
|
24
|
-
<div id="spud_admin_photo_upload_queue_bars"></div>
|
12
|
+
|
13
|
+
<div class="row">
|
14
|
+
<div class="col-md-12 admin-photo-album-column">
|
15
|
+
<%= link_to "Photo Library", admin_photos_path, :class => "btn btn-sm btn-primary", :id => 'admin-photo-album-action-library' %>
|
16
|
+
<%= link_to "Upload Photo", new_admin_photo_path, :class => "btn btn-sm btn-success", :id => 'admin-photo-album-action-upload' %>
|
17
|
+
</div>
|
25
18
|
</div>
|
26
|
-
|
27
|
-
|
19
|
+
|
20
|
+
<div class="row">
|
21
|
+
<div class="col-md-8 admin-photo-album-column">
|
22
|
+
<div id="admin-photos-selected" class="control-group admin-photo-ui-thumbs admin-photo-ui-thumbs-sortable">
|
23
|
+
<%= render :partial => '/admin/photos/photo', :collection => @photo_album.photos %>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div class="col-md-4 admin-photo-album-column">
|
28
|
+
<div id="admin-photo-upload-queue">
|
29
|
+
<p>Drag and drop photos here to upload</p>
|
30
|
+
<h5 id="admin-photo-upload-queue_label">Queued Uploads: <span>0</span></h5>
|
31
|
+
<div id="admin-photo-upload-queue_bars"></div>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
28
35
|
</div>
|
29
36
|
</fieldset>
|
30
37
|
|
31
|
-
<div class="
|
32
|
-
|
33
|
-
|
38
|
+
<div class="row">
|
39
|
+
<div class="col-md-12 admin-photo-album-column">
|
40
|
+
<%= f.submit "Save Photo Album", :class=>"btn btn-primary" %>
|
41
|
+
<%= link_to "Cancel", request.referer, :class => "btn btn-default" %>
|
42
|
+
</div>
|
34
43
|
</div>
|
35
44
|
|
36
45
|
<% end %>
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
spud.admin.photos.markPhotoAlbumAsDeleted(<%= @photo_album.id %>);
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
<%= content_for :detail do %>
|
6
|
-
<div id="
|
6
|
+
<div id="admin-photo-galleries" class="admin-photo-ui-thumbs">
|
7
7
|
<%= render :partial => 'album', :collection => @photo_albums %>
|
8
8
|
<div>
|
9
9
|
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<div id="admin-photo-album-<%= album.id %>" class="admin-photo-ui-thumb" style="background-image:url('<%= album.top_photo_url(:spud_admin_small) %>')">
|
2
|
+
<h5><%= album.title %></h5>
|
3
|
+
<div style="display:none;">
|
4
|
+
<%= hidden_field_tag 'spud_photo_gallery[album_ids][]', album.id %>
|
5
|
+
</div>
|
6
|
+
<div class="admin-photo-ui-thumb-controls">
|
7
|
+
<%= link_to '', '#', :class => 'admin-photos-btn-delete' %>
|
8
|
+
</div>
|
9
|
+
</div>
|
@@ -1,15 +1,10 @@
|
|
1
|
-
<%= form_for @photo_gallery, :url => path, :html => {:class => 'form-horizontal', :id => '
|
1
|
+
<%= form_for @photo_gallery, :url => path, :builder => TbCore::FormBuilder, :html => {:class => 'form-horizontal', :id => 'admin-photo-gallery-form'} do |f| %>
|
2
2
|
|
3
|
-
<%=
|
3
|
+
<%= tb_form_errors(f.object) %>
|
4
4
|
|
5
5
|
<fieldset>
|
6
6
|
<legend>Gallery Info</legend>
|
7
|
-
|
8
|
-
<%= f.label :title, :class => "control-label" %>
|
9
|
-
<div class="controls">
|
10
|
-
<%= f.text_field :title %>
|
11
|
-
</div>
|
12
|
-
</div>
|
7
|
+
<%= f.tb_text_field :title %>
|
13
8
|
</fieldset>
|
14
9
|
|
15
10
|
<!-- if no albums are selected below, this ensures we send an empty album_ids array -->
|
@@ -17,23 +12,28 @@
|
|
17
12
|
|
18
13
|
<fieldset>
|
19
14
|
<legend>Select Albums</legend>
|
20
|
-
|
21
|
-
|
22
|
-
<div class="
|
23
|
-
|
15
|
+
|
16
|
+
<div class="row">
|
17
|
+
<div class="col-md-8 admin-photo-album-column">
|
18
|
+
<h4>Selected:</h4>
|
19
|
+
<div class="admin-photo-ui-thumbs admin-photo-ui-thumbs-sortable">
|
20
|
+
<%= render :partial => 'album', :collection => @photo_gallery.albums %>
|
21
|
+
</div>
|
24
22
|
</div>
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
<div class="col-md-4 admin-photo-album-column">
|
24
|
+
<h4>Available:</h4>
|
25
|
+
<div class="admin-photo-ui-thumbs admin-photo-ui-thumbs-sortable admin-photo-albums-available">
|
26
|
+
<%= render :partial => 'album', :collection => @photo_gallery.albums_available %>
|
27
|
+
</div>
|
30
28
|
</div>
|
31
29
|
</div>
|
32
30
|
</fieldset>
|
33
31
|
|
34
|
-
<div class="
|
35
|
-
|
36
|
-
|
32
|
+
<div class="row">
|
33
|
+
<div class="col-md-12 admin-photo-album-column">
|
34
|
+
<%= f.submit "Save Photo Gallery", :class => "btn btn-primary" %>
|
35
|
+
<%= link_to "Cancel", request.referer, :class => "btn btn-default" %>
|
36
|
+
</div>
|
37
37
|
</div>
|
38
38
|
|
39
|
-
<% end %>
|
39
|
+
<% end %>
|
@@ -3,15 +3,15 @@
|
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
<%= content_for :detail do %>
|
6
|
-
<div id="
|
6
|
+
<div id="admin-photo-galleries" class="admin-photo-ui-thumbs">
|
7
7
|
<% @photo_galleries.each do |gallery| %>
|
8
|
-
<div id="
|
8
|
+
<div id="admin-photo-gallery-<%= gallery.id %>" class="admin-photo-ui-thumb" style="background-image:url('<%= gallery.top_photo_url(:spud_admin_small) %>')">
|
9
9
|
<h5><%= gallery.title %></h5>
|
10
|
-
<div class="
|
11
|
-
<%= link_to '
|
12
|
-
<%= link_to '
|
10
|
+
<div class="admin-photo-ui-thumb-controls">
|
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', :remote => true, :data => {:confirm => 'Are you sure?'} %>
|
13
13
|
</div>
|
14
14
|
</div>
|
15
15
|
<% end %>
|
16
16
|
<div>
|
17
|
-
<% end %>
|
17
|
+
<% end %>
|
@@ -1,41 +1,24 @@
|
|
1
|
-
<%= form_for @photo, :url => (@photo.new_record? ? admin_photos_path : admin_photo_path(@photo)), :html => {:id => '
|
1
|
+
<%= form_for @photo, :url => (@photo.new_record? ? admin_photos_path : admin_photo_path(@photo)), :builder => TbCore::FormBuilder, :html => {:id => 'admin-photo-form', :target => 'admin-photo-form_target', :class => 'form-horizontal'} do |f| %>
|
2
2
|
|
3
|
-
<%=
|
3
|
+
<%= tb_form_errors(f.object) %>
|
4
4
|
|
5
5
|
<fieldset>
|
6
6
|
<legend>Photo Info</legend>
|
7
|
-
|
8
|
-
|
9
|
-
<div class="controls">
|
10
|
-
<%= f.text_field :title %>
|
11
|
-
</div>
|
12
|
-
</div>
|
13
|
-
<div class="control-group">
|
14
|
-
<%= f.label :caption, :class => "control-label" %>
|
15
|
-
<div class="controls">
|
16
|
-
<%= f.text_field :caption %>
|
17
|
-
</div>
|
18
|
-
</div>
|
7
|
+
<%= f.tb_text_field :title %>
|
8
|
+
<%= f.tb_text_field :caption %>
|
19
9
|
</fieldset>
|
20
10
|
|
21
11
|
<fieldset>
|
22
12
|
<legend id="fileUploadSizeLegend">File Upload</span></legend>
|
23
|
-
<
|
24
|
-
|
25
|
-
<div class="controls">
|
26
|
-
<%= f.file_field :photo %>
|
27
|
-
</div>
|
28
|
-
</div>
|
13
|
+
<span class="help-block admin-photo-form-max-size"></span>
|
14
|
+
<%= f.tb_file_field :photo %>
|
29
15
|
<% unless @photo.new_record? %>
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
<%= image_tag @photo.photo.url(:spud_admin_medium), :class => 'admin-photo-form-current-photo' %>
|
34
|
-
</div>
|
35
|
-
</div>
|
16
|
+
<%= f.tb_input_field 'Current Photo' do %>
|
17
|
+
<%= image_tag @photo.photo.url(:spud_admin_medium), :class => 'admin-photo-form-current-photo' %>
|
18
|
+
<% end %>
|
36
19
|
<% end %>
|
37
20
|
</fieldset>
|
38
21
|
|
39
|
-
<iframe id="
|
22
|
+
<iframe id="admin-photo-form_target" name="admin-photo-form_target" style="display:none;"></iframe>
|
40
23
|
|
41
|
-
<% end %>
|
24
|
+
<% end %>
|
@@ -1,13 +1,13 @@
|
|
1
1
|
<%= content_tag :div,
|
2
2
|
:rel => photo.id,
|
3
|
-
:id => "
|
3
|
+
:id => "admin-photo-#{photo.id}",
|
4
4
|
:style => "background-image:url('#{photo.photo.url(:spud_admin_small)}')",
|
5
|
-
:class => "
|
5
|
+
:class => "admin-photo-ui-thumb admin-photo-ui-thumb-small admin-photo" do %>
|
6
6
|
<div style="display:none;">
|
7
7
|
<%= hidden_field_tag 'spud_photo_album[photo_ids][]', photo.id %>
|
8
8
|
</div>
|
9
|
-
<div class="
|
10
|
-
<%= link_to '
|
11
|
-
<%= link_to '
|
9
|
+
<div class="admin-photo-ui-thumb-controls">
|
10
|
+
<%= link_to '', edit_admin_photo_path(photo), :class => 'admin-photos-btn-edit' %>
|
11
|
+
<%= link_to '', '#', :class => 'admin-photos-btn-remove' %>
|
12
12
|
</div>
|
13
|
-
<% end %>
|
13
|
+
<% end %>
|
@@ -11,9 +11,9 @@
|
|
11
11
|
<% end %>
|
12
12
|
|
13
13
|
<% cache([@photo_gallery, @photo_albums]) do %>
|
14
|
-
<div
|
14
|
+
<div class="photo-albums">
|
15
15
|
<% @photo_albums.each do |album| %>
|
16
|
-
<div class="
|
16
|
+
<div class="photo-album-thumbnail">
|
17
17
|
<h3>
|
18
18
|
<%= link_to album.title, (@photo_gallery ? photo_gallery_photo_album_path(@photo_gallery.url_name, album.url_name) : photo_album_path(album.url_name)) %>
|
19
19
|
</h3>
|
@@ -13,9 +13,9 @@
|
|
13
13
|
<p><%= link_to 'Back to Albums', photo_albums_path %>
|
14
14
|
<% end %>
|
15
15
|
|
16
|
-
<div
|
16
|
+
<div class="photo-galleries">
|
17
17
|
<% @photo_album.photos.each do |photo| %>
|
18
|
-
<div class="
|
18
|
+
<div class="photo-album-thumbnail">
|
19
19
|
<%= link_to image_tag(photo.photo.url(:small), :alt => photo.caption, :title => photo.title), photo.photo.url(:large) %>
|
20
20
|
</div>
|
21
21
|
<% end %>
|
@@ -7,10 +7,10 @@
|
|
7
7
|
<h2>Photo Galleries</h2>
|
8
8
|
|
9
9
|
<% cache(@photo_galleries) do %>
|
10
|
-
<div
|
10
|
+
<div class="photo-galleries">
|
11
11
|
<% @photo_galleries.each do |gallery| %>
|
12
12
|
<% cache(gallery) do %>
|
13
|
-
<div class="
|
13
|
+
<div class="photo-gallery-thumbnail">
|
14
14
|
<h3><%= link_to gallery.title, photo_gallery_photo_albums_path(gallery.url_name) %></h3>
|
15
15
|
<%= image_tag gallery.top_photo_url(:medium), :title => gallery.title %>
|
16
16
|
</div>
|