BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
2cc16584
Commit
2cc16584
authored
Jul 25, 2017
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Project New moved to external File
parent
4eebd8e1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
43 deletions
+46
-43
project_new.js
app/assets/javascripts/projects/project_new.js
+43
-0
new.html.haml
app/views/projects/new.html.haml
+2
-43
webpack.config.js
config/webpack.config.js
+1
-0
No files found.
app/assets/javascripts/projects/project_new.js
0 → 100644
View file @
2cc16584
document
.
addEventListener
(
'DOMContentLoaded'
,
()
=>
{
const
importBtnTooltip
=
'Please enter a valid project name.'
;
const
$importBtnWrapper
=
$
(
'.import_gitlab_project'
);
$
(
'.how_to_import_link'
).
bind
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
this
).
next
(
'.modal'
).
show
();
});
$
(
'.modal-header .close'
).
bind
(
'click'
,
()
=>
{
$
(
'.modal'
).
hide
();
});
$
(
'.btn_import_gitlab_project'
).
bind
(
'click'
,
()
=>
{
const
importHref
=
$
(
'a.btn_import_gitlab_project'
).
attr
(
'href'
);
$
(
'.btn_import_gitlab_project'
).
attr
(
'href'
,
`
${
importHref
}
?namespace_id=
${
$
(
'#project_namespace_id'
).
val
()}
&path=
${
$
(
'#project_path'
).
val
()}
`
);
});
$
(
'.btn_import_gitlab_project'
).
attr
(
'disabled'
,
$
(
'#project_path'
).
val
().
trim
().
length
===
0
);
$importBtnWrapper
.
attr
(
'title'
,
importBtnTooltip
);
$
(
'#new_project'
).
submit
(()
=>
{
const
$path
=
$
(
'#project_path'
);
$path
.
val
(
$path
.
val
().
trim
());
});
$
(
'#project_path'
).
keyup
(()
=>
{
if
(
$
(
this
).
val
().
trim
().
length
!==
0
)
{
$
(
'.btn_import_gitlab_project'
).
attr
(
'disabled'
,
false
);
$importBtnWrapper
.
attr
(
'title'
,
''
);
$importBtnWrapper
.
removeClass
(
'has-tooltip'
);
}
else
{
$
(
'.btn_import_gitlab_project'
).
attr
(
'disabled'
,
true
);
$importBtnWrapper
.
addClass
(
'has-tooltip'
);
}
});
$
(
'#project_import_url'
).
disable
();
$
(
'.import_git'
).
click
(()
=>
{
const
$projectImportUrl
=
$
(
'#project_import_url'
);
$projectImportUrl
.
attr
(
'disabled'
,
!
$projectImportUrl
.
attr
(
'disabled'
));
});
});
app/views/projects/new.html.haml
View file @
2cc16584
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
-
page_title
'New Project'
-
page_title
'New Project'
-
header_title
"Projects"
,
dashboard_projects_path
-
header_title
"Projects"
,
dashboard_projects_path
-
visibility_level
=
params
.
dig
(
:project
,
:visibility_level
)
||
default_project_visibility
-
visibility_level
=
params
.
dig
(
:project
,
:visibility_level
)
||
default_project_visibility
-
content_for
:page_specific_javascripts
do
=
webpack_bundle_tag
'project_new'
.project-edit-container
.project-edit-container
.project-edit-errors
.project-edit-errors
...
@@ -111,46 +113,3 @@
...
@@ -111,46 +113,3 @@
%i
.fa.fa-spinner.fa-spin
%i
.fa.fa-spinner.fa-spin
Creating project
&
repository.
Creating project
&
repository.
%p
Please wait a moment, this page will automatically refresh when ready.
%p
Please wait a moment, this page will automatically refresh when ready.
:javascript
var
importBtnTooltip
=
"Please enter a valid project name."
;
var
$importBtnWrapper
=
$
(
'.import_gitlab_project'
);
$
(
'.how_to_import_link'
).
bind
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
var
import_modal
=
$
(
this
).
next
(
".modal"
).
show
();
});
$
(
'.modal-header .close'
).
bind
(
'click'
,
function
()
{
$
(
".modal"
).
hide
();
});
$
(
'.btn_import_gitlab_project'
).
bind
(
'click'
,
function
()
{
var
_href
=
$
(
"a.btn_import_gitlab_project"
).
attr
(
"href"
);
$
(
".btn_import_gitlab_project"
).
attr
(
"href"
,
_href
+
'?namespace_id='
+
$
(
"#project_namespace_id"
).
val
()
+
'&path='
+
$
(
"#project_path"
).
val
());
});
$
(
'.btn_import_gitlab_project'
).
attr
(
'disabled'
,
$
(
'#project_path'
).
val
().
trim
().
length
===
0
);
$importBtnWrapper
.
attr
(
'title'
,
importBtnTooltip
);
$
(
'#new_project'
).
submit
(
function
(){
var
$path
=
$
(
'#project_path'
);
$path
.
val
(
$path
.
val
().
trim
());
});
$
(
'#project_path'
).
keyup
(
function
(){
if
(
$
(
this
).
val
().
trim
().
length
!==
0
)
{
$
(
'.btn_import_gitlab_project'
).
attr
(
'disabled'
,
false
);
$importBtnWrapper
.
attr
(
'title'
,
''
);
$importBtnWrapper
.
removeClass
(
'has-tooltip'
);
}
else
{
$
(
'.btn_import_gitlab_project'
).
attr
(
'disabled'
,
true
);
$importBtnWrapper
.
addClass
(
'has-tooltip'
);
}
});
$
(
'#project_import_url'
).
disable
();
$
(
'.import_git'
).
click
(
function
(
event
)
{
$projectImportUrl
=
$
(
'#project_import_url'
);
$projectImportUrl
.
attr
(
'disabled'
,
!
$projectImportUrl
.
attr
(
'disabled'
));
});
config/webpack.config.js
View file @
2cc16584
...
@@ -56,6 +56,7 @@ var config = {
...
@@ -56,6 +56,7 @@ var config = {
pipelines
:
'./pipelines/pipelines_bundle.js'
,
pipelines
:
'./pipelines/pipelines_bundle.js'
,
pipelines_details
:
'./pipelines/pipeline_details_bundle.js'
,
pipelines_details
:
'./pipelines/pipeline_details_bundle.js'
,
profile
:
'./profile/profile_bundle.js'
,
profile
:
'./profile/profile_bundle.js'
,
project_new
:
'./projects/project_new.js'
,
prometheus_metrics
:
'./prometheus_metrics'
,
prometheus_metrics
:
'./prometheus_metrics'
,
protected_branches
:
'./protected_branches'
,
protected_branches
:
'./protected_branches'
,
protected_tags
:
'./protected_tags'
,
protected_tags
:
'./protected_tags'
,
...
...
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