Commit a0171813391c8226802621a710798e376fea2f1e
1 parent
56d97618
Exists in
master
and in
4 other branches
new issue format
Showing
8 changed files
with
60 additions
and
10 deletions
Show diff stats
app/assets/stylesheets/projects.css.scss
app/controllers/issues_controller.rb
app/views/issues/_show.html.haml
app/views/issues/show.html.haml
1 | 1 | %h2 |
2 | - = "Issue ##{@issue.id} - #{truncate @issue.title, :length => 50}" | |
3 | - | |
2 | + = "Issue ##{@issue.id} - #{html_escape(@issue.title)}" | |
4 | 3 | .span-15 |
5 | 4 | -#= simple_format html_escape(@issue.content) |
6 | 5 | .issue_notes= render "notes/notes" |
... | ... | @@ -29,6 +28,16 @@ |
29 | 28 | %td |
30 | 29 | = image_tag gravatar_icon(@issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" |
31 | 30 | = @issue.assignee.name |
31 | + %tr | |
32 | + %td Tags | |
33 | + %td | |
34 | + - if @issue.critical | |
35 | + %span.tag.high critical | |
36 | + - else | |
37 | + %span.tag.normal normal | |
38 | + | |
39 | + - if @issue.today? | |
40 | + %span.tag.today today | |
32 | 41 | %tr |
33 | 42 | %td Closed? |
34 | 43 | %td | ... | ... |
db/migrate/20111027152724_issue_conten_to_note.rb
1 | 1 | class IssueContenToNote < ActiveRecord::Migration |
2 | 2 | def up |
3 | - raise "Not ready" | |
3 | + puts "Issue content is deprecated -> move to notes" | |
4 | 4 | Issue.find_each(:batch_size => 100) do |issue| |
5 | - | |
5 | + next if issue.content.blank? | |
6 | + note = Note.new( | |
7 | + :note => issue.content, | |
8 | + :project_id => issue.project_id, | |
9 | + :noteable => issue, | |
10 | + :created_at => issue.created_at, | |
11 | + :updated_at => issue.created_at | |
12 | + ) | |
13 | + note.author_id = issue.author_id | |
14 | + | |
15 | + if note.save | |
16 | + issue.update_attributes(:content => nil) | |
17 | + print "." | |
18 | + else | |
19 | + print "F" | |
20 | + end | |
21 | + end | |
22 | + | |
23 | + total = Issue.where("content is not null").count | |
24 | + | |
25 | + if total > 0 | |
26 | + puts "content of #{total} issues were not migrated" | |
27 | + else | |
28 | + puts "Done" | |
6 | 29 | end |
7 | 30 | end |
8 | 31 | ... | ... |
db/schema.rb
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 | # |
12 | 12 | # It's strongly recommended to check this file into your version control system. |
13 | 13 | |
14 | -ActiveRecord::Schema.define(:version => 20111027142641) do | |
14 | +ActiveRecord::Schema.define(:version => 20111027152724) do | |
15 | 15 | |
16 | 16 | create_table "issues", :force => true do |t| |
17 | 17 | t.string "title" | ... | ... |
spec/factories.rb
spec/requests/issues_spec.rb
... | ... | @@ -80,7 +80,6 @@ describe "Issues" do |
80 | 80 | describe "fill in" do |
81 | 81 | before do |
82 | 82 | fill_in "issue_title", :with => "bug 345" |
83 | - fill_in "issue_content", :with => "app bug 345" | |
84 | 83 | click_link "Select user" |
85 | 84 | click_link @user.name |
86 | 85 | end |
... | ... | @@ -112,6 +111,23 @@ describe "Issues" do |
112 | 111 | end |
113 | 112 | end |
114 | 113 | |
114 | + describe "Show issue" do | |
115 | + before do | |
116 | + @issue = Factory :issue, | |
117 | + :author => @user, | |
118 | + :assignee => @user, | |
119 | + :project => project | |
120 | + | |
121 | + visit project_issue_path(project, @issue) | |
122 | + end | |
123 | + | |
124 | + it "should have valid show page for issue" do | |
125 | + page.should have_content @issue.title | |
126 | + page.should have_content @user.name | |
127 | + page.should have_content "today" | |
128 | + end | |
129 | + end | |
130 | + | |
115 | 131 | describe "Edit issue", :js => true do |
116 | 132 | before do |
117 | 133 | @issue = Factory :issue, |
... | ... | @@ -129,7 +145,6 @@ describe "Issues" do |
129 | 145 | describe "fill in" do |
130 | 146 | before do |
131 | 147 | fill_in "issue_title", :with => "bug 345" |
132 | - fill_in "issue_content", :with => "app bug 345" | |
133 | 148 | end |
134 | 149 | |
135 | 150 | it { expect { click_button "Save" }.to_not change {Issue.count} } | ... | ... |