mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-19 13:54:25 +01:00
[feature] profile website + edition of is_allow_contact
This commit is contained in:
parent
a430c0cef7
commit
88de9c3c75
@ -484,9 +484,11 @@ body.container{
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
border-radius: 3px;
|
||||
border: 1px solid transparent;
|
||||
|
||||
&:hover {
|
||||
background-color: $yellow;
|
||||
border: 1px solid $border-color;
|
||||
}
|
||||
}
|
||||
}
|
@ -80,14 +80,6 @@
|
||||
<span class="help-block" ng-show="userForm['user[group_id]'].$dirty && userForm['user[group_id]'].$error.required" translate>{{ 'user_s_profile_is_required' }}</span>
|
||||
</div>
|
||||
|
||||
<!-- allow contact-->
|
||||
<div class="form-group" ng-class="{'has-error': userForm['user[is_allow_contact]'].$dirty && userForm['user[is_allow_contact]'].$invalid}">
|
||||
<input type="checkbox"
|
||||
name="user[is_allow_contact]"
|
||||
ng-model="user.is_allow_contact"
|
||||
value="true"/> {{ 'i_authorize_Fablab_users_registered_on_the_site_to_contact_me' | translate }}
|
||||
</div>
|
||||
|
||||
<!-- accept cgu -->
|
||||
<div class="form-group" ng-class="{'has-error': userForm.cgu.$dirty && userForm.cgu.$invalid}" ng-show="cgu">
|
||||
<input type="checkbox"
|
||||
|
@ -214,6 +214,20 @@
|
||||
<span class="help-block" ng-show="userForm['user[profile_attributes][phone]'].$dirty && userForm['user[profile_attributes][phone]'].$error.required" translate>{{ 'phone_number_is_required' }}</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group" ng-class="{'has-error': userForm['user[profile_attributes][website]'].$dirty && userForm['user[profile_attributes][website]'].$invalid}">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-globe"></i> </span>
|
||||
<input type="url"
|
||||
name="user[profile_attributes][website]"
|
||||
ng-model="user.profile.website"
|
||||
class="form-control"
|
||||
id="user_website"
|
||||
placeholder="{{ 'website' | translate }}"
|
||||
ng-disabled="preventField['profile.website'] && user.profile.website && !userForm['user[profile_attributes][website]'].$dirty"/>
|
||||
</div>
|
||||
<span class="help-block" ng-show="userForm['user[profile_attributes][website]'].$dirty && userForm['user[profile_attributes][website]'].$error.required" translate>{{ 'phone_number_is_required' }}</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="user_interest" translate>{{ 'interests' }}</label>
|
||||
<textarea name="user[profile_attributes][interest]"
|
||||
@ -236,6 +250,20 @@
|
||||
ng-disabled="preventField['profile.software_mastered'] && user.profile.software_mastered && !userForm['user[profile_attributes][software_mastered]'].$dirty"></textarea>
|
||||
</div>
|
||||
|
||||
<!-- allow contact-->
|
||||
<div class="form-group">
|
||||
<label for="allowContact" translate>{{ 'i_authorize_Fablab_users_registered_on_the_site_to_contact_me' }}</label>
|
||||
<input bs-switch
|
||||
ng-model="user.is_allow_contact"
|
||||
id="allowContact"
|
||||
type="checkbox"
|
||||
class="form-control"
|
||||
switch-on-text="{{ 'yes' | translate }}"
|
||||
switch-off-text="{{ 'no' | translate }}"
|
||||
switch-animate="true"/>
|
||||
<input type="hidden" name="user[is_allow_contact]" value="{{user.is_allow_contact}}"/>
|
||||
</div>
|
||||
|
||||
<div id="social" ng-init="social={}">
|
||||
<div class="form-group" ng-show="social.facebook || user.profile.facebook" ng-class="{'has-error': userForm['user[profile_attributes][facebook]'].$dirty && userForm['user[profile_attributes][facebook]'].$invalid}">
|
||||
<div class="input-group">
|
||||
@ -391,20 +419,20 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="social-icons m-b">
|
||||
<div ng-click="social.facebook = !social.facebook" ng-hide="social.facebook || user.profile.facebook"><i class="fa fa-facebook fa-2x"></i></div>
|
||||
<div ng-click="social.twitter = !social.twitter" ng-hide="social.twitter || user.profile.twitter"><i class="fa fa-twitter fa-2x"></i></div>
|
||||
<div ng-click="social.google_plus = !social.google_plus" ng-hide="social.google_plus || user.profile.google_plus"><i class="fa fa-google-plus fa-2x"></i></div>
|
||||
<div ng-click="social.viadeo = !social.viadeo" ng-hide="social.viadeo || user.profile.viadeo"><i class="fa fa-viadeo fa-2x"></i></div>
|
||||
<div ng-click="social.linkedin = !social.linkedin" ng-hide="social.linkedin || user.profile.linkedin"><i class="fa fa-linkedin fa-2x"></i></div>
|
||||
<div ng-click="social.instagram = !social.instagram" ng-hide="social.instagram || user.profile.instagram"><i class="fa fa-instagram fa-2x"></i></div>
|
||||
<div ng-click="social.youtube = !social.youtube" ng-hide="social.youtube || user.profile.youtube"><i class="fa fa-youtube fa-2x"></i></div>
|
||||
<div ng-click="social.vimeo = !social.vimeo" ng-hide="social.vimeo || user.profile.vimeo"><i class="fa fa-vimeo fa-2x"></i></div>
|
||||
<div ng-click="social.dailymotion = !social.dailymotion" ng-hide="social.dailymotion || user.profile.dailymotion"><img src="<%= asset_path('social/dailymotion.png') %>" alt="d" class="fa-img contrast-250 fa-2x"/></div>
|
||||
<div ng-click="social.github = !social.github" ng-hide="social.github || user.profile.github"><i class="fa fa-github fa-2x"></i></div>
|
||||
<div ng-click="social.echosciences = !social.echosciences" ng-hide="social.echosciences || user.profile.echosciences"><img src="<%= asset_path('social/echosciences.png') %>" alt="d" class="fa-img contrast-250 fa-2x"/></div>
|
||||
<div class="social-icons m-b">
|
||||
<div ng-click="social.facebook = !social.facebook" ng-hide="social.facebook || user.profile.facebook"><i class="fa fa-facebook fa-2x"></i></div>
|
||||
<div ng-click="social.twitter = !social.twitter" ng-hide="social.twitter || user.profile.twitter"><i class="fa fa-twitter fa-2x"></i></div>
|
||||
<div ng-click="social.google_plus = !social.google_plus" ng-hide="social.google_plus || user.profile.google_plus"><i class="fa fa-google-plus fa-2x"></i></div>
|
||||
<div ng-click="social.viadeo = !social.viadeo" ng-hide="social.viadeo || user.profile.viadeo"><i class="fa fa-viadeo fa-2x"></i></div>
|
||||
<div ng-click="social.linkedin = !social.linkedin" ng-hide="social.linkedin || user.profile.linkedin"><i class="fa fa-linkedin fa-2x"></i></div>
|
||||
<div ng-click="social.instagram = !social.instagram" ng-hide="social.instagram || user.profile.instagram"><i class="fa fa-instagram fa-2x"></i></div>
|
||||
<div ng-click="social.youtube = !social.youtube" ng-hide="social.youtube || user.profile.youtube"><i class="fa fa-youtube fa-2x"></i></div>
|
||||
<div ng-click="social.vimeo = !social.vimeo" ng-hide="social.vimeo || user.profile.vimeo"><i class="fa fa-vimeo fa-2x"></i></div>
|
||||
<div ng-click="social.dailymotion = !social.dailymotion" ng-hide="social.dailymotion || user.profile.dailymotion"><img src="<%= asset_path('social/dailymotion.png') %>" alt="d" class="fa-img contrast-250 fa-2x"/></div>
|
||||
<div ng-click="social.github = !social.github" ng-hide="social.github || user.profile.github"><i class="fa fa-github fa-2x"></i></div>
|
||||
<div ng-click="social.echosciences = !social.echosciences" ng-hide="social.echosciences || user.profile.echosciences"><img src="<%= asset_path('social/echosciences.png') %>" alt="d" class="fa-img contrast-250 fa-2x"/></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -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,
|
||||
profile_attributes: [:id, :first_name, :last_name, :gender, :birthday, :phone, :interest, :software_mastered, :website,
|
||||
:facebook, :twitter, :google_plus, :viadeo, :linkedin, :instagram, :youtube, :vimeo, :dailymotion, :github, :echosciences,
|
||||
: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,
|
||||
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,
|
||||
profile_attributes: [:id, :first_name, :last_name, :gender, :birthday, :phone, :interest, :software_mastered, :website,
|
||||
:facebook, :twitter, :google_plus, :viadeo, :linkedin, :instagram, :youtube, :vimeo, :dailymotion, :github, :echosciences,
|
||||
user_avatar_attributes: [:id, :attachment, :_destroy], address_attributes: [:id, :address]])
|
||||
|
||||
|
@ -19,6 +19,7 @@ json.profile do
|
||||
json.address @member.profile.address.address
|
||||
end if @member.profile.address
|
||||
json.phone @member.profile.phone
|
||||
json.website @member.profile.website
|
||||
json.extract! @member.profile, :facebook, :twitter, :google_plus, :viadeo, :linkedin, :instagram, :youtube, :vimeo, :dailymotion, :github, :echosciences
|
||||
end
|
||||
json.subscribed_plan do
|
||||
|
@ -104,6 +104,7 @@ en:
|
||||
confirmation_mismatch_with_password: "Confirmation mismatch with password."
|
||||
date_of_birth: "Date of birth"
|
||||
date_of_birth_is_required: "Date of birth is required."
|
||||
website: "Website"
|
||||
facebook: "Facebook"
|
||||
twitter: "Twitter"
|
||||
google_plus: "Google+"
|
||||
|
@ -104,6 +104,7 @@ fr:
|
||||
confirmation_mismatch_with_password: "La confirmation ne concorde pas avec le mot de passe."
|
||||
date_of_birth: "Date de naissance"
|
||||
date_of_birth_is_required: "La date de naissance est requise."
|
||||
website: "Site web"
|
||||
facebook: "Facebook"
|
||||
twitter: "Twitter"
|
||||
google_plus: "Google+"
|
||||
|
5
db/migrate/20160516124056_add_website_to_profile.rb
Normal file
5
db/migrate/20160516124056_add_website_to_profile.rb
Normal file
@ -0,0 +1,5 @@
|
||||
class AddWebsiteToProfile < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :profiles, :website, :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: 20160516090121) do
|
||||
ActiveRecord::Schema.define(version: 20160516124056) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@ -322,6 +322,7 @@ ActiveRecord::Schema.define(version: 20160516090121) do
|
||||
t.string "dailymotion"
|
||||
t.string "github"
|
||||
t.string "echosciences"
|
||||
t.string "website"
|
||||
end
|
||||
|
||||
add_index "profiles", ["user_id"], name: "index_profiles_on_user_id", using: :btree
|
||||
|
Loading…
x
Reference in New Issue
Block a user