Project

General

Profile

Defect #30491 ยป short_description_fix.diff

Go MAEDA, 2019-01-25 01:55

View differences:

app/models/project.rb (working copy)
620 620
    name
621 621
  end
622 622

  
623
  # Returns a short description of the projects (first lines)
623
  # Returns a short description of the projects (first 3 lines)
624 624
  def short_description(length = 255)
625
    description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
625
    if description
626
      description =~ /\A(?>[^\r\n]*(?:\r\n?|\n)?){0,3}/
627
      s = $&.strip[0...length]
628
      s << '...' if s != description
629
    end
626 630
  end
627 631

  
628 632
  def css_classes
    (1-1/1)