gallery fixed bugs including tags and tags while uploading.

This commit is contained in:
Harry Bomrah 2013-11-27 16:04:44 +08:00 committed by Manson Wang
parent 995a1ff5db
commit 9509bdd55f
4 changed files with 7 additions and 2 deletions

View File

@ -6,7 +6,7 @@
"type": "sftp",
"save_before_upload": true,
"upload_on_save": true,
"upload_on_save": false,
"sync_down_on_open": false,
"sync_skip_deletes": false,
"confirm_downloads": false,

View File

@ -241,6 +241,10 @@ $(function() {
var fetchNewImages = function(){
var lastid = ( $("li.rgalbum:last").length ? $("li.rgalbum:last").data("image-id") : null),
albumid = $("#fileupload_aid").val();
$.getJSON(window.location.pathname, function(json, textStatus) {
photosData = json;
});
$.ajax({
url : "/panel/gallery/back_end/new_images",

View File

@ -54,7 +54,7 @@ class Panel::Gallery::BackEnd::AlbumImagesController < OrbitBackendController
def image_tagging
images = params[:image_ids]
tags = params[:tag_ids]
tags = params[:tag_ids] || []
i = nil
images.each do |image|
img = AlbumImage.find(image)

View File

@ -156,6 +156,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
@files.each do |file|
@image = @album.album_images.new
@image.file = file
@image.tagged_ids = @album.tag_ids
@image.save!
a << {"thumbnail_url"=>@image.file.thumb.url,"url"=>panel_gallery_back_end_album_image_path(@image)}
end