summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-20 16:52:23 -0700
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-20 16:52:23 -0700
commit6ef20926ee4cd7cefc6aaff9346a964a34f64a89 (patch)
tree4793bddfac03fb082d0741e3a2f3f2c9fd13092c
parent476199e0691edd956764ace45264511048fe6eb1 (diff)
downloadgitlab-ce-6ef20926ee4cd7cefc6aaff9346a964a34f64a89.tar.gz
Add location to user profile
-rw-r--r--CHANGELOG1
-rw-r--r--app/controllers/profiles_controller.rb2
-rw-r--r--app/views/profiles/show.html.haml3
-rw-r--r--db/migrate/20150320234437_add_location_to_user.rb5
-rw-r--r--db/schema.rb3
-rw-r--r--features/steps/profile/profile.rb2
6 files changed, 14 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index e0676b30ce8..b33e2565522 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,6 +9,7 @@ v 7.10.0 (unreleased)
- Improve diff UI
- Fix alignment of navbar toggle button (Cody Mize)
- Identical look of selectboxes in UI
+ - Add location field to user profile
v 7.9.0 (unreleased)
- Add HipChat integration documentation (Stan Hu)
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb
index 1b9a86ee42c..fcdd5b8b1d1 100644
--- a/app/controllers/profiles_controller.rb
+++ b/app/controllers/profiles_controller.rb
@@ -68,7 +68,7 @@ class ProfilesController < ApplicationController
params.require(:user).permit(
:email, :password, :password_confirmation, :bio, :name, :username,
:skype, :linkedin, :twitter, :website_url, :color_scheme_id, :theme_id,
- :avatar, :hide_no_ssh_key, :hide_no_password
+ :avatar, :hide_no_ssh_key, :hide_no_password, :location
)
end
end
diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml
index 409b6b5a193..5a501e43149 100644
--- a/app/views/profiles/show.html.haml
+++ b/app/views/profiles/show.html.haml
@@ -54,6 +54,9 @@
= f.label :website_url, 'Website', class: "control-label"
.col-sm-10= f.text_field :website_url, class: "form-control"
.form-group
+ = f.label :location, 'Location', class: "control-label"
+ .col-sm-10= f.text_field :location, class: "form-control"
+ .form-group
= f.label :bio, class: "control-label"
.col-sm-10
= f.text_area :bio, rows: 4, class: "form-control", maxlength: 250
diff --git a/db/migrate/20150320234437_add_location_to_user.rb b/db/migrate/20150320234437_add_location_to_user.rb
new file mode 100644
index 00000000000..32731d37d75
--- /dev/null
+++ b/db/migrate/20150320234437_add_location_to_user.rb
@@ -0,0 +1,5 @@
+class AddLocationToUser < ActiveRecord::Migration
+ def change
+ add_column :users, :location, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 1be3782dcb3..e1a5b70532a 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20150313012111) do
+ActiveRecord::Schema.define(version: 20150320234437) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -473,6 +473,7 @@ ActiveRecord::Schema.define(version: 20150313012111) do
t.boolean "password_automatically_set", default: false
t.string "bitbucket_access_token"
t.string "bitbucket_access_token_secret"
+ t.string "location"
end
add_index "users", ["admin"], name: "index_users_on_admin", using: :btree
diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb
index bfbfe7af199..791982d16c3 100644
--- a/features/steps/profile/profile.rb
+++ b/features/steps/profile/profile.rb
@@ -11,6 +11,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
fill_in "user_linkedin", with: "testlinkedin"
fill_in "user_twitter", with: "testtwitter"
fill_in "user_website_url", with: "testurl"
+ fill_in "user_location", with: "Ukraine"
click_button "Save changes"
@user.reload
end
@@ -20,6 +21,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
@user.linkedin.should == 'testlinkedin'
@user.twitter.should == 'testtwitter'
@user.website_url.should == 'testurl'
+ find("#user_location").value.should == "Ukraine"
end
step 'I change my avatar' do