Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
69e41250
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,体验更适合开发者的 AI 搜索 >>
提交
69e41250
编写于
7月 28, 2012
作者:
R
randx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Styled New/Edit Project for admin area
上级
21781043
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
62 addition
and
55 deletion
+62
-55
app/views/admin/projects/_form.html.haml
app/views/admin/projects/_form.html.haml
+46
-37
app/views/admin/projects/edit.html.haml
app/views/admin/projects/edit.html.haml
+2
-2
app/views/admin/projects/new.html.haml
app/views/admin/projects/new.html.haml
+2
-2
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+2
-2
spec/requests/admin/admin_projects_spec.rb
spec/requests/admin/admin_projects_spec.rb
+10
-12
未找到文件。
app/views/admin/projects/_form.html.haml
浏览文件 @
69e41250
=
form_for
[
:admin
,
@admin_
project
]
do
|
f
|
-
if
@admin_
project
.
errors
.
any?
=
form_for
[
:admin
,
project
]
do
|
f
|
-
if
project
.
errors
.
any?
.alert-message.block-message.error
%ul
-
@admin_
project
.
errors
.
full_messages
.
each
do
|
msg
|
-
project
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
.clearfix
=
f
.
label
:name
.input
=
f
.
text_field
:name
.clearfix
=
f
.
label
:path
do
Path
.clearfix.project_name_holder
=
f
.
label
:name
do
Project name is
.input
.input-prepend
%span
.add-on
=
Gitlab
.
config
.
ssh_path
=
f
.
text_field
:path
,
:placeholder
=>
"example_project"
,
:disabled
=>
!
@admin_project
.
new_record?
.clearfix
=
f
.
label
:code
do
Code
.input
.input-prepend
%span
.add-on
=
web_app_url
=
f
.
text_field
:code
,
:placeholder
=>
"example"
=
f
.
text_field
:name
,
:placeholder
=>
"Example Project"
,
:class
=>
"xxlarge"
=
f
.
submit
project
.
new_record?
?
'Create project'
:
'Save Project'
,
:class
=>
"btn primary"
-
unless
@admin_project
.
new_record?
%hr
.alert.alert-info
%h5
Advanced settings:
.clearfix
=
f
.
label
:path
do
Git Clone
.input
.input-prepend
%span
.add-on
=
Gitlab
.
config
.
ssh_path
=
f
.
text_field
:path
,
:placeholder
=>
"example_project"
,
:disabled
=>
!!
project
.
id
%span
.add-on
=
".git"
.clearfix
=
f
.
label
:owner_id
.input
=
f
.
select
:owner_id
,
User
.
all
.
map
{
|
user
|
[
user
.
name
,
user
.
id
]
}
=
f
.
label
:code
do
URL
.input
.input-prepend
%span
.add-on
=
web_app_url
=
f
.
text_field
:code
,
:placeholder
=>
"example"
-
if
@admin_project
.
repo_exists
?
-
unless
project
.
new_record
?
.clearfix
=
f
.
label
:
default_branch
,
"Default Branch"
.input
=
f
.
select
(
:default_branch
,
@admin_project
.
heads
.
map
(
&
:name
),
{},
:style
=>
"width:210px;"
)
=
f
.
label
:
owner_id
.input
=
f
.
select
:owner_id
,
User
.
all
.
map
{
|
user
|
[
user
.
name
,
user
.
id
]
}
.well
%h5
Features
-
if
project
.
repo_exists?
.clearfix
=
f
.
label
:default_branch
,
"Default Branch"
.input
=
f
.
select
(
:default_branch
,
project
.
heads
.
map
(
&
:name
),
{},
:style
=>
"width:210px;"
)
-
unless
project
.
new_record?
.alert.alert-info
%h5
Features:
.clearfix
=
f
.
label
:issues_enabled
,
"Issues"
...
...
@@ -48,19 +57,19 @@
=
f
.
label
:wall_enabled
,
"Wall"
.input
=
f
.
check_box
:wall_enabled
.clearfix
=
f
.
label
:description
.input
=
f
.
text_area
:description
,
:class
=>
"xxlarge"
.clear
%br
.actions
=
f
.
submit
'Save'
,
:class
=>
"btn primary"
=
link_to
'Cancel'
,
[
:admin
,
@admin_project
],
:class
=>
"btn"
-
unless
@admin_project
.
new_record?
=
link_to
'Destroy'
,
[
:admin
,
@admin_project
],
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"btn danger right"
.clearfix
=
f
.
label
:wiki_enabled
,
"Wiki"
.input
=
f
.
check_box
:wiki_enabled
-
unless
project
.
new_record?
.actions
=
f
.
submit
'Save Project'
,
:class
=>
"btn primary"
:javascript
$
(
function
(){
$
(
'
#project_owner_id
'
).
chosen
();
new
Projects
();
})
app/views/admin/projects/edit.html.haml
浏览文件 @
69e41250
%h3
=
@admin_project
.
name
%h3
.page_title
#{
@admin_project
.
name
}
→
Edit project
%hr
=
render
'form'
=
render
'form'
,
:project
=>
@admin_project
app/views/admin/projects/new.html.haml
浏览文件 @
69e41250
%h
2
New project
%h
3
.page_title
New project
%hr
=
render
'form'
=
render
'form'
,
:project
=>
@admin_project
app/views/admin/projects/show.html.haml
浏览文件 @
69e41250
...
...
@@ -25,9 +25,9 @@
%tr
%td
%b
Description
:
Owner
:
%td
=
@admin_project
.
description
=
@admin_project
.
owner
.
name
%tr
%td
%b
...
...
spec/requests/admin/admin_projects_spec.rb
浏览文件 @
69e41250
...
...
@@ -41,15 +41,15 @@ describe "Admin::Projects" do
end
it
"should have project edit page"
do
page
.
should
have_content
(
"
N
ame"
)
page
.
should
have_content
(
"
Code
"
)
page
.
should
have_content
(
"
Project n
ame"
)
page
.
should
have_content
(
"
URL
"
)
end
describe
"Update project"
do
before
do
fill_in
"project_name"
,
:with
=>
"Big Bang"
fill_in
"project_code"
,
:with
=>
"BB1"
click_button
"Save"
click_button
"Save
Project
"
@project
.
reload
end
...
...
@@ -76,20 +76,19 @@ describe "Admin::Projects" do
end
it
"should have labels for new project"
do
page
.
should
have_content
(
"
Name
"
)
page
.
should
have_content
(
"
Path
"
)
page
.
should
have_content
(
"
Description
"
)
page
.
should
have_content
(
"
Project name is
"
)
page
.
should
have_content
(
"
Git Clone
"
)
page
.
should
have_content
(
"
URL
"
)
end
end
describe
"POST /admin/projects"
do
before
do
visit
new_admin_project_path
fill_in
'Name'
,
:with
=>
'NewProject'
fill_in
'Code'
,
:with
=>
'NPR'
fill_in
'Path'
,
:with
=>
'gitlabhq_1'
fill_in
'Description'
,
:with
=>
'New Project Description'
expect
{
click_button
"Save"
}.
to
change
{
Project
.
count
}.
by
(
1
)
fill_in
'project_name'
,
:with
=>
'NewProject'
fill_in
'project_code'
,
:with
=>
'NPR'
fill_in
'project_path'
,
:with
=>
'gitlabhq_1'
expect
{
click_button
"Create project"
}.
to
change
{
Project
.
count
}.
by
(
1
)
@project
=
Project
.
last
end
...
...
@@ -100,7 +99,6 @@ describe "Admin::Projects" do
it
"should show project"
do
page
.
should
have_content
(
@project
.
name
)
page
.
should
have_content
(
@project
.
path
)
page
.
should
have_content
(
@project
.
description
)
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录