foto gallery - schema.org und download button

This commit is contained in:
Andreas Stephanides
2015-02-24 13:46:43 +01:00
parent 742962255b
commit 67d0d19bd7
5 changed files with 78 additions and 37 deletions

View File

@@ -1,5 +1,6 @@
class FotosController < ApplicationController
before_filter {@toolbar_elements=[]}
load_and_authorize_resource
# GET /fotos
# GET /fotos.json
def index
@@ -17,7 +18,13 @@ class FotosController < ApplicationController
@foto = Foto.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.html {
if params[:plain]
render "show", layout: false
else
redirect_to gallery_path(@foto.gallery,:params=>{fotoid: @foto.id})
end
}
format.json { render json: @foto }
end
end

View File

@@ -27,9 +27,18 @@ class GalleriesController < ApplicationController
end
@page = params[:page].nil? ? 1 : params[:page].to_i
# @fotos = Foto.where(:gallery_id => params[:id]).limit(@pppage_array[@pppage]).offset(@pppage_array[@pppage]*(@page-1))
@fotos = Foto.where(:gallery_id => params[:id])
if @fotos.nil? || @fotos.empty?
unless params[:fotoid].nil?
foto_ind = @fotos.find_index(Foto.find(params[:fotoid]))
# @page=(@fotos.count/foto_ind).to_i+1
@openfotoid=params[:fotoid]
else
@openfotoid=0
end
if @fotos.nil? || @fotos.empty?
@fotos_p = []
@fotos_n = []
@pages = 1