2015-05-01 04:39:11 -04:00
|
|
|
- page_title 'New Project'
|
2016-05-26 12:06:11 -04:00
|
|
|
- header_title "Projects", dashboard_projects_path
|
2015-12-02 08:27:29 -05:00
|
|
|
|
2013-08-12 10:21:57 -04:00
|
|
|
.project-edit-container
|
2013-05-14 05:46:41 -04:00
|
|
|
.project-edit-errors
|
2013-05-14 05:56:03 -04:00
|
|
|
= render 'projects/errors'
|
2016-06-07 21:10:55 -04:00
|
|
|
.row.prepend-top-default
|
|
|
|
.col-lg-3.profile-settings-sidebar
|
|
|
|
%h4.prepend-top-0
|
|
|
|
New project
|
|
|
|
%p
|
|
|
|
Create or Import your project from popular Git services
|
|
|
|
.col-lg-9
|
|
|
|
= form_for @project, html: { class: 'new_project' } do |f|
|
|
|
|
%fieldset.append-bottom-0
|
|
|
|
.form-group.col-xs-12.col-sm-6
|
|
|
|
= f.label :namespace_id, class: 'label-light' do
|
|
|
|
%span
|
|
|
|
Project path
|
|
|
|
.form-group
|
|
|
|
.input-group
|
|
|
|
- if current_user.can_select_namespace?
|
|
|
|
.input-group-addon
|
|
|
|
= root_url
|
|
|
|
= f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user, display_path: true), {}, {class: 'select2 js-select-namespace', tabindex: 1}
|
2016-05-02 11:22:38 -04:00
|
|
|
|
2015-08-14 09:56:33 -04:00
|
|
|
- else
|
2016-06-07 21:10:55 -04:00
|
|
|
.input-group-addon.static-namespace
|
|
|
|
#{root_url}#{current_user.username}/
|
2016-10-19 14:42:35 -04:00
|
|
|
= f.hidden_field :namespace_id, value: current_user.namespace_id
|
2016-06-07 21:10:55 -04:00
|
|
|
.form-group.col-xs-12.col-sm-6.project-path
|
|
|
|
= f.label :namespace_id, class: 'label-light' do
|
|
|
|
%span
|
|
|
|
Project name
|
|
|
|
= f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 2, autofocus: true, required: true
|
|
|
|
- if current_user.can_create_group?
|
|
|
|
.help-block
|
|
|
|
Want to house several dependent projects under the same namespace?
|
|
|
|
= link_to "Create a group", new_group_path
|
|
|
|
|
|
|
|
- if import_sources_enabled?
|
|
|
|
.project-import.js-toggle-container
|
|
|
|
.form-group.clearfix
|
|
|
|
= f.label :visibility_level, class: 'label-light' do
|
|
|
|
Import project from
|
|
|
|
.col-sm-12.import-buttons
|
|
|
|
%div
|
|
|
|
- if github_import_enabled?
|
2016-05-02 11:22:38 -04:00
|
|
|
= link_to new_import_github_path, class: 'btn import_github' do
|
2016-08-08 03:40:29 -04:00
|
|
|
= icon('github', text: 'GitHub')
|
2016-06-07 21:10:55 -04:00
|
|
|
%div
|
|
|
|
- if bitbucket_import_enabled?
|
2016-08-10 05:10:04 -04:00
|
|
|
= link_to status_import_bitbucket_path, class: "btn import_bitbucket #{'how_to_import_link' unless bitbucket_import_configured?}", "data-no-turbolink" => "true" do
|
|
|
|
= icon('bitbucket', text: 'Bitbucket')
|
|
|
|
- unless bitbucket_import_configured?
|
2016-06-07 21:10:55 -04:00
|
|
|
= render 'bitbucket_import_modal'
|
|
|
|
%div
|
|
|
|
- if gitlab_import_enabled?
|
2016-09-02 02:19:14 -04:00
|
|
|
= link_to status_import_gitlab_path, class: "btn import_gitlab #{'how_to_import_link' unless gitlab_import_configured?}" do
|
2016-08-10 05:10:04 -04:00
|
|
|
= icon('gitlab', text: 'GitLab.com')
|
|
|
|
- unless gitlab_import_configured?
|
2016-06-07 21:10:55 -04:00
|
|
|
= render 'gitlab_import_modal'
|
|
|
|
%div
|
|
|
|
- if google_code_import_enabled?
|
|
|
|
= link_to new_import_google_code_path, class: 'btn import_google_code' do
|
2016-08-08 03:40:29 -04:00
|
|
|
= icon('google', text: 'Google Code')
|
2016-06-07 21:10:55 -04:00
|
|
|
%div
|
|
|
|
- if fogbugz_import_enabled?
|
|
|
|
= link_to new_import_fogbugz_path, class: 'btn import_fogbugz' do
|
2016-08-08 03:40:29 -04:00
|
|
|
= icon('bug', text: 'Fogbugz')
|
2016-12-15 11:31:14 -05:00
|
|
|
%div
|
|
|
|
- if gitea_import_enabled?
|
|
|
|
= link_to new_import_gitea_url, class: 'btn import_gitea' do
|
|
|
|
= custom_icon('go_logo')
|
|
|
|
Gitea
|
2016-06-07 21:10:55 -04:00
|
|
|
%div
|
|
|
|
- if git_import_enabled?
|
|
|
|
= link_to "#", class: 'btn js-toggle-button import_git' do
|
2016-08-08 03:40:29 -04:00
|
|
|
= icon('git', text: 'Repo by URL')
|
2016-07-20 09:50:21 -04:00
|
|
|
%div{ class: 'import_gitlab_project' }
|
2016-08-29 03:46:05 -04:00
|
|
|
- if gitlab_project_import_enabled?
|
2016-07-20 09:50:21 -04:00
|
|
|
= link_to new_import_gitlab_project_path, class: 'btn btn_import_gitlab_project project-submit' do
|
2016-08-08 03:40:29 -04:00
|
|
|
= icon('gitlab', text: 'GitLab export')
|
2016-06-07 21:10:55 -04:00
|
|
|
|
|
|
|
.js-toggle-content.hide
|
|
|
|
= render "shared/import_form", f: f
|
|
|
|
|
|
|
|
.form-group
|
|
|
|
= f.label :description, class: 'label-light' do
|
|
|
|
Project description
|
|
|
|
%span.light (optional)
|
|
|
|
= f.text_area :description, placeholder: 'Description format', class: "form-control", rows: 3, maxlength: 250
|
|
|
|
|
|
|
|
.form-group.project-visibility-level-holder
|
|
|
|
= f.label :visibility_level, class: 'label-light' do
|
|
|
|
Visibility Level
|
2016-05-16 18:06:26 -04:00
|
|
|
= link_to "(?)", help_page_path("public_access/public_access")
|
2016-11-03 09:47:15 -04:00
|
|
|
= render 'shared/visibility_level', f: f, visibility_level: default_project_visibility, can_change_visibility_level: true, form_model: @project
|
|
|
|
|
2013-05-14 05:46:41 -04:00
|
|
|
|
2013-08-01 09:20:18 -04:00
|
|
|
= f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4
|
2015-12-02 08:31:15 -05:00
|
|
|
= link_to 'Cancel', dashboard_projects_path, class: 'btn btn-cancel'
|
2013-05-14 05:46:41 -04:00
|
|
|
|
2014-01-01 14:42:42 -05:00
|
|
|
.save-project-loader.hide
|
2014-06-21 03:41:44 -04:00
|
|
|
.center
|
2014-02-05 13:30:57 -05:00
|
|
|
%h2
|
2014-10-01 18:21:29 -04:00
|
|
|
%i.fa.fa-spinner.fa-spin
|
2014-02-05 13:30:57 -05:00
|
|
|
Creating project & repository.
|
2013-08-12 10:21:57 -04:00
|
|
|
%p Please wait a moment, this page will automatically refresh when ready.
|
2015-02-05 13:31:36 -05:00
|
|
|
|
2015-11-10 06:17:37 -05:00
|
|
|
:javascript
|
|
|
|
$('.how_to_import_link').bind('click', function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
var import_modal = $(this).next(".modal").show();
|
|
|
|
});
|
2016-06-15 11:31:00 -04:00
|
|
|
|
2015-11-10 06:17:37 -05:00
|
|
|
$('.modal-header .close').bind('click', function() {
|
|
|
|
$(".modal").hide();
|
|
|
|
});
|
2016-06-15 11:31:00 -04:00
|
|
|
|
2016-07-20 09:50:21 -04:00
|
|
|
$('.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());
|
2016-04-27 09:01:55 -04:00
|
|
|
});
|
2016-06-15 11:31:00 -04:00
|
|
|
|
2016-07-20 09:50:21 -04:00
|
|
|
$('.btn_import_gitlab_project').attr('disabled',true)
|
2016-07-20 10:09:43 -04:00
|
|
|
$('.import_gitlab_project').attr('title', 'Project path and name required.');
|
2016-06-15 11:31:00 -04:00
|
|
|
|
|
|
|
$('.import_gitlab_project').click(function( event ) {
|
2016-07-20 09:50:21 -04:00
|
|
|
if($('.btn_import_gitlab_project').attr('disabled')) {
|
2016-06-15 11:31:00 -04:00
|
|
|
event.preventDefault();
|
2016-07-20 10:09:43 -04:00
|
|
|
new Flash("Please enter path and name for the project to be imported to.");
|
2016-06-15 11:31:00 -04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-10-06 05:31:01 -04:00
|
|
|
$('#new_project').submit(function(){
|
|
|
|
var $path = $('#project_path');
|
|
|
|
$path.val($path.val().trim());
|
|
|
|
});
|
|
|
|
|
2016-06-15 11:31:00 -04:00
|
|
|
$('#project_path').keyup(function(){
|
|
|
|
if($(this).val().length !=0) {
|
2016-07-20 09:50:21 -04:00
|
|
|
$('.btn_import_gitlab_project').attr('disabled', false);
|
2016-06-15 11:31:00 -04:00
|
|
|
$('.import_gitlab_project').attr('title','');
|
|
|
|
$(".flash-container").html("")
|
|
|
|
} else {
|
2016-07-20 09:50:21 -04:00
|
|
|
$('.btn_import_gitlab_project').attr('disabled',true);
|
2016-07-20 10:09:43 -04:00
|
|
|
$('.import_gitlab_project').attr('title', 'Project path and name required.');
|
2016-06-15 11:31:00 -04:00
|
|
|
}
|
2016-07-13 11:01:24 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
$('.import_git').click(function( event ) {
|
2016-07-14 10:14:30 -04:00
|
|
|
$projectImportUrl = $('#project_import_url')
|
|
|
|
$projectImportUrl.attr('disabled', !$projectImportUrl.attr('disabled'))
|
2016-08-08 03:40:29 -04:00
|
|
|
});
|