diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-21 00:54:03 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-21 00:54:03 +0000 |
commit | f0d052b6e73066ad451685f5a3dfdb1032cf95ea (patch) | |
tree | fc4da12d719c7e41a98a66c10a8a05163d726e50 | |
parent | 52c3a3a0d29c37275e22da71dbabead7b3dd0609 (diff) | |
parent | d85f396fe55e0c8d6593bbd2dcb06990da48d9b7 (diff) | |
download | gitlab-ce-f0d052b6e73066ad451685f5a3dfdb1032cf95ea.tar.gz |
Merge branch 'user-location' into 'master'
Location field in user profile
Twitter allows you to set string with location information.
I find it very useful in work to know where user from. It allows to communicate with knowing time difference and cultural things.
See merge request !411
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/controllers/profiles_controller.rb | 2 | ||||
-rw-r--r-- | app/views/profiles/show.html.haml | 3 | ||||
-rw-r--r-- | app/views/users/_profile.html.haml | 4 | ||||
-rw-r--r-- | db/migrate/20150320234437_add_location_to_user.rb | 5 | ||||
-rw-r--r-- | db/schema.rb | 3 | ||||
-rw-r--r-- | features/steps/profile/profile.rb | 2 |
7 files changed, 18 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG index 07d0b5920bd..4c644960088 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,7 @@ v 7.10.0 (unreleased) - Move "Import existing repository by URL" option to button. - Improve error message when save profile has error. - Passing the name of pushed ref to CI service (requires GitLab CI 7.9+) + - 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 3c7f45d559b..9252e85e8cc 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -69,7 +69,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/app/views/users/_profile.html.haml b/app/views/users/_profile.html.haml index 0a70b738071..a073e5048e7 100644 --- a/app/views/users/_profile.html.haml +++ b/app/views/users/_profile.html.haml @@ -21,6 +21,10 @@ %li %span.light Website: %strong= link_to user.short_website_url, user.full_website_url + - unless user.location.blank? + %li + %span.light Location: + %strong= user.location - unless user.bio.blank? %li %span.light Bio: 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 |