67 lines
1.3 KiB
Ruby
67 lines
1.3 KiB
Ruby
# -*- encoding : utf-8 -*-
|
|
|
|
class Public::PlumesController < ApplicationController
|
|
|
|
layout "plume"
|
|
|
|
|
|
|
|
def index
|
|
|
|
@plumes = Plume.all
|
|
|
|
@index_title = "La plume du Pic Vert"
|
|
end
|
|
|
|
|
|
|
|
|
|
def show
|
|
@plume = Plume.find(params[:id])
|
|
|
|
if @plume and (@plume.enabled or current_admin)
|
|
|
|
@title = @plume.title
|
|
|
|
|
|
else
|
|
redirect_to "/", :notice => "La page que vous demandez n'a pas pu être trouvée.<br /><br />Vous avez donc été redirigé sur notre page d'accueil"
|
|
|
|
end
|
|
end
|
|
|
|
def agenda
|
|
@plume = Plume.find(params[:id])
|
|
end
|
|
|
|
def breves
|
|
@plume = Plume.find(params[:id])
|
|
end
|
|
|
|
def print
|
|
|
|
@plume = Plume.find(params[:id])
|
|
|
|
respond_to do |format|
|
|
format.html
|
|
format.pdf do
|
|
render pdf: 'file_name',
|
|
disposition: 'inline', # default 'inline'
|
|
layout: false,
|
|
page_size: 'A4',
|
|
template: "public/plumes/print.html.haml" ,
|
|
margin: { top: 0, # default 10 (mm)
|
|
bottom: 0,
|
|
left: 0,
|
|
right: 0 }
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|