diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb index 73f39f9..8fbf889 100644 --- a/app/models/time_entry.rb +++ b/app/models/time_entry.rb @@ -37,7 +37,6 @@ class TimeEntry < ActiveRecord::Base validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on validates_numericality_of :hours, :allow_nil => true, :message => :invalid - validates_length_of :comments, :maximum => 255, :allow_nil => true def after_initialize if new_record? && self.activity.nil? diff --git a/app/views/issues/_edit.rhtml b/app/views/issues/_edit.rhtml index 413f217..2b08d2b 100644 --- a/app/views/issues/_edit.rhtml +++ b/app/views/issues/_edit.rhtml @@ -24,7 +24,7 @@

<%= time_entry.select :activity_id, activity_collection_for_select_options %>

-

<%= time_entry.text_field :comments, :size => 60 %>

+

<%= time_entry.text_area :comments, :rows => 8 %>

<% @time_entry.custom_field_values.each do |value| %>

<%= custom_field_tag_with_label :time_entry, value %>

<% end %> diff --git a/app/views/my/blocks/_timelog.rhtml b/app/views/my/blocks/_timelog.rhtml index 95679b2..e49016a 100644 --- a/app/views/my/blocks/_timelog.rhtml +++ b/app/views/my/blocks/_timelog.rhtml @@ -32,7 +32,7 @@ entries_by_day = entries.group_by(&:spent_on) <%=h entry.activity %> <%=h entry.project %> <%= ' - ' + link_to_issue(entry.issue, :truncate => 50) if entry.issue %> - <%=h entry.comments %> + <%= textilizable entry, :comments, :wiki_links => :local %> <%= html_hours("%.2f" % entry.hours) %> <% if entry.editable_by?(@user) -%> diff --git a/app/views/timelog/_list.rhtml b/app/views/timelog/_list.rhtml index e11695e..29c1590 100644 --- a/app/views/timelog/_list.rhtml +++ b/app/views/timelog/_list.rhtml @@ -23,7 +23,7 @@ <%= entry.issue.visible? ? link_to_issue(entry.issue, :truncate => 50) : "##{entry.issue.id}" -%> <% end -%> -<%=h entry.comments %> +<%= textilizable entry, :comments, :wiki_links => :local %> <%= html_hours("%.2f" % entry.hours) %> <% if entry.editable_by?(User.current) -%> diff --git a/app/views/timelog/edit.rhtml b/app/views/timelog/edit.rhtml index 00d0a77..6ee4729 100644 --- a/app/views/timelog/edit.rhtml +++ b/app/views/timelog/edit.rhtml @@ -8,7 +8,7 @@

<%= f.text_field :issue_id, :size => 6 %> <%= h("#{@time_entry.issue.tracker.name} ##{@time_entry.issue.id}: #{@time_entry.issue.subject}") if @time_entry.issue %>

<%= f.text_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %>

<%= f.text_field :hours, :size => 6, :required => true %>

-

<%= f.text_field :comments, :size => 100 %>

+

<%= f.text_area :comments, :rows => 8 %>

<%= f.select :activity_id, activity_collection_for_select_options(@time_entry), :required => true %>

<% @time_entry.custom_field_values.each do |value| %>

<%= custom_field_tag_with_label :time_entry, value %>

diff --git a/db/migrate/20100203222505_convert_time_entry_comment_to_text.rb b/db/migrate/20100203222505_convert_time_entry_comment_to_text.rb new file mode 100644 index 0000000..9c32ae1 --- /dev/null +++ b/db/migrate/20100203222505_convert_time_entry_comment_to_text.rb @@ -0,0 +1,9 @@ +class ConvertTimeEntryCommentToText < ActiveRecord::Migration + def self.up + change_column :time_entries, :comments, :text + end + + def self.down + change_column :time_entries, :comments, :string, :limit => 255 + end +end diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index d5dd42c..c8c302b 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -364,7 +364,7 @@ display: block; width: auto; } -input#time_entry_comments { width: 90%;} +textarea#time_entry_comments { width: 99%;} #preview fieldset {margin-top: 1em; background: url(../images/draft.png)}