Sha256: dc0e1548416d5d853be5b94e66e4589984f2d3b745ff1544abf7a6e9fdca42d3

Contents?: true

Size: 1.11 KB

Versions: 32

Compression:

Stored size: 1.11 KB

Contents

module EmailerHelper
  include ApplicationHelper
  
  # 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

32 entries across 32 versions & 1 rubygems

Version Path
umlaut-3.0.0alpha12 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha11 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha10 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha9 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha8 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha7 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha6 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha5 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha4 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha3 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha2 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha1 app/helpers/emailer_helper.rb