Sha256: 396f07b6f42296f9a7ebaaa81bb6f6b44779dc0ebe22a21199ed9bc54cec0a4f
Contents?: true
Size: 1.09 KB
Versions: 5
Compression:
Stored size: 1.09 KB
Contents
module EmailerHelper include ApplicationHelper include Umlaut::Helper # returns a plain text short citation def brief_citation(request, options = {}) options[:include_labels] ||= false rv ="" cite = request.referent.to_citation title = truncate(cite[:title].strip, :length => 70, :seperator => '...') rv << (cite[:title_label].strip + ": ")if options[:include_labels] rv << title rv << "\n" if cite[:author] rv << "Author: " if options[:include_labels] rv << cite[:author].strip rv << "\n" end if cite[:subtitle] rv << (cite[:subtitle_label].strip + ": ") if options[:include_labels] rv << cite[:subtitle].strip rv << "\n" end pub = [] pub << date_format(cite[:date]) unless cite[:date].blank? pub << 'Vol: '+cite[:volume].strip unless cite[:volume].blank? pub << 'Iss: '+cite[:issue].strip unless cite[:issue].blank? pub << 'p. '+cite[:page].strip unless cite[:page].blank? if pub.length > 0 rv << "Published: " if options[:include_labels] rv << pub.join(' ') end return rv end end
Version data entries
5 entries across 5 versions & 1 rubygems