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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
69e41250
Commit
69e41250
authored
Jul 28, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Styled New/Edit Project for admin area
parent
21781043
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
55 deletions
+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
No files found.
app/views/admin/projects/_form.html.haml
View file @
69e41250
=
form_for
[
:admin
,
@admin_
project
]
do
|
f
|
=
form_for
[
:admin
,
project
]
do
|
f
|
-
if
@admin_
project
.
errors
.
any?
-
if
project
.
errors
.
any?
.alert-message.block-message.error
.alert-message.block-message.error
%ul
%ul
-
@admin_
project
.
errors
.
full_messages
.
each
do
|
msg
|
-
project
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
%li
=
msg
.clearfix
.clearfix.project_name_holder
=
f
.
label
:name
=
f
.
label
:name
do
.input
=
f
.
text_field
:name
Project name is
.clearfix
=
f
.
label
:path
do
Path
.input
.input
.input-prepend
=
f
.
text_field
:name
,
:placeholder
=>
"Example Project"
,
:class
=>
"xxlarge"
%span
.add-on
=
Gitlab
.
config
.
ssh_path
=
f
.
submit
project
.
new_record?
?
'Create project'
:
'Save Project'
,
:class
=>
"btn primary"
=
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"
-
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
.clearfix
=
f
.
label
:owner_id
=
f
.
label
:code
do
.input
=
f
.
select
:owner_id
,
User
.
all
.
map
{
|
user
|
[
user
.
name
,
user
.
id
]
}
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
.clearfix
=
f
.
label
:
default_branch
,
"Default Branch"
=
f
.
label
:
owner_id
.input
=
f
.
select
(
:default_branch
,
@admin_project
.
heads
.
map
(
&
:name
),
{},
:style
=>
"width:210px;"
)
.input
=
f
.
select
:owner_id
,
User
.
all
.
map
{
|
user
|
[
user
.
name
,
user
.
id
]
}
.well
-
if
project
.
repo_exists?
%h5
Features
.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
.clearfix
=
f
.
label
:issues_enabled
,
"Issues"
=
f
.
label
:issues_enabled
,
"Issues"
...
@@ -48,19 +57,19 @@
...
@@ -48,19 +57,19 @@
=
f
.
label
:wall_enabled
,
"Wall"
=
f
.
label
:wall_enabled
,
"Wall"
.input
=
f
.
check_box
:wall_enabled
.input
=
f
.
check_box
:wall_enabled
.clearfix
.clearfix
=
f
.
label
:description
=
f
.
label
:wiki_enabled
,
"Wiki"
.input
=
f
.
text_area
:description
,
:class
=>
"xxlarge"
.input
=
f
.
check_box
:wiki_enabled
.clear
%br
-
unless
project
.
new_record?
.actions
.actions
=
f
.
submit
'Save'
,
:class
=>
"btn primary"
=
f
.
submit
'Save Project'
,
: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"
:javascript
:javascript
$
(
function
(){
$
(
function
(){
$
(
'
#project_owner_id
'
).
chosen
();
$
(
'
#project_owner_id
'
).
chosen
();
new
Projects
();
new
Projects
();
})
})
app/views/admin/projects/edit.html.haml
View file @
69e41250
%h3
=
@admin_project
.
name
%h3
.page_title
#{
@admin_project
.
name
}
→
Edit project
%hr
%hr
=
render
'form'
=
render
'form'
,
:project
=>
@admin_project
app/views/admin/projects/new.html.haml
View file @
69e41250
%h
2
New project
%h
3
.page_title
New project
%hr
%hr
=
render
'form'
=
render
'form'
,
:project
=>
@admin_project
app/views/admin/projects/show.html.haml
View file @
69e41250
...
@@ -25,9 +25,9 @@
...
@@ -25,9 +25,9 @@
%tr
%tr
%td
%td
%b
%b
Description
:
Owner
:
%td
%td
=
@admin_project
.
description
=
@admin_project
.
owner
.
name
%tr
%tr
%td
%td
%b
%b
...
...
spec/requests/admin/admin_projects_spec.rb
View file @
69e41250
...
@@ -41,15 +41,15 @@ describe "Admin::Projects" do
...
@@ -41,15 +41,15 @@ describe "Admin::Projects" do
end
end
it
"should have project edit page"
do
it
"should have project edit page"
do
page
.
should
have_content
(
"
N
ame"
)
page
.
should
have_content
(
"
Project n
ame"
)
page
.
should
have_content
(
"
Code
"
)
page
.
should
have_content
(
"
URL
"
)
end
end
describe
"Update project"
do
describe
"Update project"
do
before
do
before
do
fill_in
"project_name"
,
:with
=>
"Big Bang"
fill_in
"project_name"
,
:with
=>
"Big Bang"
fill_in
"project_code"
,
:with
=>
"BB1"
fill_in
"project_code"
,
:with
=>
"BB1"
click_button
"Save"
click_button
"Save
Project
"
@project
.
reload
@project
.
reload
end
end
...
@@ -76,20 +76,19 @@ describe "Admin::Projects" do
...
@@ -76,20 +76,19 @@ describe "Admin::Projects" do
end
end
it
"should have labels for new project"
do
it
"should have labels for new project"
do
page
.
should
have_content
(
"
Name
"
)
page
.
should
have_content
(
"
Project name is
"
)
page
.
should
have_content
(
"
Path
"
)
page
.
should
have_content
(
"
Git Clone
"
)
page
.
should
have_content
(
"
Description
"
)
page
.
should
have_content
(
"
URL
"
)
end
end
end
end
describe
"POST /admin/projects"
do
describe
"POST /admin/projects"
do
before
do
before
do
visit
new_admin_project_path
visit
new_admin_project_path
fill_in
'Name'
,
:with
=>
'NewProject'
fill_in
'project_name'
,
:with
=>
'NewProject'
fill_in
'Code'
,
:with
=>
'NPR'
fill_in
'project_code'
,
:with
=>
'NPR'
fill_in
'Path'
,
:with
=>
'gitlabhq_1'
fill_in
'project_path'
,
:with
=>
'gitlabhq_1'
fill_in
'Description'
,
:with
=>
'New Project Description'
expect
{
click_button
"Create project"
}.
to
change
{
Project
.
count
}.
by
(
1
)
expect
{
click_button
"Save"
}.
to
change
{
Project
.
count
}.
by
(
1
)
@project
=
Project
.
last
@project
=
Project
.
last
end
end
...
@@ -100,7 +99,6 @@ describe "Admin::Projects" do
...
@@ -100,7 +99,6 @@ describe "Admin::Projects" do
it
"should show project"
do
it
"should show project"
do
page
.
should
have_content
(
@project
.
name
)
page
.
should
have_content
(
@project
.
name
)
page
.
should
have_content
(
@project
.
path
)
page
.
should
have_content
(
@project
.
path
)
page
.
should
have_content
(
@project
.
description
)
end
end
end
end
...
...
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