version imprimable
This commit is contained in:
parent
fde4b659cd
commit
32c39322ae
66
app/assets/stylesheets/print.css.scss
Normal file
66
app/assets/stylesheets/print.css.scss
Normal file
@ -0,0 +1,66 @@
|
||||
|
||||
|
||||
body{
|
||||
font-family:arial;
|
||||
|
||||
}
|
||||
#pdf_prescription{
|
||||
a{
|
||||
text-decoration:none;
|
||||
color:black;
|
||||
display: inline-block;
|
||||
background: #3c74a8;
|
||||
background: -webkit-gradient(linear, 0% 100%, 0% 0%, from(rgb(239,242,242)), to(rgb(255,255,255)));
|
||||
background: -moz-linear-gradient(bottom, rgb(239,242,242), rgb(255,255,255));
|
||||
box-shadow: rgba(0,0,0, 0.4) 0px 0px 3px;
|
||||
-moz-box-shadow: rgba(0,0,0, 0.4) 0px 0px 3px;
|
||||
-webkit-box-shadow: rgba(0,0,0, 0.4) 0px 0px 3px;
|
||||
border: none;
|
||||
-moz-border-radius: 20px;
|
||||
-webkit-border-radius: 20px;
|
||||
border-radius: 20px;
|
||||
color: RGB(46,46,46);
|
||||
|
||||
|
||||
|
||||
|
||||
padding: 5px 15px;
|
||||
margin:30px 5px 0px 5px;
|
||||
font-weight:normal;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.notes{
|
||||
padding:5px;
|
||||
margin:5px;
|
||||
font-size:15px;
|
||||
border:1px solid #ffd148;
|
||||
}
|
||||
h2{
|
||||
.tel{
|
||||
float:right;
|
||||
}
|
||||
|
||||
}
|
||||
#ship_info{
|
||||
border:1px solid #49bd22;
|
||||
|
||||
height:16px;
|
||||
|
||||
|
||||
padding:10px;
|
||||
|
||||
}
|
||||
.file{
|
||||
text-align:center;
|
||||
img{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
.done{
|
||||
padding:5px;
|
||||
}
|
@ -22,6 +22,12 @@ class Admin::PrescriptionsController < ApplicationController
|
||||
@prescription.read = true
|
||||
@prescription.save
|
||||
end
|
||||
|
||||
def print
|
||||
|
||||
@prescription = Prescription.find(params[:id])
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def delete
|
||||
end
|
||||
|
@ -19,9 +19,11 @@
|
||||
-if @prescription.file?
|
||||
-if @prescription.is_pdf?
|
||||
#pdf_prescription=link_to "Cette ordonnance est au format pdf. Cliquez-ici pour la visualiser.", @prescription.file.url, :target => "_blank"
|
||||
|
||||
-else
|
||||
=image_tag @prescription.file.url, :style => "width:100%;"
|
||||
=link_to "Cliquez-ici pour télécharger image dans une nouvelle fenêtre.", @prescription.file.url, :target => "_blank"
|
||||
=image_tag @prescription.file.url, :style => "max-width:100%;max-height:100%;"
|
||||
|
||||
=link_to "Cliquez-ici pour télécharger l'image dans une nouvelle fenêtre.", @prescription.file.url, :target => "_blank"
|
||||
|
||||
|
||||
|
||||
@ -45,4 +47,8 @@
|
||||
=f.datetime_select :delivery_at, :order => [:day, :month, :year, :hour, :minute ]
|
||||
=f.submit "Sauvegarder"
|
||||
|
||||
.delete= link_to i(:trash_stroke, :gray_light), admin_prescription_path(@prescription), :confirm => 'Voulez-vous vraiment supprimer cette commande ?', :method => :delete
|
||||
.delete
|
||||
|
||||
= link_to i(:trash_stroke, :gray_light), admin_prescription_path(@prescription), :confirm => 'Voulez-vous vraiment supprimer cette commande ?', :method => :delete
|
||||
|
||||
=link_to i(:print, :gray_light), print_admin_prescription_path(@prescription), :target => "_blank"
|
||||
|
37
app/views/admin/prescriptions/print.html.haml
Normal file
37
app/views/admin/prescriptions/print.html.haml
Normal file
@ -0,0 +1,37 @@
|
||||
!!!
|
||||
%html{:lang => "fr"}
|
||||
%head
|
||||
%meta{:"http-equiv" => "content-type" ,:content =>"text/html;charset=UTF-8" }
|
||||
%title="Impression ordonnance"
|
||||
|
||||
|
||||
= stylesheet_link_tag 'print', :media => "all"
|
||||
|
||||
|
||||
%body
|
||||
|
||||
|
||||
|
||||
-if @prescription.done
|
||||
#ship_info
|
||||
La livraison est prévu le
|
||||
=l @prescription.delivery_at
|
||||
%h2
|
||||
.tel= @prescription.tel
|
||||
=@prescription.name
|
||||
.date=l @prescription.created_at
|
||||
|
||||
|
||||
-if @prescription.notes?
|
||||
.notes
|
||||
=simple_format @prescription.notes
|
||||
|
||||
.file
|
||||
|
||||
-if @prescription.file?
|
||||
-if @prescription.is_pdf?
|
||||
#pdf_prescription=link_to "Annexe : scan au format pdf", @prescription.file.url, :target => "_blank"
|
||||
|
||||
-else
|
||||
=image_tag @prescription.file.url, :style => "max-width:100%;max-height:100%;"
|
||||
|
@ -99,6 +99,7 @@ Pharma::Application.routes.draw do
|
||||
get :done
|
||||
get :undone
|
||||
get :file
|
||||
get :print
|
||||
end
|
||||
end
|
||||
|
||||
|
BIN
vendor/assets/images/iconic/gray_light/print_16x16.png
vendored
Normal file
BIN
vendor/assets/images/iconic/gray_light/print_16x16.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 583 B |
Loading…
x
Reference in New Issue
Block a user