gallery fixes

This commit is contained in:
Andreas Stephanides
2015-02-28 15:02:22 +01:00
parent f07925701d
commit 62b6f8ca88
3 changed files with 8 additions and 7 deletions

View File

@@ -20,9 +20,9 @@ class FotosController < ApplicationController
@openfotoid=@foto.id
@pppage=params[:pppage].to_i % 4
@pppage_array = [ 25 , 50 , 100, 10000]
@page = params[:page].nil? ? 1 : params[:page].to_i
@fotos_p = @gallery.fotos.page(@page).per(@pppage_array[@pppage])
@page = params[:page].nil? ? 1 : params[:page].to_i
@fotos_p = @gallery.fotos.page(@page).per(@pppage_array[@pppage])
@fotos_n = @gallery.fotos- @fotos_p
respond_to do |format|
format.html {

View File

@@ -19,7 +19,7 @@ class GalleriesController < ApplicationController
def show
@gallery = Gallery.find(params[:id])
@pppage_array = [ 25 , 50 , 100, "all"] #defines number & size of picture chunks
@pppage_array = [ 25 , 50 , 100, 10000] #defines number & size of picture chunks
@pppage = 0 #starting index of pppage_array
if !params[:pppage].nil? && params[:pppage].to_i <= 3 && params[:pppage].to_i >= 0