Merge branch 'master' into 'master'

add album name for front-end widget

add album name for front-end widget

See merge request !8
This commit is contained in:
EricTYL 2019-11-05 14:56:31 +08:00
commit cb44a8c9af
1 changed files with 59 additions and 57 deletions

View File

@ -17,6 +17,7 @@ class GalleriesController < ApplicationController
tags << tag0
tags << tag1
end
def index
albums = Album.filter_by_categories.filter_by_tags.asc(:order)
galleries = albums.collect do |a|
@ -35,7 +36,6 @@ class GalleriesController < ApplicationController
"extras" => {"widget-title"=>"Gallery"},
"total_pages" => albums.total_pages
}
end
def show
@ -93,7 +93,8 @@ class GalleriesController < ApplicationController
"thumb-large-src" => a.file.thumb_large.url,
"image_description" => a.description,
"mobile-src" => a.file.mobile.url,
"theater-src" => a.file.theater.url
"theater-src" => a.file.theater.url,
"album-name" => a.album.name_translations[I18n.locale]
}
end
{
@ -131,10 +132,11 @@ class GalleriesController < ApplicationController
"image" => image.id.to_s,
"images" => imgs(albumid)
}
render :json => {"data" => data}.to_json
end
private
def show_desc?
tags = OrbitHelper.page_tags if tags.blank?
tags = [tags].flatten.uniq