diff --git a/app/uploaders/gallery_uploader.rb b/app/uploaders/gallery_uploader.rb index 773d86d89..8f04cc2fa 100644 --- a/app/uploaders/gallery_uploader.rb +++ b/app/uploaders/gallery_uploader.rb @@ -35,7 +35,7 @@ class GalleryUploader < CarrierWave::Uploader::Base # end version :thumb do - process :resize_to_fit => [120, 90] + process :resize_to_fill => [120, 90] end # Add a white list of extensions which are allowed to be uploaded. diff --git a/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI.js b/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI.js index 0eb8e6d77..37db6b924 100644 --- a/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI.js +++ b/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI.js @@ -15,6 +15,9 @@ var galleryAPI = function(){ }else if(typeof g.urlVars['theater']!= "undefined"){ g.loadTheater(g.urlVars['theater']); g.loadArea = "theater"; + }else if(typeof g.urlVars['edit']!= "undefined"){ + g.editAlbum(g.urlVars['edit']); + g.loadArea = "edit"; }else{ g.loadAlbums("all"); g.loadArea = "albums"; @@ -97,6 +100,14 @@ var galleryAPI = function(){ }) } + this.deleteAlbum = function(id){ + if(confirm("Delete this Album?")){ + $.post("delete_album",{aid:id},function(){ + window.location = "orbit_gallery"; + }) + } + } + this.loadAlbums = function(id){ var headbtn = $('Add Album'); headbtn.click(function(){g.makeNewAlbum();}) @@ -106,7 +117,10 @@ var galleryAPI = function(){ $addsign.find("a").click(function(){g.makeNewAlbum();}) $.getJSON("get_albums",{cid:id},function(albums){ $.each(albums,function(i,album){ - var $img = $("
"); + if(album.cover == "default") + var $img = $(""); + else + var $img = $(""); g.albumArea.find("#imgholder").append($img); }) g.albumArea.find("#imgholder").append($addsign); @@ -115,13 +129,20 @@ var galleryAPI = function(){ this.loadImages = function(id){ //