Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
3fa770dd
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3fa770dd
编写于
10月 28, 2011
作者:
G
gitlabhq
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'new_issue' into dev
上级
89fa800e
a0171813
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
84 addition
and
18 deletion
+84
-18
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/models/issue.rb
app/models/issue.rb
+3
-3
app/views/issues/_form.html.haml
app/views/issues/_form.html.haml
+4
-4
app/views/issues/_show.html.haml
app/views/issues/_show.html.haml
+1
-1
app/views/issues/index.html.haml
app/views/issues/index.html.haml
+1
-1
app/views/issues/show.html.haml
app/views/issues/show.html.haml
+17
-3
app/views/issues/update.js.haml
app/views/issues/update.js.haml
+1
-1
db/migrate/20111027152724_issue_conten_to_note.rb
db/migrate/20111027152724_issue_conten_to_note.rb
+34
-0
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
未找到文件。
app/assets/stylesheets/projects.css.scss
浏览文件 @
3fa770dd
...
...
@@ -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
浏览文件 @
3fa770dd
...
...
@@ -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/models/issue.rb
浏览文件 @
3fa770dd
...
...
@@ -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
)
...
...
app/views/issues/_form.html.haml
浏览文件 @
3fa770dd
...
...
@@ -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"
})
...
...
app/views/issues/_show.html.haml
浏览文件 @
3fa770dd
...
...
@@ -7,7 +7,7 @@
=
truncate
issue
.
assignee
.
name
,
:lenght
=>
20
%td
##{issue.id}
%td
=
html_escape
issue
.
title
=
truncate
(
html_escape
(
issue
.
title
),
:length
=>
60
)
%br
-
if
issue
.
critical
%span
.tag.high
critical
...
...
app/views/issues/index.html.haml
浏览文件 @
3fa770dd
...
...
@@ -45,7 +45,7 @@
});
$
(
'
.delete-issue
'
).
live
(
'
ajax:success
'
,
function
()
{
$
(
this
).
closest
(
'
tr
'
).
fadeOut
();
});
$
(
this
).
closest
(
'
tr
'
).
fadeOut
();
updatePage
();
});
function
setSortable
(){
$
(
'
#issues-table>tbody
'
).
sortable
({
...
...
app/views/issues/show.html.haml
浏览文件 @
3fa770dd
%h2
=
"Issue #
#{
@issue
.
id
}
-
#{
@issue
.
title
}
"
=
"Issue #
#{
@issue
.
id
}
-
#{
html_escape
(
@issue
.
title
)
}
"
.span-15
=
simple_format
html_escape
(
@issue
.
content
)
-#
= simple_format html_escape(@issue.content)
.issue_notes
=
render
"notes/notes"
.span-8.right
.span-8
...
...
@@ -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
...
...
@@ -39,5 +48,10 @@
-
else
=
check_box_tag
"closed"
,
1
,
@issue
.
closed
,
:disabled
=>
true
-
if
can?
(
current_user
,
:admin_issue
,
@issue
)
.clear
=
link_to
'Edit'
,
edit_project_issue_path
(
@project
,
@issue
),
:class
=>
"lbutton positive"
,
:remote
=>
true
.right
=
link_to
'Destroy'
,
[
@project
,
@issue
],
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"lbutton delete-issue negative"
,
:id
=>
"destroy_issue_
#{
@issue
.
id
}
"
.clear
app/views/issues/update.js.haml
浏览文件 @
3fa770dd
...
...
@@ -6,7 +6,7 @@
-
if
@issue
.
valid?
:plain
$("#edit_issue_dialog").dialog("close");
$.ajax({type: "GET", url: location.href, dataType: "script"}
);
updatePage(
);
-
else
:plain
$("#edit_issue_dialog").empty();
...
...
db/migrate/20111027152724_issue_conten_to_note.rb
0 → 100644
浏览文件 @
3fa770dd
class
IssueContenToNote
<
ActiveRecord
::
Migration
def
up
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
def
down
end
end
db/schema.rb
浏览文件 @
3fa770dd
...
...
@@ -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
浏览文件 @
3fa770dd
...
...
@@ -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
浏览文件 @
3fa770dd
...
...
@@ -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
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录