few updates with fb integration and some other changes in user and supports data to android

Conflicts:
	vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb
This commit is contained in:
harrybomrah authored and saurabhbhatia committed 2013-07-30 16:43:11 +08:00
1 parent ac58b993c2
commit 5f9190db39
14 files changed
+258 -278

No files matched your search

@@ -20,6 +20,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
@c = []
@ac = @c.inject(@categories,:<<)
@album_category = @albums.map { |a| @categories.include?(a.category_id) }
end
def show
@@ -45,6 +46,8 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
redirect_to panel_gallery_back_end_albums_path
end
def destroy
album = GalleryAlbum.find(params[:id])
album.destroy
@@ -58,7 +61,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
@images = @album.gallery_images.all
@album_name = @album.name_translations
@cover = @album.cover
@tags = get_tags
@tags = GalleryTag.all
end
end
@@ -74,13 +77,21 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
output = Array.new
albums.each do |album|
tag_names = Tag.find(album.tagged_ids).map{|t| t.name}
tag_names = Array.new
album.tag_ids.each do |tag|
tag_names << GalleryTag.find(tag)[I18n.locale]
end
if album.cover_path
cover_path = album.cover_path
else
cover_path = "/assets/gallery/default.jpg"
end
output << {
album_cover_file: "http://#{request.host_with_port}#{album.cover_path}",
album_cover_file: "http://#{request.host_with_port}"+cover_path,
album_name: album.name,
album_tag_names: tag_names,
album_link:"http://#{request.host_with_port}#{panel_gallery_back_end_album_get_imgs_json_path(album)}"
album_link:"http://#{request.host_with_port}#{panel_gallery_back_end_album_get_imgs_json_path(album)}",
}
end
@@ -93,7 +104,11 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
output = Array.new
images.each do |image|
tags = Tag.find(image.tagged_ids).map{|t| t.name}
tags = Array.new
image.tag_ids.each do |tag|
tags << GalleryTag.find(tag)[I18n.locale]
end
output << {
image_title: image.title,
@@ -112,7 +127,10 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
@images = @album.gallery_images.all
@output = Array.new
@images.each do |values|
tags = Tag.find(values.tagged_ids).map{|t| t.name}
tags = Array.new
values.tag_ids.each do |tag|
tags << GalleryTag.find(tag)[I18n.locale]
end
@output << { _id: values.id,
theater_link: panel_gallery_back_end_album_image_path(values),
description: values.description,
@@ -130,8 +148,8 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
if @authenticated
render :json=>{"images" => @output, "tags" => @album.tag_ids}.to_json
else
@album.tagged_ids.each do |tag|
@tag_names << Tag.find(tag).name
@album.tag_ids.each do |tag|
@tag_names << GalleryTag.find(tag)[I18n.locale]
end
render :json=>{"images" => @output, "tags" => @album.tag_ids, "tag_names" => @tag_names}.to_json
end
@@ -181,7 +199,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
if params['delete_cover'] == "true"
@album.update_attributes(:cover=>"default")
end
@tags = get_tags
@tags = GalleryTag.all
render :action => :show
end
end
+1
View File
@@ -4,6 +4,7 @@ Rails.application.routes.draw do
namespace :gallery do
namespace :back_end do
match "get_albums" => "albums#get_albums"
match "upload_image" => "albums#upload_image"
match "save_tags" => "tags#save_tags"
match "albums/save_tags" => "tags#save_tags"
@@ -2,7 +2,7 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
include AdminHelper
before_filter :force_order_for_visitor,:only => [:index, :new, :edit, :create, :update, :delete]
before_filter :force_order_for_user,:except => [:get_locations,:index]
before_filter :force_order_for_user,:except => [:get_locations,:index,:get_categories]
def index
@location_infos = LocationInfo.all
@@ -74,6 +74,14 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
description: location.description }
end
render :json => JSON.pretty_generate({location: @data})
render :json => JSON.pretty_generate(@data)
end
def get_categories
@data = Array.new
@data << { name: "Department",
link: "http://#{request.host_with_port}"+"/panel/location/back_end/locations/get_locations?locale=en" }
render :json => JSON.pretty_generate(@data)
end
end
@@ -74,4 +74,11 @@ class Panel::Locations::BackEnd::LocationsController < OrbitBackendController
#render :json => {location: @data}.to_json
end
def get_categories
@data = Array.new
@data << { name: "Department",
link: "http://#{request.host_with_port}"+"/panel/location/back_end/location/get_locations" }
render :json => JSON.pretty_generate(@data)
end
end
+1
View File
@@ -4,6 +4,7 @@ Rails.application.routes.draw do
namespace :back_end do
match "locations/get_locations" => "locations#get_locations"
match "locations/get_categories" => "locations#get_categories"
resources :locations
end