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) ...@@ -14,6 +14,7 @@ v 7.10.0 (unreleased)
- Move "Import existing repository by URL" option to button. - Move "Import existing repository by URL" option to button.
- Improve error message when save profile has error. - Improve error message when save profile has error.
- Passing the name of pushed ref to CI service (requires GitLab CI 7.9+) - 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) v 7.9.0 (unreleased)
- Add HipChat integration documentation (Stan Hu) - Add HipChat integration documentation (Stan Hu)
......
...@@ -69,7 +69,7 @@ class ProfilesController < ApplicationController ...@@ -69,7 +69,7 @@ class ProfilesController < ApplicationController
params.require(:user).permit( params.require(:user).permit(
:email, :password, :password_confirmation, :bio, :name, :username, :email, :password, :password_confirmation, :bio, :name, :username,
:skype, :linkedin, :twitter, :website_url, :color_scheme_id, :theme_id, :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
end end
...@@ -53,6 +53,9 @@ ...@@ -53,6 +53,9 @@
.form-group .form-group
= f.label :website_url, 'Website', class: "control-label" = f.label :website_url, 'Website', class: "control-label"
.col-sm-10= f.text_field :website_url, class: "form-control" .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 .form-group
= f.label :bio, class: "control-label" = f.label :bio, class: "control-label"
.col-sm-10 .col-sm-10
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
%li %li
%span.light Website: %span.light Website:
%strong= link_to user.short_website_url, user.full_website_url %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? - unless user.bio.blank?
%li %li
%span.light Bio: %span.light Bio:
......
class AddLocationToUser < ActiveRecord::Migration
def change
add_column :users, :location, :string
end
end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # 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 # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -473,6 +473,7 @@ ActiveRecord::Schema.define(version: 20150313012111) do ...@@ -473,6 +473,7 @@ ActiveRecord::Schema.define(version: 20150313012111) do
t.boolean "password_automatically_set", default: false t.boolean "password_automatically_set", default: false
t.string "bitbucket_access_token" t.string "bitbucket_access_token"
t.string "bitbucket_access_token_secret" t.string "bitbucket_access_token_secret"
t.string "location"
end end
add_index "users", ["admin"], name: "index_users_on_admin", using: :btree add_index "users", ["admin"], name: "index_users_on_admin", using: :btree
......
...@@ -11,6 +11,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps ...@@ -11,6 +11,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
fill_in "user_linkedin", with: "testlinkedin" fill_in "user_linkedin", with: "testlinkedin"
fill_in "user_twitter", with: "testtwitter" fill_in "user_twitter", with: "testtwitter"
fill_in "user_website_url", with: "testurl" fill_in "user_website_url", with: "testurl"
fill_in "user_location", with: "Ukraine"
click_button "Save changes" click_button "Save changes"
@user.reload @user.reload
end end
...@@ -20,6 +21,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps ...@@ -20,6 +21,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
@user.linkedin.should == 'testlinkedin' @user.linkedin.should == 'testlinkedin'
@user.twitter.should == 'testtwitter' @user.twitter.should == 'testtwitter'
@user.website_url.should == 'testurl' @user.website_url.should == 'testurl'
find("#user_location").value.should == "Ukraine"
end end
step 'I change my avatar' do 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