diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2015-10-04 16:09:29 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2015-10-04 16:09:29 +0200 |
commit | ff8c65d1c8969b8521ea54765c9e75bd764d516b (patch) | |
tree | 51c65576b930ce4a2652b5d11e7abf8c574fda27 | |
parent | b04e6f3d6dd3ec5ed2d47f700c9e62f7da5efd32 (diff) | |
download | norsk-urskog-registrations-ff8c65d1c8969b8521ea54765c9e75bd764d516b.tar.gz norsk-urskog-registrations-ff8c65d1c8969b8521ea54765c9e75bd764d516b.tar.bz2 norsk-urskog-registrations-ff8c65d1c8969b8521ea54765c9e75bd764d516b.zip |
Add submitted songs to PDF
-rw-r--r-- | lib/pdf_form.rb | 17 | ||||
-rw-r--r-- | lib/song.rb | 7 |
2 files changed, 20 insertions, 4 deletions
diff --git a/lib/pdf_form.rb b/lib/pdf_form.rb index 57db881..c472fd9 100644 --- a/lib/pdf_form.rb +++ b/lib/pdf_form.rb @@ -25,7 +25,17 @@ class PDFForm next_line field("Medlemmer:", @band.members) - field("Låter:", @band.songs) + next_line + subheading("Låter:") + @band.songs.each do |song| + field("Tittel", song.to_s) + field("ISRC-kode:", song.isrc) + field("Utøvere:", song.performers) + field("Komponister:", song.composers) + field("Merknad:", song.notes) + next_line + @document.stroke { @document.horizontal_rule } + end @document.render_file "#{@band.name}.pdf" end @@ -44,6 +54,11 @@ class PDFForm @document.text "Påmelding til Norsk Urskog 2016", :size => 20 end + def subheading(text) + @document.text text, :size => 16, :style => :bold + @document.stroke { @document.horizontal_rule } + end + def next_line @document.move_down one_line end diff --git a/lib/song.rb b/lib/song.rb index e20b5b8..93172f2 100644 --- a/lib/song.rb +++ b/lib/song.rb @@ -1,11 +1,12 @@ class Song - attr_reader :title, :time, :composers, :performers, :notes + attr_reader :title, :time, :isrc, :composers, :performers, :notes def initialize(params) @title = params['title'] @time = params['time'] - @composers = params['composers'] - @performers = params['performers'] + @isrc = params['isrc'] + @composers = params['composers'].split("\n") + @performers = params['performers'].split("\n") @notes = params['notes'] end |