gallery fixed bugs including tags and tags while uploading.
This commit is contained in:
parent
995a1ff5db
commit
9509bdd55f
|
@ -6,7 +6,7 @@
|
||||||
"type": "sftp",
|
"type": "sftp",
|
||||||
|
|
||||||
"save_before_upload": true,
|
"save_before_upload": true,
|
||||||
"upload_on_save": true,
|
"upload_on_save": false,
|
||||||
"sync_down_on_open": false,
|
"sync_down_on_open": false,
|
||||||
"sync_skip_deletes": false,
|
"sync_skip_deletes": false,
|
||||||
"confirm_downloads": false,
|
"confirm_downloads": false,
|
||||||
|
|
|
@ -242,6 +242,10 @@ $(function() {
|
||||||
var lastid = ( $("li.rgalbum:last").length ? $("li.rgalbum:last").data("image-id") : null),
|
var lastid = ( $("li.rgalbum:last").length ? $("li.rgalbum:last").data("image-id") : null),
|
||||||
albumid = $("#fileupload_aid").val();
|
albumid = $("#fileupload_aid").val();
|
||||||
|
|
||||||
|
$.getJSON(window.location.pathname, function(json, textStatus) {
|
||||||
|
photosData = json;
|
||||||
|
});
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : "/panel/gallery/back_end/new_images",
|
url : "/panel/gallery/back_end/new_images",
|
||||||
data : {"last_image_id" : lastid, "album_id" : albumid},
|
data : {"last_image_id" : lastid, "album_id" : albumid},
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Panel::Gallery::BackEnd::AlbumImagesController < OrbitBackendController
|
||||||
|
|
||||||
def image_tagging
|
def image_tagging
|
||||||
images = params[:image_ids]
|
images = params[:image_ids]
|
||||||
tags = params[:tag_ids]
|
tags = params[:tag_ids] || []
|
||||||
i = nil
|
i = nil
|
||||||
images.each do |image|
|
images.each do |image|
|
||||||
img = AlbumImage.find(image)
|
img = AlbumImage.find(image)
|
||||||
|
|
|
@ -156,6 +156,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||||
@files.each do |file|
|
@files.each do |file|
|
||||||
@image = @album.album_images.new
|
@image = @album.album_images.new
|
||||||
@image.file = file
|
@image.file = file
|
||||||
|
@image.tagged_ids = @album.tag_ids
|
||||||
@image.save!
|
@image.save!
|
||||||
a << {"thumbnail_url"=>@image.file.thumb.url,"url"=>panel_gallery_back_end_album_image_path(@image)}
|
a << {"thumbnail_url"=>@image.file.thumb.url,"url"=>panel_gallery_back_end_album_image_path(@image)}
|
||||||
end
|
end
|
||||||
|
|
Reference in New Issue