From a563710a694e8992d74ed789ff36201e8d3eedfb Mon Sep 17 00:00:00 2001 From: Stefan Schlott Date: Thu, 5 Sep 2013 16:09:35 +0200 Subject: [PATCH] New flyer layout --- commands/create-flyer.rb | 31 +- content/_data/aushang.svg | 679 ++++++++++++++++++++------------------ 2 files changed, 382 insertions(+), 328 deletions(-) diff --git a/commands/create-flyer.rb b/commands/create-flyer.rb index 78e563eb..bcf4c9f5 100644 --- a/commands/create-flyer.rb +++ b/commands/create-flyer.rb @@ -30,31 +30,34 @@ class CreateFlyer < ::Nanoc::CLI::CommandRunner speakers = event[:speakers].map { |s| if s[:affiliation] then "#{s[:name]} (#{s[:affiliation]})" else s[:name] end } text = Nokogiri::HTML(event.compiled_content) text = text.content.gsub(/\n+/,"\n") - location_infos = [event[:location][:name]] + location_name = [event[:location][:name]] if (event[:location][:details]) - location_infos << event[:location][:details] + location_name << event[:location][:details] end + location_address = [] if (event[:location][:strasse]) - location_infos << event[:location][:strasse] + location_address << event[:location][:strasse] end if (event[:location][:ort]) if (event[:location][:plz]) - location_infos << "#{event[:location][:plz]} #{event[:location][:ort]}" + location_address << "#{event[:location][:plz]} #{event[:location][:ort]}" else - location_infos << event[:location][:ort] + location_address << event[:location][:ort] end end - if (event[:location][:lon]) - location_infos << "N #{event[:location][:lon]} E #{event[:location][:lat]}" - end + location_geo = if (event[:location][:lon]) + "N #{event[:location][:lon]} E #{event[:location][:lat]}" + else + "" + end calendar_items = self.site.items.select do |i| (i[:kind]=='event') && (i[:startdate].to_datetime>event[:startdate].to_datetime) && !i.identifier.start_with?('/_data/stammtisch/') end.sort { |a,b| a[:startdate].to_datetime <=> b[:startdate].to_datetime } calendar = calendar_items[0..5].map do |i| if i[:startdate].instance_of?(Date) - "#{i[:startdate].strftime("%d.%m.%Y")} #{i[:title]}" + "#{i[:startdate].strftime("%d.%m.%Y")}: #{i[:title]}" else - "#{i[:startdate].strftime("%d.%m.%Y, %H:%M")} #{i[:title]}" + "#{i[:startdate].strftime("%d.%m.%Y, %H:%M")}h: #{i[:title]}" end end # Read template @@ -65,8 +68,12 @@ class CreateFlyer < ::Nanoc::CLI::CommandRunner template.gsub!('${title}', title) template.gsub!('${date}', date.strftime("%d.%m.%Y, %H:%M")) template.gsub!('${speakers}', speakers.join(', ')) - template.gsub!('${location}', location_infos.join(", ")) - template.gsub!('${calendar}', calendar.join(" \n")) + template.gsub!('${location.name}', location_name.join(", ")) + template.gsub!('${location.address}', location_address.join(", ")) + template.gsub!('${location.geo}', location_geo) + for i in 0..5 do + template.gsub!("${calendar.#{i}}", calendar[i] || "") + end # Output File.open("#{arguments[1]}/aushang.svg", 'w:UTF-8') {|f| f.write(template) } end diff --git a/content/_data/aushang.svg b/content/_data/aushang.svg index 19f0ffad..566be59d 100644 --- a/content/_data/aushang.svg +++ b/content/_data/aushang.svg @@ -1,5 +1,5 @@ - + - - - - - - - image/svg+xml - - - - image/svg+xml - - - - - - - - - - - - - - - + + + + + + + + + + + + + + +Der Chaos-Computer-Club Stuttgart und die Stadtbibliothek am Mailänder Platz präsentieren:ChaosComputerClub Stuttgart e.V. und Stadtbibliothek am Mailänder Platz präsentieren: - - Vortragsreihe des CCCS +VeranstalterChaos-Computer-Club Stuttgartwww.cccs.deV.i.S.d.P.: Hanno WagnerNeckarstraße 168b70190 Stuttgart - - - VeranstalterChaosComputerClub Stuttgart e.V.www.cccs.deV.i.S.d.P.: Hanno Wagner, Neckarstraße 168B, 70190 Stuttgart - - - - ${date}${speakers}:${title} - ${date}${speakers}: ${title}Ort${location}Eintritt frei, um einen freiwilligen Unkostenbeitrag wird gebeten! - - Vortragsreihe des CCCS - TerminRegulär am zweiten Donnerstag im Monat.Ablauf19:30 Uhr Vortragsbeginn, bis max. 22 Uhr Diskussion im Anschluß an den Vortrag.KooperationWir danken der Stadtbücherei Stuttgart (http://www.stuttgart.de/stadtbuecherei/) fürdie Unterstützung! - - Ort${location.name}${location.address}${location.geo}Eintritt frei, um einen freiwilligen Unkostenbeitrag wird gebeten.Weitere Termine${calendar} - - - QR-Code "Calendar Event" vonhttp://zxing.appspot.com/generator - - - + id="flowRoot4984" + style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;display:inline;font-family:TitilliumText25L;-inkscape-font-specification:TitilliumText25L" + transform="matrix(2.6162812,0,0,2.6162812,-18.888666,-651.73555)">Weitere Termine${calendar.0}${calendar.1}${calendar.2}${calendar.3}${calendar.4}${calendar.5} \ No newline at end of file