Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a0171813
Commit
a0171813
authored
Oct 28, 2011
by
gitlabhq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new issue format
parent
56d97618
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
10 deletions
+60
-10
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+4
-0
app/controllers/issues_controller.rb
app/controllers/issues_controller.rb
+1
-1
app/views/issues/_show.html.haml
app/views/issues/_show.html.haml
+1
-1
app/views/issues/show.html.haml
app/views/issues/show.html.haml
+11
-2
db/migrate/20111027152724_issue_conten_to_note.rb
db/migrate/20111027152724_issue_conten_to_note.rb
+25
-2
db/schema.rb
db/schema.rb
+1
-1
spec/factories.rb
spec/factories.rb
+0
-1
spec/requests/issues_spec.rb
spec/requests/issues_spec.rb
+17
-2
No files found.
app/assets/stylesheets/projects.css.scss
View file @
a0171813
...
...
@@ -662,6 +662,10 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
background
:
#4466cc
;
color
:white
;
}
&
.normal
{
background
:
#2c5ca6
;
color
:white
;
}
&
.notes
{
background
:
#2c5c66
;
color
:white
;
...
...
app/controllers/issues_controller.rb
View file @
a0171813
...
...
@@ -34,7 +34,7 @@ class IssuesController < ApplicationController
end
def
show
@notes
=
@issue
.
notes
@notes
=
@issue
.
notes
.
order
(
"created_at ASC"
)
@note
=
@project
.
notes
.
new
(
:noteable
=>
@issue
)
end
...
...
app/views/issues/_show.html.haml
View file @
a0171813
...
...
@@ -7,7 +7,7 @@
=
truncate
issue
.
assignee
.
name
,
:lenght
=>
20
%td
##{issue.id}
%td
=
truncate
(
html_escape
(
issue
.
title
),
:length
=>
5
0
)
=
truncate
(
html_escape
(
issue
.
title
),
:length
=>
6
0
)
%br
-
if
issue
.
critical
%span
.tag.high
critical
...
...
app/views/issues/show.html.haml
View file @
a0171813
%h2
=
"Issue #
#{
@issue
.
id
}
-
#{
truncate
@issue
.
title
,
:length
=>
50
}
"
=
"Issue #
#{
@issue
.
id
}
-
#{
html_escape
(
@issue
.
title
)
}
"
.span-15
-#= simple_format html_escape(@issue.content)
.issue_notes
=
render
"notes/notes"
...
...
@@ -29,6 +28,16 @@
%td
=
image_tag
gravatar_icon
(
@issue
.
assignee
.
email
),
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding:0 5px;"
=
@issue
.
assignee
.
name
%tr
%td
Tags
%td
-
if
@issue
.
critical
%span
.tag.high
critical
-
else
%span
.tag.normal
normal
-
if
@issue
.
today?
%span
.tag.today
today
%tr
%td
Closed?
%td
...
...
db/migrate/20111027152724_issue_conten_to_note.rb
View file @
a0171813
class
IssueContenToNote
<
ActiveRecord
::
Migration
def
up
raise
"Not ready
"
puts
"Issue content is deprecated -> move to notes
"
Issue
.
find_each
(
:batch_size
=>
100
)
do
|
issue
|
next
if
issue
.
content
.
blank?
note
=
Note
.
new
(
:note
=>
issue
.
content
,
:project_id
=>
issue
.
project_id
,
:noteable
=>
issue
,
:created_at
=>
issue
.
created_at
,
:updated_at
=>
issue
.
created_at
)
note
.
author_id
=
issue
.
author_id
if
note
.
save
issue
.
update_attributes
(
:content
=>
nil
)
print
"."
else
print
"F"
end
end
total
=
Issue
.
where
(
"content is not null"
).
count
if
total
>
0
puts
"content of
#{
total
}
issues were not migrated"
else
puts
"Done"
end
end
...
...
db/schema.rb
View file @
a0171813
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
201110271
42641
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
201110271
52724
)
do
create_table
"issues"
,
:force
=>
true
do
|
t
|
t
.
string
"title"
...
...
spec/factories.rb
View file @
a0171813
...
...
@@ -32,7 +32,6 @@ end
Factory
.
add
(
:issue
,
Issue
)
do
|
obj
|
obj
.
title
=
Faker
::
Lorem
.
sentence
obj
.
content
=
Faker
::
Lorem
.
sentences
end
Factory
.
add
(
:snippet
,
Snippet
)
do
|
obj
|
...
...
spec/requests/issues_spec.rb
View file @
a0171813
...
...
@@ -80,7 +80,6 @@ describe "Issues" do
describe
"fill in"
do
before
do
fill_in
"issue_title"
,
:with
=>
"bug 345"
fill_in
"issue_content"
,
:with
=>
"app bug 345"
click_link
"Select user"
click_link
@user
.
name
end
...
...
@@ -112,6 +111,23 @@ describe "Issues" do
end
end
describe
"Show issue"
do
before
do
@issue
=
Factory
:issue
,
:author
=>
@user
,
:assignee
=>
@user
,
:project
=>
project
visit
project_issue_path
(
project
,
@issue
)
end
it
"should have valid show page for issue"
do
page
.
should
have_content
@issue
.
title
page
.
should
have_content
@user
.
name
page
.
should
have_content
"today"
end
end
describe
"Edit issue"
,
:js
=>
true
do
before
do
@issue
=
Factory
:issue
,
...
...
@@ -129,7 +145,6 @@ describe "Issues" do
describe
"fill in"
do
before
do
fill_in
"issue_title"
,
:with
=>
"bug 345"
fill_in
"issue_content"
,
:with
=>
"app bug 345"
end
it
{
expect
{
click_button
"Save"
}.
to_not
change
{
Issue
.
count
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment