Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
6e6b729dad7a
Commit
6e6b729d
authored
Nov 11, 2015
by
Douwe Maan
Browse files
Add Project#safe_import_url helper.
parent
7503a6c81a90
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/helpers/projects_helper.rb
View file @
6e6b729d
...
...
@@ -253,14 +253,6 @@
filename_path
(
project
,
:version
)
end
def
hidden_pass_url
(
original_url
)
result
=
URI
(
original_url
)
result
.
password
=
'*****'
unless
result
.
password
.
nil?
result
rescue
original_url
end
def
project_wiki_path_with_version
(
proj
,
page
,
version
,
is_newest
)
url_params
=
is_newest
?
{}
:
{
version_id:
version
}
namespace_project_wiki_path
(
proj
.
namespace
,
proj
,
page
,
url_params
)
...
...
app/models/project.rb
View file @
6e6b729d
...
...
@@ -348,6 +348,14 @@
import_status
==
'finished'
end
def
safe_import_url
result
=
URI
.
parse
(
self
.
import_url
)
result
.
password
=
'*****'
unless
result
.
password
.
nil?
result
.
to_s
rescue
original_url
end
def
check_limit
unless
creator
.
can_create_project?
or
namespace
.
kind
==
'group'
errors
[
:limit_reached
]
<<
(
"Your project limit is
#{
creator
.
projects_limit
}
projects! Please contact your administrator to increase it"
)
...
...
app/views/projects/imports/show.html.haml
View file @
6e6b729d
...
...
@@ -8,7 +8,7 @@
-
else
Import in progress.
-
unless
@project
.
forked?
%p
.monospace
git clone --bare
#{
hidden_pass_url
(
@project
.
import_url
)
}
%p
.monospace
git clone --bare
#{
@project
.
safe_
import_url
}
%p
Please wait while we import the repository for you. Refresh at will.
:javascript
new
ProjectImport
();
Write
Preview
Supports
Markdown
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