# filtered_column_hcard_macro:
# A macro for filtered_column rails plugin to generate
# hcard microformat snippets
#
#
# == Synopsis
#
#
#
#
# == Authors
#
# * Luca Greco
#
# == Copyright
#
# Copyright (c) 2007 Alca Società Cooperativa
#
# All rights reserved.
#
#
# filtered_column_hcard_macro is free software; you can redistribute it
# and/or modify it under # the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1 of the
# License, or (at your option) any later version.
#
# filtered_column_hcard_macro is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
class HCardMacro < FilteredColumn::Macros::Base
def self.filter(attributes, inner_text = '', text = '')
fn = attributes[:fn] || ""
nickname = attributes[:nickname] || ""
photo = attributes[:photo] || "/images/avatar-nil.png"
email = attributes[:email] || ""
css_class = (attributes[:class] || "") + " vcard"
hcard_block = <<-EOF
- Full Name:
- #{fn}
- Nickname:
- #{nickname}
- Email:
- #{email}
#{inner_text}
EOF
end
end