diff --git a/app/assets/stylesheets/plume_print.css.scss b/app/assets/stylesheets/plume_print.css.scss index f4ba097..de75020 100644 --- a/app/assets/stylesheets/plume_print.css.scss +++ b/app/assets/stylesheets/plume_print.css.scss @@ -4,9 +4,62 @@ $vert:#7BAE53; $beige:#F1F0EE; @import "qi_css/grid"; +#couv{ + height:770px; + background:center center no-repeat; + background-size:cover; + +} + +#bottom{ + position:absolute; + bottom:0; + right:0; + left:0; + background:$grey; + .desc{ + position:absolute; + right:0; + bottom:0; + left:230px; + height:136px; + color:white; + p{ + font-size:18px; + font-weight:bold; + margin-bottom:5px; + } + } + #logo{ + background:white; + width:160px; + padding:8px 20px; + img{ + height:120px; + display:block; + margin:auto; + + } + } +} + +.page_inner{ + padding:25px 50px; + font-size:14px; + h1{ + + text-transform:uppercase; + color:$vert; + margin-top:10px; + margin-bottom:0px; + padding:0; + font-size:25px; + + } +} body{ - + -webkit-text-size-adjust: none; font-weight:bold; height:100%; width:102%; @@ -32,8 +85,8 @@ html{ .page{ display: block; clear: both; - width:786px; - + width:788px; + position:relative; min-height: 295mm; page-break-after: always; @@ -91,6 +144,7 @@ html{ .hr{ margin:8px 0; height:20px; + margin-bottom:0; background:$grey; } } @@ -158,7 +212,7 @@ html{ } .render_block{ padding:10px 0; - + padding-top:0; } diff --git a/app/controllers/public/plumes_controller.rb b/app/controllers/public/plumes_controller.rb index 61fb078..b0152b1 100644 --- a/app/controllers/public/plumes_controller.rb +++ b/app/controllers/public/plumes_controller.rb @@ -43,14 +43,19 @@ class Public::PlumesController < ApplicationController @plume = Plume.find(params[:id]) respond_to do |format| - format.html + format.html do + render :layout => false + end format.pdf do render pdf: 'file_name', disposition: 'inline', # default 'inline' layout: false, - page_size: 'A4', - viewport_size: '800x600', + #page_size: 'A4', + zoom: 1, page_width: 210, + page_height:297, + viewport_size: '800x600', + template: "public/plumes/print.html.haml" , margin: { top: 0, # default 10 (mm) bottom: 0, diff --git a/app/views/admin/plume_articles/_plume_article.html.haml b/app/views/admin/plume_articles/_plume_article.html.haml index 489c252..fef0ffb 100644 --- a/app/views/admin/plume_articles/_plume_article.html.haml +++ b/app/views/admin/plume_articles/_plume_article.html.haml @@ -2,6 +2,10 @@ %td=plume_article.title + %td + =link_to "voir", public_plume_article_path(plume_article), :target => "plume_article_#{plume_article.id}" + + diff --git a/app/views/admin/plume_articles/edit.html.haml b/app/views/admin/plume_articles/edit.html.haml index 76d1923..90af669 100644 --- a/app/views/admin/plume_articles/edit.html.haml +++ b/app/views/admin/plume_articles/edit.html.haml @@ -25,6 +25,11 @@ #menu_item_informations + %p=link_to "Voir l'article", public_plume_article_path(@plume_article), :target => "plume_article_#{@plume_article.id}" + + %p=link_to "Voir la plume", public_plume_path(@plume_article.plume), :target => "plume_#{@plume_article.plume.id}" + %p=link_to "Voir la plume (pdf)", print_public_plume_path(@plume_article.plume, :format => "pdf"), :target => "plume_pdf_#{@plume_article.plume.id}" + %h4 Infos sur l'article diff --git a/app/views/admin/plume_events/_show.html.haml b/app/views/admin/plume_events/_show.html.haml index 790f925..bc7a188 100644 --- a/app/views/admin/plume_events/_show.html.haml +++ b/app/views/admin/plume_events/_show.html.haml @@ -1,6 +1,6 @@ #plume_event_show %h1 =@plume_event.title - %em=plume_event_human_date(@plume_event) + %em=event_human_date(@plume_event) .desc=simple_format @plume_event.description \ No newline at end of file diff --git a/app/views/admin/plumes/_plume.html.haml b/app/views/admin/plumes/_plume.html.haml index 85c6935..c6c02b2 100644 --- a/app/views/admin/plumes/_plume.html.haml +++ b/app/views/admin/plumes/_plume.html.haml @@ -2,7 +2,7 @@ %td=plume.title %td - =link_to "voir", public_plume_path(plume) + =link_to "voir", public_plume_path(plume), :target => "plume_#{plume.id}" @@ -10,5 +10,5 @@ = link_to i(:"trash-o"), [:admin, plume], :confirm => 'Voulez-vous vraiment supprimer cet plume ?', :method => :delete, :remote => true = link_to i(:pencil), edit_admin_plume_path(plume), :style => "padding:0px 0px 0px 0px;", :remote => true - = link_to i(:eye), edit_admin_plume_path(plume), :style => "padding:0px 0px 0px 0px;" + = link_to i(:plus), edit_admin_plume_path(plume), :style => "padding:0px 0px 0px 0px;" \ No newline at end of file diff --git a/app/views/public/plumes/print.html.haml b/app/views/public/plumes/print.html.haml index 545152f..7762492 100644 --- a/app/views/public/plumes/print.html.haml +++ b/app/views/public/plumes/print.html.haml @@ -1,4 +1,3 @@ -!!! %html %head %meta{:charset => "utf-8"}/ @@ -16,6 +15,24 @@ .hr + #couv{:style => "background-image:url('http://lepicvert.org/#{(@plume.image_file.file.url if @plume.image_file)}');"} + + #bottom + #logo + =image_tag("http://lepicvert.org/logo.png") + .desc + %p + ="N°#{@plume.number} - " + =@plume.p_version + + Association pour la protection de la nature + %br + + Membre de la FRAPNA Isère + %br + 24 place de la Mairie - 38140 Reaumont + %br + 04 76 91 34 33 - contact@lepicvert.asso.fr - www.lepicvert.org .page -i = 0 @@ -37,10 +54,11 @@ -i = 0 =raw "
" - %h1=plume_article.title + .page_inner + %h1=plume_article.title - .render_block - =render plume_article.block + .render_block + =render plume_article.block -if plume_article.article_type == "page" -i = 0 @@ -50,7 +68,7 @@ -if i == 2 -i = 0 =raw "
" - .page + .page_header .right =image_tag "http://lepicvert.org/plume-header.png" @@ -59,13 +77,14 @@ ="N°#{@plume.number}" .left Agenda .clear - -@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_inner + -@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 .page_header @@ -80,12 +99,12 @@ -@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 + .page_inner + -@breve_cat.plume_articles.each do |plume_article| + .plume_breve + %h2=plume_article.title - .render_block - =render plume_article.block + .render_block + =render plume_article.block - %div{:style => "width:100px;height:100px;background:red;position:absolute;top:0;right:0;"} - \ No newline at end of file + \ No newline at end of file