Improve header+footer in PDFs
This commit is contained in:
parent
d1ece157c6
commit
cfdfe5f23e
5 changed files with 16 additions and 6 deletions
|
@ -1003,7 +1003,7 @@ de:
|
|||
logo: "<span>food</span>soft"
|
||||
lib:
|
||||
order_pdf:
|
||||
page: Seite %{number}
|
||||
page: Seite %{number} von %{count}
|
||||
login:
|
||||
accept_invitation:
|
||||
body: "<p>Du bist eingeladen worden als Mitglied der Gruppe <b>%{group}</b> in der Foodcoop %{foodcoop} mitzumachen.</p> <p>Wenn Du mitmachen möchtest, dann fülle bitte dieses Formular aus.</p> <p>Deine Daten werden selbstverständlich nicht an Dritte, aus was auch immer für Gründen, weitergeben. Du kannst auch entscheiden, wieviel deiner persönlichen Daten für alle einsehbar sein sollen. 'Alle' bedeutet hier alle Foodcoop-Mitglieder. Die Administratoren haben aber jederzeit Zugriff auf deine Daten.</p>"
|
||||
|
|
|
@ -1005,7 +1005,7 @@ en:
|
|||
logo: "<span>food</span>soft"
|
||||
lib:
|
||||
order_pdf:
|
||||
page: Page %{number}
|
||||
page: Page %{number} of %{count}
|
||||
login:
|
||||
accept_invitation:
|
||||
body: "<p>You are invited to be part of the foodcoop %{foodcoop} as a member of the group <b>%{group}</b>.</p> <p>If you want to participate, please fill in this form.</p> <p>Naturally, your information wll not be shared with third parties for any reason. You can decide how much of your personal information should be visible for everyone. 'All' means all Foodcoop-members. Please note that the administrators do have access to your information.</p>"
|
||||
|
|
|
@ -1016,7 +1016,7 @@ fr:
|
|||
logo: coop
|
||||
lib:
|
||||
order_pdf:
|
||||
page: page %{number}
|
||||
page: page %{number} de %{count}
|
||||
login:
|
||||
accept_invitation:
|
||||
body: |
|
||||
|
|
|
@ -1005,7 +1005,7 @@ nl:
|
|||
logo: "<span>food</span>soft"
|
||||
lib:
|
||||
order_pdf:
|
||||
page: Pagina %{number}
|
||||
page: Pagina %{number} van %{count}
|
||||
login:
|
||||
accept_invitation:
|
||||
body: "<p>Je bent uitgenodigd als lid voor foodcoop %{foodcoop} in de groep <b>%{group}</b>.</p> <p>Als je wilt meedoen, vul dan dit formulier in.</p> <p>Natuurlijk zullen we je informatie niet delen met anderen. Je kunt zelf aangeven, welke informatie voor andere leden beschikbaar is (maar beheerders hebben daar altijd toegang toe).</p>"
|
||||
|
|
|
@ -20,8 +20,18 @@ class OrderPdf < Prawn::Document
|
|||
|
||||
# Define header
|
||||
repeat :all, dynamic: true do
|
||||
draw_text title, size: fontsize(10), style: :bold, at: [bounds.left, bounds.top+20] if title # Header
|
||||
draw_text I18n.t('lib.order_pdf.page', :number => page_number), size: fontsize(8), at: [bounds.left, bounds.bottom-10] # Footer
|
||||
s = fontsize(8)
|
||||
# header
|
||||
bounding_box [bounds.left, bounds.top+s*2], width: bounds.width, height: s*1.2 do
|
||||
text title, size: s, align: :center if title
|
||||
end
|
||||
# footer
|
||||
bounding_box [bounds.left, bounds.bottom-s], width: bounds.width, height: s*1.2 do
|
||||
text I18n.t('lib.order_pdf.page', number: page_number, count: page_count), size: s, align: :right
|
||||
end
|
||||
bounding_box [bounds.left, bounds.bottom-s], width: bounds.width, height: s*1.2 do
|
||||
text I18n.l(Time.now, format: :long), size: s, align: :left
|
||||
end
|
||||
end
|
||||
|
||||
body # Add content, which is defined in subclasses
|
||||
|
|
Loading…
Reference in a new issue