Commit f0d052b6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

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
parents 52c3a3a0 d85f396f
......@@ -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)
......
......@@ -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
......@@ -53,6 +53,9 @@
.form-group
= 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
......
......@@ -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:
......
class AddLocationToUser < ActiveRecord::Migration
def change
add_column :users, :location, :string
end
end
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment