all of user can get json of gallery from outside

This commit is contained in:
Rueshyna 2012-11-08 01:24:01 +08:00
parent 43d969a72b
commit b4f5a0b04b
2 changed files with 224 additions and 220 deletions

View File

@ -1,8 +1,7 @@
class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
include AdminHelper include AdminHelper
# before_filter :force_order_for_visitor,:only=>[:index] before_filter :force_order_for_user, :except => [:index,:imgs]
before_filter :force_order_for_user#,:except => [:index]
def index def index
if is_manager? || is_admin? || is_sub_manager? if is_manager? || is_admin? || is_sub_manager?
@ -124,7 +123,14 @@ include AdminHelper
values.tag_ids.each do |tag| values.tag_ids.each do |tag|
tags << GalleryTag.find(tag)[I18n.locale] tags << GalleryTag.find(tag)[I18n.locale]
end end
@output << {"_id"=>values.id,"theater_link"=>panel_gallery_back_end_album_image_path(values),"description"=>values.description,"title"=>values.title,"file"=>values.file,"gallery_album_id"=>values.gallery_album_id,"tag_ids"=>values.tag_ids,"tag_names"=>tags} @output << { _id: values.id,
theater_link: panel_gallery_back_end_album_image_path(values),
description: values.description,
title: values.title,
file: values.file,
gallery_album_id: values.gallery_album_id,
tag_ids: values.tag_ids,
tag_names: tags}
end end
if is_manager? || is_admin? || is_sub_manager? if is_manager? || is_admin? || is_sub_manager?
@authenticated = true #turn this value to false for view only @authenticated = true #turn this value to false for view only

View File

@ -16,8 +16,6 @@ Rails.application.routes.draw do
match "album_images/#!/:id" => "album_images#show" match "album_images/#!/:id" => "album_images#show"
resources :album_images resources :album_images
resources :gallery_categories resources :gallery_categories
resources :tags resources :tags