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.5 app/helpers/emailer_helper.rb
umlaut-3.0.4 app/helpers/emailer_helper.rb
umlaut-3.0.3 app/helpers/emailer_helper.rb
umlaut-3.0.2 app/helpers/emailer_helper.rb
umlaut-3.0.1 app/helpers/emailer_helper.rb
umlaut-3.0.0 app/helpers/emailer_helper.rb
umlaut-3.0.0rc1 app/helpers/emailer_helper.rb
umlaut-3.0.0beta10 app/helpers/emailer_helper.rb
umlaut-3.0.0beta9 app/helpers/emailer_helper.rb
umlaut-3.0.0beta8 app/helpers/emailer_helper.rb
umlaut-3.0.0beta7 app/helpers/emailer_helper.rb
umlaut-3.0.0beta6 app/helpers/emailer_helper.rb
umlaut-3.0.0beta5 app/helpers/emailer_helper.rb
umlaut-3.0.0beta4 app/helpers/emailer_helper.rb
umlaut-3.0.0beta3 app/helpers/emailer_helper.rb
umlaut-3.0.0beta2 app/helpers/emailer_helper.rb
umlaut-3.0.0beta1 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha15 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha14 app/helpers/emailer_helper.rb
umlaut-3.0.0alpha13 app/helpers/emailer_helper.rb