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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
a8e4fb61
Commit
a8e4fb61
authored
Nov 25, 2011
by
gitlabhq
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/issue_with_branch'
parents
c3ea3c57
4aad057f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
110 additions
and
49 deletions
+110
-49
app/assets/stylesheets/issues.css.scss
app/assets/stylesheets/issues.css.scss
+4
-1
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+1
-0
app/controllers/issues_controller.rb
app/controllers/issues_controller.rb
+8
-1
app/models/issue.rb
app/models/issue.rb
+5
-0
app/views/issues/edit.html.haml
app/views/issues/edit.html.haml
+37
-0
app/views/issues/show.html.haml
app/views/issues/show.html.haml
+38
-46
db/migrate/20111124115339_add_extra_field_to_issue.rb
db/migrate/20111124115339_add_extra_field_to_issue.rb
+5
-0
db/schema.rb
db/schema.rb
+12
-1
No files found.
app/assets/stylesheets/issues.css.scss
View file @
a8e4fb61
...
@@ -44,4 +44,7 @@
...
@@ -44,4 +44,7 @@
}
}
}
}
.issue
:hover
.action-links
{
display
:block
;
}
.issue
:hover
.action-links
{
display
:block
;
}
.issue-show-holder
{
width
:
100%
;
.data
p
{
font-size
:
16px
}
}
app/assets/stylesheets/projects.css.scss
View file @
a8e4fb61
...
@@ -160,6 +160,7 @@ input.ssh_project_url {
...
@@ -160,6 +160,7 @@ input.ssh_project_url {
.new_issue
,
.new_issue
,
.new_note
,
.new_note
,
.edit_user
,
.edit_user
,
.edit_issue
,
.new_project
,
.new_project
,
.new_snippet
,
.new_snippet
,
.edit_snippet
,
.edit_snippet
,
...
...
app/controllers/issues_controller.rb
View file @
a8e4fb61
...
@@ -9,7 +9,7 @@ class IssuesController < ApplicationController
...
@@ -9,7 +9,7 @@ class IssuesController < ApplicationController
before_filter
:authorize_read_issue!
before_filter
:authorize_read_issue!
before_filter
:authorize_write_issue!
,
:only
=>
[
:new
,
:create
,
:close
,
:edit
,
:update
,
:sort
]
before_filter
:authorize_write_issue!
,
:only
=>
[
:new
,
:create
,
:close
,
:edit
,
:update
,
:sort
]
respond_to
:js
respond_to
:js
,
:html
def
index
def
index
@issues
=
case
params
[
:f
].
to_i
@issues
=
case
params
[
:f
].
to_i
...
@@ -41,6 +41,13 @@ class IssuesController < ApplicationController
...
@@ -41,6 +41,13 @@ class IssuesController < ApplicationController
@notes
=
@issue
.
notes
.
inc_author
.
order
(
"created_at DESC"
).
limit
(
20
)
@notes
=
@issue
.
notes
.
inc_author
.
order
(
"created_at DESC"
).
limit
(
20
)
@note
=
@project
.
notes
.
new
(
:noteable
=>
@issue
)
@note
=
@project
.
notes
.
new
(
:noteable
=>
@issue
)
@commits
=
if
@issue
.
branch_name
&&
@project
.
repo
.
heads
.
map
(
&
:name
).
include?
(
@issue
.
branch_name
)
@project
.
repo
.
commits_between
(
"master"
,
@issue
.
branch_name
)
else
[]
end
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
format
.
js
{
respond_with_notes
}
format
.
js
{
respond_with_notes
}
...
...
app/models/issue.rb
View file @
a8e4fb61
...
@@ -15,6 +15,11 @@ class Issue < ActiveRecord::Base
...
@@ -15,6 +15,11 @@ class Issue < ActiveRecord::Base
:to
=>
:author
,
:to
=>
:author
,
:prefix
=>
true
:prefix
=>
true
delegate
:name
,
:email
,
:to
=>
:assignee
,
:prefix
=>
true
validates
:title
,
validates
:title
,
:presence
=>
true
,
:presence
=>
true
,
:length
=>
{
:within
=>
0
..
255
}
:length
=>
{
:within
=>
0
..
255
}
...
...
app/views/issues/edit.html.haml
0 → 100644
View file @
a8e4fb61
%div
.issue-form-holder
=
form_for
[
@project
,
@issue
]
do
|
f
|
-
if
@issue
.
errors
.
any?
%ul
-
@issue
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
%table
%thead
%th
Name
%th
Value
%tr
%td
=
f
.
label
:title
%td
=
f
.
text_area
:title
,
:style
=>
"width:450px; height:100px"
,
:maxlength
=>
255
%tr
%td
=
f
.
label
:assignee_id
%td
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
})
-#%tr
%td= f.label :branch_name
%td= f.select(:branch_name, @project.heads.map(&:name), { :include_blank => "Select git branch" })
%tr
%td
=
f
.
label
:critical
,
"Critical"
%br
%td
=
f
.
check_box
:critical
-
unless
@issue
.
new_record?
%tr
%td
=
f
.
label
:closed
%td
=
f
.
check_box
:closed
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
:javascript
$
(
function
(){
$
(
'
select#issue_branch_name
'
).
selectmenu
({
width
:
300
});
$
(
'
select#issue_assignee_id
'
).
selectmenu
({
width
:
300
});
});
app/views/issues/show.html.haml
View file @
a8e4fb61
%h2
.issue-show-holder.ui-box
%
strong
%
h3
Issue
=
"Issue #
#{
@issue
.
id
}
"
=
"#
#{
@issue
.
id
}
"
.right
–
-
if
@issue
.
closed
=
html_escape
(
@issue
.
title
)
%span
.tag.high
Resolved
.left.width-65p
-
else
.issue_notes
=
render
"notes/notes"
%span
.tag.today
Open
.loading
{
:style
=>
"display:none;"
}
.data
%center
=
image_tag
"ajax-loader.gif"
%p
=
@issue
.
title
.right.width-30p
.span-8
%table
.round-borders
%tr
%td
Author:
%td
=
image_tag
gravatar_icon
(
@issue
.
author
.
email
),
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding:0 5px;"
=
@issue
.
author
.
name
%tr
%td
Assignee:
%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?
-
if
@issue
.
author
==
@issue
.
assignee
%span
.tag.today
today
=
image_tag
gravatar_icon
(
@issue
.
assignee_email
),
:width
=>
20
,
:style
=>
"padding:0 5px;"
%tr
=
@issue
.
assignee_name
%td
Closed?
-
else
%td
=
image_tag
gravatar_icon
(
@issue
.
author_email
),
:width
=>
20
,
:style
=>
"padding:0 5px;"
-
if
can?
current_user
,
:write_issue
,
@issue
=
@issue
.
author_name
=
form_for
([
@project
,
@issue
])
do
|
f
|
→
=
f
.
check_box
:closed
,
:onclick
=>
"$(this).parent().submit();"
=
image_tag
gravatar_icon
(
@issue
.
assignee_email
),
:width
=>
20
,
:style
=>
"padding:0 5px;"
=
hidden_field_tag
:status_only
,
true
=
@issue
.
assignee_name
-
else
.right
=
check_box_tag
"closed"
,
1
,
@issue
.
closed
,
:disabled
=>
true
%cite
.cgray
=
@issue
.
created_at
.
stamp
(
"21 Aug 2011, 11:15pm"
)
-
if
can?
(
current_user
,
:write_issue
,
@issue
)
.clear
.clear
%br
=
link_to
'Edit'
,
edit_project_issue_path
(
@project
,
@issue
),
:class
=>
"grey-button positive"
,
:remote
=>
true
.buttons
.right
=
link_to
'Destroy'
,
[
@project
,
@issue
],
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"grey-button delete-issue negative"
,
:id
=>
"destroy_issue_
#{
@issue
.
id
}
"
-
if
can?
current_user
,
:write_issue
,
@issue
-
if
@issue
.
closed
=
link_to
'Reopen'
,
project_issue_path
(
@project
,
@issue
,
:issue
=>
{
:closed
=>
false
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"grey-button"
-
else
=
link_to
'Resolve'
,
project_issue_path
(
@project
,
@issue
,
:issue
=>
{
:closed
=>
true
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"grey-button"
.right
=
link_to
'Edit'
,
edit_project_issue_path
(
@project
,
@issue
),
:class
=>
"grey-button positive"
.clear
%br
%br
.issue_notes
=
render
"notes/notes"
.loading
{
:style
=>
"display:none;"
}
%center
=
image_tag
"ajax-loader.gif"
.clear
.clear
db/migrate/20111124115339_add_extra_field_to_issue.rb
0 → 100644
View file @
a8e4fb61
class
AddExtraFieldToIssue
<
ActiveRecord
::
Migration
def
change
add_column
:issues
,
:branch_name
,
:string
,
:null
=>
true
end
end
db/schema.rb
View file @
a8e4fb61
...
@@ -11,7 +11,17 @@
...
@@ -11,7 +11,17 @@
#
#
# It's strongly recommended to check this file into your version control system.
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
20111115063954
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
20111124115339
)
do
create_table
"features"
,
:force
=>
true
do
|
t
|
t
.
string
"name"
t
.
string
"branch_name"
t
.
integer
"assignee_id"
t
.
integer
"author_id"
t
.
integer
"project_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
end
create_table
"issues"
,
:force
=>
true
do
|
t
|
create_table
"issues"
,
:force
=>
true
do
|
t
|
t
.
string
"title"
t
.
string
"title"
...
@@ -23,6 +33,7 @@ ActiveRecord::Schema.define(:version => 20111115063954) do
...
@@ -23,6 +33,7 @@ ActiveRecord::Schema.define(:version => 20111115063954) do
t
.
boolean
"closed"
,
:default
=>
false
,
:null
=>
false
t
.
boolean
"closed"
,
:default
=>
false
,
:null
=>
false
t
.
integer
"position"
,
:default
=>
0
t
.
integer
"position"
,
:default
=>
0
t
.
boolean
"critical"
,
:default
=>
false
,
:null
=>
false
t
.
boolean
"critical"
,
:default
=>
false
,
:null
=>
false
t
.
string
"branch_name"
end
end
create_table
"keys"
,
:force
=>
true
do
|
t
|
create_table
"keys"
,
:force
=>
true
do
|
t
|
...
...
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