diff --git a/app/assets/templates/shared/_member_form.html.erb b/app/assets/templates/shared/_member_form.html.erb index 390b96d32..1da9ff41a 100644 --- a/app/assets/templates/shared/_member_form.html.erb +++ b/app/assets/templates/shared/_member_form.html.erb @@ -226,7 +226,19 @@ placeholder="{{ 'website' | translate }} (http://...)" ng-disabled="preventField['profile.website'] && user.profile.website && !userForm['user[profile_attributes][website]'].$dirty"/> - {{ 'phone_number_is_required' }} + + +
+
+ + +
diff --git a/app/controllers/api/members_controller.rb b/app/controllers/api/members_controller.rb index c5dbdcd63..001aa097f 100644 --- a/app/controllers/api/members_controller.rb +++ b/app/controllers/api/members_controller.rb @@ -139,14 +139,14 @@ class API::MembersController < API::ApiController def user_params if current_user.id == params[:id].to_i params.require(:user).permit(:username, :email, :password, :password_confirmation, :group_id, :is_allow_contact, - profile_attributes: [:id, :first_name, :last_name, :gender, :birthday, :phone, :interest, :software_mastered, :website, + profile_attributes: [:id, :first_name, :last_name, :gender, :birthday, :phone, :interest, :software_mastered, :website, :job, :facebook, :twitter, :google_plus, :viadeo, :linkedin, :instagram, :youtube, :vimeo, :dailymotion, :github, :echosciences, :pinterest, :lastfm, :flickr, :user_avatar_attributes => [:id, :attachment, :_destroy], :address_attributes => [:id, :address]]) elsif current_user.is_admin? params.require(:user).permit(:username, :email, :password, :password_confirmation, :invoicing_disabled, :is_allow_contact, :group_id, training_ids: [], tag_ids: [], - profile_attributes: [:id, :first_name, :last_name, :gender, :birthday, :phone, :interest, :software_mastered, :website, + profile_attributes: [:id, :first_name, :last_name, :gender, :birthday, :phone, :interest, :software_mastered, :website, :job, :facebook, :twitter, :google_plus, :viadeo, :linkedin, :instagram, :youtube, :vimeo, :dailymotion, :github, :echosciences, :pinterest, :lastfm, :flickr, user_avatar_attributes: [:id, :attachment, :_destroy], address_attributes: [:id, :address]]) diff --git a/app/views/api/members/show.json.jbuilder b/app/views/api/members/show.json.jbuilder index 1b0b95e25..5c23588dd 100644 --- a/app/views/api/members/show.json.jbuilder +++ b/app/views/api/members/show.json.jbuilder @@ -20,6 +20,7 @@ json.profile do end if @member.profile.address json.phone @member.profile.phone json.website @member.profile.website + json.job @member.profile.job json.extract! @member.profile, :facebook, :twitter, :google_plus, :viadeo, :linkedin, :instagram, :youtube, :vimeo, :dailymotion, :github, :echosciences, :pinterest, :lastfm, :flickr end json.subscribed_plan do diff --git a/config/locales/app.shared.en.yml b/config/locales/app.shared.en.yml index 85b37a682..c97ba5523 100644 --- a/config/locales/app.shared.en.yml +++ b/config/locales/app.shared.en.yml @@ -105,6 +105,7 @@ en: date_of_birth: "Date of birth" date_of_birth_is_required: "Date of birth is required." website: "Website" + job: "Occupation" project: # project edition form diff --git a/config/locales/app.shared.fr.yml b/config/locales/app.shared.fr.yml index 69c2070e2..9f773f22e 100644 --- a/config/locales/app.shared.fr.yml +++ b/config/locales/app.shared.fr.yml @@ -105,6 +105,7 @@ fr: date_of_birth: "Date de naissance" date_of_birth_is_required: "La date de naissance est requise." website: "Site web" + job: "Profession" project: # formulaire d'étition d'un projet diff --git a/db/migrate/20160526102307_add_job_to_profile.rb b/db/migrate/20160526102307_add_job_to_profile.rb new file mode 100644 index 000000000..d2345b101 --- /dev/null +++ b/db/migrate/20160526102307_add_job_to_profile.rb @@ -0,0 +1,5 @@ +class AddJobToProfile < ActiveRecord::Migration + def change + add_column :profiles, :job, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index bad6a7aa2..1085aac04 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: 20160526095550) do +ActiveRecord::Schema.define(version: 20160526102307) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -326,6 +326,7 @@ ActiveRecord::Schema.define(version: 20160526095550) do t.string "pinterest" t.string "lastfm" t.string "flickr" + t.string "job" end add_index "profiles", ["user_id"], name: "index_profiles_on_user_id", using: :btree