Patch #6722 ยป summary_to_projects.diff
| app/models/project.rb (working copy) | ||
|---|---|---|
|
|
||
|
# Returns a short description of the projects (first lines)
|
||
|
def short_description(length = 255)
|
||
|
description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||
|
case
|
||
|
when summary.present?
|
||
|
summary
|
||
|
when description.present?
|
||
|
description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip
|
||
|
else
|
||
|
""
|
||
|
end
|
||
|
end
|
||
|
def css_classes
|
||
| app/views/projects/_form.rhtml (working copy) | ||
|---|---|---|
|
<p><%= label(:project, :parent_id, l(:field_parent)) %><%= parent_project_select_tag(@project) %></p>
|
||
|
<% end %>
|
||
|
<p><%= f.text_area :summary, :rows => 2, :class => 'wiki-edit' %></p>
|
||
|
<p><%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %></p>
|
||
|
<p><%= f.text_field :identifier, :required => true, :disabled => @project.identifier_frozen?, :maxlength => 20 %>
|
||
|
<% unless @project.identifier_frozen? %>
|
||
| db/migrate/20101021153830_add_summary_to_projects.rb (revision 0) | ||
|---|---|---|
|
class AddSummaryToProjects < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
add_column :projects, :summary, :string, :limit => 255, :default => ''
|
||
|
end
|
||
|
def self.down
|
||
|
remove_column :projects, :summary
|
||
|
end
|
||
|
end
|
||