aboutsummaryrefslogtreecommitdiffstats
path: root/lib/carlosgoce/layout
diff options
context:
space:
mode:
authorCarlos Goce <carlosgoce@gmail.com>2015-01-29 21:55:16 +0100
committerCarlos Goce <carlosgoce@gmail.com>2015-01-29 21:55:16 +0100
commitbe64f7b9962217177a18baf5c83b87cf6fbbaaab (patch)
tree93aaa433dacd03a3d71cb6b88ca4524b84f588a9 /lib/carlosgoce/layout
parent9f31b9de12a3bc48b7297098c2bd7a0357fe1ae4 (diff)
downloadpdf-calendars-be64f7b9962217177a18baf5c83b87cf6fbbaaab.tar.gz
pdf-calendars-be64f7b9962217177a18baf5c83b87cf6fbbaaab.tar.bz2
pdf-calendars-be64f7b9962217177a18baf5c83b87cf6fbbaaab.zip
Improved layout
Diffstat (limited to 'lib/carlosgoce/layout')
-rw-r--r--lib/carlosgoce/layout/layouts.rb19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/carlosgoce/layout/layouts.rb b/lib/carlosgoce/layout/layouts.rb
index cca35c9..26452c9 100644
--- a/lib/carlosgoce/layout/layouts.rb
+++ b/lib/carlosgoce/layout/layouts.rb
@@ -13,22 +13,19 @@ module CarlosGoce
data[:months].each do |k, month|
days = month[:formatted_days]
cells = days.to_a.each_slice(7).to_a
- cells.unshift %w(L M X J V S D)
- cells.unshift [{content: "<color rgb='FF0000'><strong>#{month[:name]}</strong></color>", colspan: 7,
+ a = []
+ %w(L M X J V S D).each {|d| a << "<strong>#{d}</strong>" }
+ # cells.unshift ['L', 'M', 'X', 'J', 'V', 'S', 'D']
+ cells.unshift a
+ cells.unshift [{content: "<color rgb='FF0000'><strong>#{month[:name].upcase}</strong></color>", colspan: 7,
inline_format: true}]
tables << make_table(cells,
- cell_style:
- {
- width: 15, height: 12, align: :center, size: 7, border_width: 0,
- padding: 0, valign: :center
- })
+ cell_style: {width: 15, height: 12, align: :center, size: 7, border_width: 0, padding: 0, valign: :center})
end
- table(
- tables.each_slice(3).to_a, cell_style: {align: :center, padding: [5, 5, 5, 5], border_width: 0,
- valign: :center}
- )
+ table(tables.each_slice(3).to_a, cell_style: {align: :center, padding: [5, 5, 5, 5], border_width: 0,
+ valign: :center, margin: [0, 0, 15, 0]})
end
end
end