Compare commits

..

2 Commits

Author SHA1 Message Date
Nicolas Bally
94ae0f4e7e suite 2018-05-28 17:47:46 +02:00
Nicolas Bally
db35804629 suite 2018-05-28 17:05:28 +02:00
11 changed files with 183 additions and 16 deletions

View File

@ -6,10 +6,34 @@ $beige:#F1F0EE;
@import "qi_css/grid";
img{
opacity:1;
position:relative;
z-index:100;
}
#mentions{
background:$beige;
color:$marron;
position:absolute;
bottom:0;
left:0;
right:0;
padding:15px 30px;
margin-top:10px;
padding-bottom:25px;
.legals{
text-style:italic;
font-size:0.9em;
}
font-size:0.9em;
p{margin-top:0;
margin-bottom:4px;}
}
#couv{
height:685px;
@ -162,6 +186,7 @@ html{
display: block;
clear: both;
width:788px;
margin:auto;
position:relative;
min-height: 295mm;
page-break-after: always;
@ -228,28 +253,32 @@ html{
.sommaire{
float:left;
width:30%;
width:295px;
text-align:left;
margin-left:40px;
.sommaire_panel{
background:$marron;
padding:20px;
padding:10px;
.content{
padding:10px 20px;
padding:8px 16px;
border:dashed 1px white;
h2{
font-weight:bold;
color:white;
font-size:40px;
font-size:28px;
margin-bottom:10px;
text-align:center;
text-transform:uppercase;
margin-top:0;
padding-top:0;
padding-top:5px;
}
h3{
text-transform:uppercase;
margin:0;
padding:0;
font-size:18px;
margin-top:10px;
font-weight:bold;
color:white;
@ -258,7 +287,7 @@ html{
a{
display:block;
color:black;
font-size:18px;
font-size:15px;
&:hover{
text-decoration:none;
}
@ -405,3 +434,14 @@ h1,h2,h3,h4{
}
#edito_place{
padding-top:20px;
margin-left:305px;
.left{
text-transform:uppercase;
font-size:25px;
color:$marron;
font-weight:bold;
}
}

View File

@ -195,6 +195,7 @@ $vert:#7BAE53;
font-size:30px;
margin-top:15px;
font-weight:bold;
line-height:1em;
}
h2{
font-size:20px;
@ -235,3 +236,16 @@ $vert:#7BAE53;
background-size:100%;
background-size:cover;
}
.plume_right_buttons{
margin-top:50px;
text-align:right;
.btn{
background:$vert;
color:white;
font-weight:bold;
padding:10px 20px;
text-transform:uppercase;
border-radius:0;
}
}

View File

@ -53,8 +53,13 @@ class Public::PlumesController < ApplicationController
layout: false,
#page_size: 'A4',
zoom: 1,
#page_width: 300,
#page_height:320,
page_width: 210,
page_height:297,
viewport_size: '800x600',
template: "public/plumes/print.html.haml" ,

View File

@ -1,6 +1,11 @@
class Plume < ActiveRecord::Base
belongs_to :image_file
belongs_to :data_file
belongs_to :couv_image_file, :class_name => "ImageFile"
has_many :plume_cats
has_many :plume_articles, :through => :plume_cats

View File

@ -8,9 +8,40 @@
= form.input :number, :label => "Numéro plume :"
= form.input :p_version, :label => "Ligne 'version' :"
= form.input :image_file_id, :as => :qi_image_select
= form.input :credits, :label => "Crédit photo couverture :"
= form.input :redaction_credits, :label => "Crédits rédac & relecture :"
%hr
%p
%strong
Infos PDF
= form.input :couv_image_file_id, :as => :qi_image_select
%p
%table.form_table
%tr
%td{:style => "vertical-align:top;padding-right:10px;"}
-r = rand(1000000000000000000000000000)
%strong Fichier associé :
%td
#name{:id => r}
-if form.object.data_file
=form.object.data_file.abstract_file_name if form.object.data_file
=link_to "Supprimer", "#", :onclick => "$('#input_"+r.to_s+"').val('');$('#name_"+r.to_s+"').html('');return false;"
=form.hidden_field :data_file_id, :id => "input_"+r.to_s
=link_to "Modifier ce fichier", "#", :onclick => "select_file_from_manager('"+r.to_s+"');return false;"
%hr

View File

@ -10,8 +10,10 @@
-plume_cat.plume_articles.each do |plume_article|
=link_to plume_article.title, public_plume_article_path(plume_article)
=link_to agenda_public_plume_path(@plume) do
%h3 Agenda
=link_to breves_public_plume_path(@plume) do
%h3 Brèves
=link_to agenda_public_plume_path(@plume) do
%h3 Agenda

View File

@ -13,12 +13,17 @@
-@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
-@breve_cat.plume_articles.order(:position).each do |plume_article|
-if !plume_article.breakpage
.plume_breve
%h2=plume_article.title
.render_block
=render plume_article.block
.render_block
=render plume_article.block
-if plume_article.author?
.author
=plume_article.author
.clear

View File

@ -56,10 +56,62 @@
%br
04 76 91 34 33 - contact@lepicvert.asso.fr - www.lepicvert.org
.page
-plume_article = @plume.plume_articles.where(:plume_cat_id => (@plume.plume_cats.where(:title => "Edito").first.id if @plume.plume_cats.where(:title => "Edito").first)).first
-if plume_article
-@plume_article = plume_article
-if plume_article.article_type == "page" or (plume_article.article_type == "demi") and plume_article.plume_cat
.page_header{:style => "background:transparent;"}
.right
=image_tag "http://lepicvert.org/plume-header2.png"
%span
La Plume
="N°#{@plume.number}"
.clear
.sommaire{:style => ("margin-top:20px" if @plume.id == 3)}
=render :partial => "sommaire"
#edito_place
.page_inner{:style => ("padding-top:0" )}
.left= plume_article.plume_cat.title
%h1{:style => ("font-size:15px;" if @plume.id == 3)}=plume_article.title
.render_block{:style => ("font-size:12.6px;" if @plume.id == 3)}
=render plume_article.block
-if plume_article.author?
.author
=plume_article.author
.clear
#mentions
%p.big
%strong Comité de rédaction et de relecture :
%p
=@plume.redaction_credits
%p
%strong Crédit photo couverture :
=@plume.credits
.legals
Imprimé sur papier 100% recyclé - Imprimerie Ruzzin
.page
-i = 0
-@plume.plume_cats.order(:position).each do |plume_cat|
-if plume_cat.title != "Brèves"
-if plume_cat.title != "Brèves" and plume_cat.title != "Edito"
-plume_cat.plume_articles.order("position").each do |plume_article|
-@plume_article = plume_article
-if plume_article.article_type == "page" or (plume_article.article_type == "demi" and i ==0) and plume_article.plume_cat
@ -130,6 +182,7 @@
-if plume_article.author?
.author
=plume_article.author
.clear
=image_tag "http://lepicvert.org/adhesion.png", :style => "width:108%;margin-top:50px;margin-left:-4%;max-width:10000%;"

View File

@ -50,6 +50,12 @@
=article.description
.clear
.plume_right_buttons
-if @plume.data_file
=link_to "Télécharger la version PDF", @plume.data_file.file.path, :target => "plume_pdf_#{plume.id}", :class => "btn"
-else
=link_to "Télécharger la version PDF", print_public_plume_path(@plume, :format => "pdf"), :target => "plume_pdf_#{@plume.id}", :class => "btn"
.clear
.plume_bottom

View File

@ -0,0 +1,5 @@
class AddDataFileIdToPlumes < ActiveRecord::Migration
def change
add_column :plumes, :data_file_id, :integer
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20180329135016) do
ActiveRecord::Schema.define(version: 20180528150643) do
create_table "admins", force: true do |t|
t.string "email", default: "", null: false
@ -727,6 +727,7 @@ ActiveRecord::Schema.define(version: 20180329135016) do
t.datetime "enabled_at"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "data_file_id"
end
create_table "portlets", force: true do |t|