From 4bd266ca036b9a11ea37432fdc97485ca2c674d1 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 13 Nov 2011 14:55:15 +0100 Subject: Make tourdates a bit nicer. --- src/_helpers/band_helper.rb | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'src/_helpers') diff --git a/src/_helpers/band_helper.rb b/src/_helpers/band_helper.rb index 0380184..812892d 100644 --- a/src/_helpers/band_helper.rb +++ b/src/_helpers/band_helper.rb @@ -1,9 +1,37 @@ puts "Loading BandHelper..." module BandHelper + def bandlinks_all "#{link('Exeloume', 'http://www.facebook.com/exeloume')}, " + "#{link('Imbalance', 'http://www.imbalance.no')} og " + "#{link('Ninth Circle', 'http://www.ninthcircle.no')}" end -end \ No newline at end of file + + def tourdate(date, venue, town, comments = "") + rendered_date = tag "span", :class => "date" do + date + end + + rendered_venue = tag "span", :class => "venue" do + venue + end + + rendered_town = tag "span", :class => "town" do + town + end + + output = "#{rendered_date}: #{rendered_venue}, #{rendered_town}" + + unless comments.empty? + rendered_comments = tag "span", :class => "comments" do + "(#{comments})" + end + output += " #{rendered_comments}" + end + + tag "li", :class => "tour_entry" do + output + end + end +end -- cgit v1.2.3