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
470aa767
Commit
470aa767
authored
Nov 23, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix project.code-related functionality
parent
c50ec72b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
9 additions
and
16 deletions
+9
-16
app/models/project.rb
app/models/project.rb
+1
-1
app/views/admin/groups/index.html.haml
app/views/admin/groups/index.html.haml
+2
-2
app/views/admin/groups/show.html.haml
app/views/admin/groups/show.html.haml
+2
-2
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+0
-6
app/views/dashboard/_groups.html.haml
app/views/dashboard/_groups.html.haml
+1
-1
app/views/layouts/_init_auto_complete.html.haml
app/views/layouts/_init_auto_complete.html.haml
+1
-1
app/views/layouts/project_resource.html.haml
app/views/layouts/project_resource.html.haml
+1
-1
spec/factories.rb
spec/factories.rb
+1
-2
No files found.
app/models/project.rb
View file @
470aa767
...
@@ -86,7 +86,7 @@ class Project < ActiveRecord::Base
...
@@ -86,7 +86,7 @@ class Project < ActiveRecord::Base
def
create_by_user
(
params
,
user
)
def
create_by_user
(
params
,
user
)
namespace_id
=
params
.
delete
(
:namespace_id
)
namespace_id
=
params
.
delete
(
:namespace_id
)
namespace_id
||=
current_
user
.
namespace_id
namespace_id
||=
user
.
namespace_id
project
=
Project
.
new
params
project
=
Project
.
new
params
...
...
app/views/admin/groups/index.html.haml
View file @
470aa767
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
%table
%table
%thead
%thead
%th
Name
%th
Name
%th
Code
%th
Path
%th
Projects
%th
Projects
%th
Edit
%th
Edit
%th
.cred
Danger Zone!
%th
.cred
Danger Zone!
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
-
@groups
.
each
do
|
group
|
-
@groups
.
each
do
|
group
|
%tr
%tr
%td
=
link_to
group
.
name
,
[
:admin
,
group
]
%td
=
link_to
group
.
name
,
[
:admin
,
group
]
%td
=
group
.
code
%td
=
group
.
path
%td
=
group
.
projects
.
count
%td
=
group
.
projects
.
count
%td
=
link_to
'Edit'
,
edit_admin_group_path
(
group
),
id:
"edit_
#{
dom_id
(
group
)
}
"
,
class:
"btn small"
%td
=
link_to
'Edit'
,
edit_admin_group_path
(
group
),
id:
"edit_
#{
dom_id
(
group
)
}
"
,
class:
"btn small"
%td
.bgred
=
link_to
'Destroy'
,
[
:admin
,
group
],
confirm:
"REMOVE
#{
group
.
name
}
? Are you sure?"
,
method: :delete
,
class:
"btn small danger"
%td
.bgred
=
link_to
'Destroy'
,
[
:admin
,
group
],
confirm:
"REMOVE
#{
group
.
name
}
? Are you sure?"
,
method: :delete
,
class:
"btn small danger"
...
...
app/views/admin/groups/show.html.haml
View file @
470aa767
...
@@ -20,9 +20,9 @@
...
@@ -20,9 +20,9 @@
%tr
%tr
%td
%td
%b
%b
Code
:
Path
:
%td
%td
=
@group
.
code
=
@group
.
path
%tr
%tr
%td
%td
%b
%b
...
...
app/views/admin/projects/show.html.haml
View file @
470aa767
...
@@ -26,12 +26,6 @@
...
@@ -26,12 +26,6 @@
Name:
Name:
%td
%td
=
@project
.
name
=
@project
.
name
%tr
%td
%b
Code:
%td
=
@project
.
code
%tr
%tr
%td
%td
%b
%b
...
...
app/views/dashboard/_groups.html.haml
View file @
470aa767
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
%ul
.unstyled
%ul
.unstyled
-
groups
.
each
do
|
group
|
-
groups
.
each
do
|
group
|
%li
.wll
%li
.wll
=
link_to
group_path
(
id:
group
.
code
),
class:
dom_class
(
group
)
do
=
link_to
group_path
(
id:
group
.
path
),
class:
dom_class
(
group
)
do
%strong
.group_name
=
truncate
(
group
.
name
,
length:
25
)
%strong
.group_name
=
truncate
(
group
.
name
,
length:
25
)
%span
.arrow
%span
.arrow
→
→
...
...
app/views/layouts/_init_auto_complete.html.haml
View file @
470aa767
:javascript
:javascript
$
(
function
()
{
$
(
function
()
{
GitLab
.
GfmAutoComplete
.
Members
.
url
=
"
#{
"/api/v2/projects/#{@project.
code
}/members"
if
@project
}
"
;
GitLab
.
GfmAutoComplete
.
Members
.
url
=
"
#{
"/api/v2/projects/#{@project.
path
}/members"
if
@project
}
"
;
GitLab
.
GfmAutoComplete
.
Members
.
params
.
private_token
=
"
#{
current_user
.
private_token
}
"
;
GitLab
.
GfmAutoComplete
.
Members
.
params
.
private_token
=
"
#{
current_user
.
private_token
}
"
;
GitLab
.
GfmAutoComplete
.
Emoji
.
data
=
#{
raw
emoji_autocomplete_source
}
;
GitLab
.
GfmAutoComplete
.
Emoji
.
data
=
#{
raw
emoji_autocomplete_source
}
;
...
...
app/views/layouts/project_resource.html.haml
View file @
470aa767
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
.container
.container
%ul
.main_menu
%ul
.main_menu
=
nav_link
(
html_options:
{
class:
"home
#{
project_tab_class
}
"
})
do
=
nav_link
(
html_options:
{
class:
"home
#{
project_tab_class
}
"
})
do
=
link_to
@project
.
code
,
project_path
(
@project
),
title:
"Project"
=
link_to
@project
.
path
,
project_path
(
@project
),
title:
"Project"
-
if
@project
.
repo_exists?
-
if
@project
.
repo_exists?
-
if
can?
current_user
,
:download_code
,
@project
-
if
can?
current_user
,
:download_code
,
@project
...
...
spec/factories.rb
View file @
470aa767
...
@@ -26,13 +26,12 @@ FactoryGirl.define do
...
@@ -26,13 +26,12 @@ FactoryGirl.define do
factory
:project
do
factory
:project
do
sequence
(
:name
)
{
|
n
|
"project
#{
n
}
"
}
sequence
(
:name
)
{
|
n
|
"project
#{
n
}
"
}
path
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
path
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
code
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
owner
owner
end
end
factory
:namespace
do
factory
:namespace
do
sequence
(
:name
)
{
|
n
|
"group
#{
n
}
"
}
sequence
(
:name
)
{
|
n
|
"group
#{
n
}
"
}
code
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
path
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
owner
owner
factory
:group
do
factory
:group
do
...
...
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