OSDN Git Service

moving out of body
authorgitlabhq <m@gitlabhq.com>
Thu, 27 Oct 2011 15:46:30 +0000 (18:46 +0300)
committergitlabhq <m@gitlabhq.com>
Thu, 27 Oct 2011 15:46:30 +0000 (18:46 +0300)
app/models/issue.rb
app/views/issues/_form.html.haml
app/views/issues/_show.html.haml
app/views/issues/show.html.haml
db/migrate/20111027152724_issue_conten_to_note.rb [new file with mode: 0644]

index ca1c5ea..9fb7ef3 100644 (file)
@@ -14,9 +14,9 @@ class Issue < ActiveRecord::Base
             :presence => true,
             :length   => { :within => 0..255 }
 
-  validates :content,
-            :presence => true,
-            :length   => { :within => 0..2000 }
+  #validates :content,
+            #:presence => true,
+            #:length   => { :within => 0..2000 }
 
   scope :critical, where(:critical => true)
   scope :non_critical, where(:critical => false)
index eae0ee0..80f19d6 100644 (file)
@@ -7,10 +7,10 @@
 
     .span-8
       = f.label :title
-      = f.text_field :title, :style => "width:450px"
-    .span-8
-      = f.label :content
-      = f.text_area :content, :style => "width:450px; height:130px"
+      = f.text_area :title, :style => "width:450px; height:100px", :maxlength => 255
+    -#.span-8
+      -#= f.label :content
+      -#= f.text_area :content, :style => "width:450px; height:130px"
     .span-8.append-bottom
       = f.label :assignee_id
       = f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" })
index ebcaae2..9cce287 100644 (file)
@@ -7,7 +7,7 @@
     = truncate issue.assignee.name, :lenght => 20
   %td ##{issue.id}
   %td
-    = html_escape issue.title
+    = truncate(html_escape(issue.title), :length => 50)
     %br
     - if issue.critical
       %span.tag.high critical
index 58bebe9..eb972d3 100644 (file)
@@ -1,12 +1,8 @@
 %h2
-  = "Issue ##{@issue.id} - #{@issue.title}"
+  = "Issue ##{@issue.id} - #{truncate @issue.title, :length => 50}"
 
 .span-15
-  = simple_format html_escape(@issue.content)
-
-
-  .clear
-  %br
+  -#= simple_format html_escape(@issue.content)
   .issue_notes= render "notes/notes"
 .span-8.right
   .span-8
diff --git a/db/migrate/20111027152724_issue_conten_to_note.rb b/db/migrate/20111027152724_issue_conten_to_note.rb
new file mode 100644 (file)
index 0000000..15d96c3
--- /dev/null
@@ -0,0 +1,11 @@
+class IssueContenToNote < ActiveRecord::Migration
+  def up
+    raise "Not ready"
+    Issue.find_each(:batch_size => 100) do |issue|
+      
+    end
+  end
+
+  def down
+  end
+end