Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-04-22 18:44:59 +0300
committerJames Lopez <james@jameslopez.es>2016-04-22 18:44:59 +0300
commitacf297955a5546161ac5e52589ba4740f234a0ae (patch)
treee52ac7029d34478af08b7d6627dc348f1f2e60cd
parentb18bd9c85f0d925aaa6ecf531673958bd97082fc (diff)
gitlab import UI - icon, file selector, etc... Also updated font-awesome and modified import source settings.
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock4
-rw-r--r--app/assets/javascripts/behaviors/toggler_behavior.coffee1
-rw-r--r--app/controllers/application_controller.rb6
-rw-r--r--app/models/application_setting.rb2
-rw-r--r--app/views/projects/_project_import_form.html.haml8
-rw-r--r--app/views/projects/new.html.haml9
-rw-r--r--db/schema.rb4
-rw-r--r--lib/gitlab/current_settings.rb2
-rw-r--r--lib/gitlab/import_sources.rb1
10 files changed, 30 insertions, 9 deletions
diff --git a/Gemfile b/Gemfile
index 67cc3f34b8c..f8bd26f36f3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -213,7 +213,7 @@ gem 'jquery-turbolinks', '~> 2.1.0'
gem 'addressable', '~> 2.3.8'
gem 'bootstrap-sass', '~> 3.3.0'
-gem 'font-awesome-rails', '~> 4.2'
+gem 'font-awesome-rails', '~> 4.6.1'
gem 'gitlab_emoji', '~> 0.3.0'
gem 'gon', '~> 6.0.1'
gem 'jquery-atwho-rails', '~> 1.3.2'
diff --git a/Gemfile.lock b/Gemfile.lock
index b00d7b35c84..7ce19ba7b70 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -322,7 +322,7 @@ GEM
fog-xml (0.1.2)
fog-core
nokogiri (~> 1.5, >= 1.5.11)
- font-awesome-rails (4.5.0.1)
+ font-awesome-rails (4.6.1.0)
railties (>= 3.2, < 5.1)
foreman (0.78.0)
thor (~> 0.19.1)
@@ -931,7 +931,7 @@ DEPENDENCIES
flay
flog
fog (~> 1.36.0)
- font-awesome-rails (~> 4.2)
+ font-awesome-rails (~> 4.6.1)
foreman
fuubar (~> 2.0.0)
gemnasium-gitlab-service (~> 0.2)
diff --git a/app/assets/javascripts/behaviors/toggler_behavior.coffee b/app/assets/javascripts/behaviors/toggler_behavior.coffee
index 177b6918270..640cdfe15f6 100644
--- a/app/assets/javascripts/behaviors/toggler_behavior.coffee
+++ b/app/assets/javascripts/behaviors/toggler_behavior.coffee
@@ -7,6 +7,7 @@ $ ->
# %div.js-toggle-content
#
$("body").on "click", ".js-toggle-button", (e) ->
+ console.log(e);
$(@).find('i').
toggleClass('fa fa-chevron-down').
toggleClass('fa fa-chevron-up')
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 1c53b0b21a3..7afde111a34 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -23,7 +23,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
helper_method :abilities, :can?, :current_application_settings
- helper_method :import_sources_enabled?, :github_import_enabled?, :github_import_configured?, :gitlab_import_enabled?, :gitlab_import_configured?, :bitbucket_import_enabled?, :bitbucket_import_configured?, :gitorious_import_enabled?, :google_code_import_enabled?, :fogbugz_import_enabled?, :git_import_enabled?
+ helper_method :import_sources_enabled?, :github_import_enabled?, :github_import_configured?, :gitlab_import_enabled?, :gitlab_import_configured?, :bitbucket_import_enabled?, :bitbucket_import_configured?, :gitorious_import_enabled?, :google_code_import_enabled?, :fogbugz_import_enabled?, :git_import_enabled?, :gitlab_project_import_enabled?
rescue_from Encoding::CompatibilityError do |exception|
log_exception(exception)
@@ -325,6 +325,10 @@ class ApplicationController < ActionController::Base
current_application_settings.import_sources.include?('git')
end
+ def gitlab_project_import_enabled?
+ current_application_settings.import_sources.include?('gitlab_project')
+ end
+
def two_factor_authentication_required?
current_application_settings.require_two_factor_authentication
end
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index 36f88154232..4e2c7c82406 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -147,7 +147,7 @@ class ApplicationSetting < ActiveRecord::Base
default_project_visibility: Settings.gitlab.default_projects_features['visibility_level'],
default_snippet_visibility: Settings.gitlab.default_projects_features['visibility_level'],
restricted_signup_domains: Settings.gitlab['restricted_signup_domains'],
- import_sources: ['github','bitbucket','gitlab','gitorious','google_code','fogbugz','git'],
+ import_sources: ['github','bitbucket','gitlab','gitorious','google_code','fogbugz','git', 'gitlab_project'],
shared_runners_enabled: Settings.gitlab_ci['shared_runners_enabled'],
max_artifacts_size: Settings.artifacts['max_size'],
require_two_factor_authentication: false,
diff --git a/app/views/projects/_project_import_form.html.haml b/app/views/projects/_project_import_form.html.haml
new file mode 100644
index 00000000000..62d4b55424c
--- /dev/null
+++ b/app/views/projects/_project_import_form.html.haml
@@ -0,0 +1,8 @@
+.form-group.import-url-data
+ = f.label :import_url, class: 'control-label' do
+ %span GitLab export file
+ .col-sm-10
+ = f.file_field :file, class: ''
+
+ .well.prepend-top-20
+ The project must have a valid Gitlab export format \ No newline at end of file
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
index a4c6094c69a..cf24c4cacf3 100644
--- a/app/views/projects/new.html.haml
+++ b/app/views/projects/new.html.haml
@@ -88,10 +88,17 @@
- if git_import_enabled?
= link_to "#", class: 'btn js-toggle-button import_git' do
%i.fa.fa-git
- %span Any repo by URL
+ %span Repo by URL
+
+ - if gitlab_project_import_enabled?
+ = link_to "#", class: 'btn import_gitlab_project', onclick: '$(".js-toggle-content2").toggle();' do
+ %i.fa.fa-gitlab
+ %span GitLab project
.js-toggle-content.hide
= render "shared/import_form", f: f
+ .js-toggle-content2.hide
+ = render "project_import_form", f: f
.prepend-botton-10
diff --git a/db/schema.rb b/db/schema.rb
index 42457d92353..f7dfd296aea 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -78,8 +78,8 @@ ActiveRecord::Schema.define(version: 20160421130527) do
t.boolean "email_author_in_body", default: false
t.integer "default_group_visibility"
t.boolean "repository_checks_enabled", default: false
- t.integer "metrics_packet_size", default: 1
t.text "shared_runners_text"
+ t.integer "metrics_packet_size", default: 1
end
create_table "audit_events", force: :cascade do |t|
@@ -426,9 +426,9 @@ ActiveRecord::Schema.define(version: 20160421130527) do
t.string "state"
t.integer "iid"
t.integer "updated_by_id"
- t.integer "moved_to_id"
t.boolean "confidential", default: false
t.datetime "deleted_at"
+ t.integer "moved_to_id"
t.date "due_date"
end
diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb
index f44d1b3a44e..688e780c13d 100644
--- a/lib/gitlab/current_settings.rb
+++ b/lib/gitlab/current_settings.rb
@@ -29,7 +29,7 @@ module Gitlab
default_project_visibility: Settings.gitlab.default_projects_features['visibility_level'],
default_snippet_visibility: Settings.gitlab.default_projects_features['visibility_level'],
restricted_signup_domains: Settings.gitlab['restricted_signup_domains'],
- import_sources: ['github','bitbucket','gitlab','gitorious','google_code','fogbugz','git'],
+ import_sources: ['github','bitbucket','gitlab','gitorious','google_code','fogbugz','git', 'gitlab_project'],
shared_runners_enabled: Settings.gitlab_ci['shared_runners_enabled'],
max_artifacts_size: Settings.artifacts['max_size'],
require_two_factor_authentication: false,
diff --git a/lib/gitlab/import_sources.rb b/lib/gitlab/import_sources.rb
index ccfdfbe73e8..2b5658a8b64 100644
--- a/lib/gitlab/import_sources.rb
+++ b/lib/gitlab/import_sources.rb
@@ -21,6 +21,7 @@ module Gitlab
'Google Code' => 'google_code',
'FogBugz' => 'fogbugz',
'Any repo by URL' => 'git',
+ 'GitLab project' => 'gitlab_project'
}
end