suite
This commit is contained in:
parent
a76eff9f81
commit
e3fba65975
233
app/assets/stylesheets/plume_print.css.scss
Normal file
233
app/assets/stylesheets/plume_print.css.scss
Normal file
@ -0,0 +1,233 @@
|
|||||||
|
body{
|
||||||
|
|
||||||
|
font-weight:bold;
|
||||||
|
height:100%;
|
||||||
|
width:102%;
|
||||||
|
padding:0;
|
||||||
|
margin:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
html{
|
||||||
|
height:100%;
|
||||||
|
width:100%;
|
||||||
|
padding:0;
|
||||||
|
margin:0
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.page{
|
||||||
|
display: block;
|
||||||
|
clear: both;
|
||||||
|
|
||||||
|
width: 210mm;
|
||||||
|
min-height: 297mm;
|
||||||
|
page-break-after: always;
|
||||||
|
background:#9A9289;
|
||||||
|
//position:relative;
|
||||||
|
|
||||||
|
}
|
||||||
|
$grey:#61676A;
|
||||||
|
$marron:#9A9289;
|
||||||
|
$vert:#7BAE53;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#plume_header{
|
||||||
|
.plume_logo_mobile{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
text-align:center;
|
||||||
|
img{
|
||||||
|
display:block;
|
||||||
|
margin:auto;
|
||||||
|
width:600px;
|
||||||
|
max-width:100%;
|
||||||
|
padding-top:15px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.baseline{
|
||||||
|
font-size:14px;
|
||||||
|
font-weight:normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hr{
|
||||||
|
margin:8px 0;
|
||||||
|
height:20px;
|
||||||
|
background:$grey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.sommaire{
|
||||||
|
float:left;
|
||||||
|
width:30%;
|
||||||
|
text-align:left;
|
||||||
|
|
||||||
|
.sommaire_panel{
|
||||||
|
background:$marron;
|
||||||
|
padding:20px;
|
||||||
|
.content{
|
||||||
|
padding:10px 20px;
|
||||||
|
border:dashed 1px white;
|
||||||
|
h2{
|
||||||
|
font-weight:bold;
|
||||||
|
color:white;
|
||||||
|
font-size:40px;
|
||||||
|
text-align:center;
|
||||||
|
text-transform:uppercase;
|
||||||
|
margin-top:0;
|
||||||
|
padding-top:0;
|
||||||
|
}
|
||||||
|
h3{
|
||||||
|
text-transform:uppercase;
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
margin-top:10px;
|
||||||
|
font-weight:bold;
|
||||||
|
color:white;
|
||||||
|
}
|
||||||
|
|
||||||
|
a{
|
||||||
|
display:block;
|
||||||
|
color:black;
|
||||||
|
font-size:18px;
|
||||||
|
&:hover{
|
||||||
|
text-decoration:none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.plume-article_header{
|
||||||
|
.plume_cat{
|
||||||
|
text-transform:uppercase;
|
||||||
|
color:$vert;
|
||||||
|
font-size:25px;
|
||||||
|
margin-top:15px;
|
||||||
|
font-weight:bold;
|
||||||
|
margin-bottom:20px;
|
||||||
|
}
|
||||||
|
h1{
|
||||||
|
font-size:30px;
|
||||||
|
margin:10px 0;
|
||||||
|
font-weight:bold;
|
||||||
|
color:black;
|
||||||
|
text-transform:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.render_block{
|
||||||
|
padding:30px 0;
|
||||||
|
padding-bottom:100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.plume_event{
|
||||||
|
border-bottom:1px dashed $marron;
|
||||||
|
padding: 10px 0;
|
||||||
|
|
||||||
|
h2{
|
||||||
|
color:$vert;
|
||||||
|
font-size:20px;
|
||||||
|
text-transform:none;
|
||||||
|
margin:0;
|
||||||
|
}
|
||||||
|
.date{
|
||||||
|
margin: 5px 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
margin-bottom:10px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.plume_breve{
|
||||||
|
border-bottom:1px dashed $marron;
|
||||||
|
padding: 10px 0;
|
||||||
|
|
||||||
|
h2{
|
||||||
|
color:$vert;
|
||||||
|
font-size:20px;
|
||||||
|
text-transform:none;
|
||||||
|
margin:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
margin-bottom:10px;
|
||||||
|
.render_block{
|
||||||
|
padding-bottom:20px;
|
||||||
|
padding-top:20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.article{
|
||||||
|
|
||||||
|
|
||||||
|
width:50%;
|
||||||
|
float:left;
|
||||||
|
|
||||||
|
&.article_large{
|
||||||
|
float:none;
|
||||||
|
width:auto;
|
||||||
|
margin-top:60px;
|
||||||
|
margin-bottom:100px;
|
||||||
|
.image{
|
||||||
|
width:47%;
|
||||||
|
margin-left:1%;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
.description{
|
||||||
|
margin-left:50%;
|
||||||
|
padding-left:20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.inner{
|
||||||
|
margin:0 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image{
|
||||||
|
height:300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plume_cat{
|
||||||
|
text-transform:uppercase;
|
||||||
|
color:$vert;
|
||||||
|
font-size:30px;
|
||||||
|
margin-top:15px;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
h2{
|
||||||
|
font-size:20px;
|
||||||
|
margin:10px 0;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.plume_bottom{
|
||||||
|
background:$grey;
|
||||||
|
padding:10px 20px;
|
||||||
|
margin-top:20px;
|
||||||
|
.big{
|
||||||
|
font-size:20px;
|
||||||
|
}
|
||||||
|
p{
|
||||||
|
margin:5px 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
*{
|
||||||
|
color:white;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.fill_img{
|
||||||
|
background:center center no-repeat;
|
||||||
|
background-size:100%;
|
||||||
|
background-size:cover;
|
||||||
|
}
|
@ -37,6 +37,31 @@ class Public::PlumesController < ApplicationController
|
|||||||
def breves
|
def breves
|
||||||
@plume = Plume.find(params[:id])
|
@plume = Plume.find(params[:id])
|
||||||
end
|
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',
|
||||||
|
dpi: 300,
|
||||||
|
template: "public/plumes/print.html.haml" ,
|
||||||
|
margin: { top: 0, # default 10 (mm)
|
||||||
|
bottom: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0 }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
66
app/views/public/plumes/print.html.haml
Normal file
66
app/views/public/plumes/print.html.haml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
!!!
|
||||||
|
%html
|
||||||
|
%head
|
||||||
|
%meta{:charset => "utf-8"}/
|
||||||
|
= wicked_pdf_stylesheet_link_tag "pdf"
|
||||||
|
= wicked_pdf_javascript_include_tag "number_pages"
|
||||||
|
= wicked_pdf_stylesheet_link_tag 'plume_print'
|
||||||
|
%body{:onload => "number_pages"}
|
||||||
|
.page
|
||||||
|
#plume_header
|
||||||
|
=image_tag "http://lepicvert.org/plume-logo.png", :class => "plume_logo"
|
||||||
|
|
||||||
|
.baseline
|
||||||
|
Bulletin indépendant des lobbies, d’un électorat, consacré à l’intérêt général et super intéressant !
|
||||||
|
|
||||||
|
.hr
|
||||||
|
|
||||||
|
|
||||||
|
.page
|
||||||
|
-i = 0
|
||||||
|
-@plume.plume_cats.order(:position).each do |plume_cat|
|
||||||
|
-if plume_cat.title != "Brèves"
|
||||||
|
-plume_cat.plume_articles.each do |plume_article|
|
||||||
|
=debug plume_article.article_type
|
||||||
|
=debug i
|
||||||
|
-if plume_article.article_type == "page" and i == 1
|
||||||
|
-i = 0
|
||||||
|
=raw "</div><div class='page'>"
|
||||||
|
|
||||||
|
-if plume_article.plume_cat
|
||||||
|
.plume_cat= plume_article.plume_cat.title
|
||||||
|
%h1=plume_article.title
|
||||||
|
|
||||||
|
.render_block
|
||||||
|
=render plume_article.block
|
||||||
|
|
||||||
|
-if plume_article.article_type == "page"
|
||||||
|
-i = 0
|
||||||
|
=raw "</div><div class='page'>"
|
||||||
|
-else
|
||||||
|
-i += 1
|
||||||
|
-if i == 2
|
||||||
|
-i = 0
|
||||||
|
=raw "</div><div class='page'>"
|
||||||
|
.page
|
||||||
|
-@plume.plume_events.each do |plume_event|
|
||||||
|
.plume_event
|
||||||
|
%h2=plume_event.title
|
||||||
|
.date
|
||||||
|
=raw event_human_date(plume_event)
|
||||||
|
.desc
|
||||||
|
=plume_event.description
|
||||||
|
|
||||||
|
.page
|
||||||
|
-@breve_cat = @plume.plume_cats.where(:title => "Brèves").first
|
||||||
|
-if @breve_cat
|
||||||
|
|
||||||
|
-@breve_cat.plume_articles.each do |plume_article|
|
||||||
|
.plume_breve
|
||||||
|
%h2=plume_article.title
|
||||||
|
|
||||||
|
.render_block
|
||||||
|
=render plume_article.block
|
||||||
|
|
||||||
|
%div{:style => "width:100px;height:100px;background:red;position:fixed;top:0;right:0;"}
|
||||||
|
|
@ -2,6 +2,7 @@
|
|||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
|
|
||||||
Mime::Type.register "application/xls", :xls
|
Mime::Type.register "application/xls", :xls
|
||||||
|
Mime::Type.register "application/pdf", :pdf
|
||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
# Add new mime types for use in respond_to blocks:
|
# Add new mime types for use in respond_to blocks:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user