1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/app/assets/templates/shared/_member_form.html.erb
2015-05-05 03:10:25 +02:00

146 lines
9.9 KiB
Plaintext

<alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">{{alert.msg}}</alert>
<input name="_method" type="hidden" ng-value="method">
<input name="user[profile_attributes][id]" type="hidden" ng-value="user.profile.id">
<div class="row m-t">
<div class="col-sm-3 col-sm-offset-1">
<div class="form-group m-t-lg">
<div class="fileinput text-center" data-provides="fileinput" ng-class="fileinputClass(user.profile.user_avatar.attachment_url)">
<div class="fileinput-new thumbnail rounded thumb-128-wrapper" style="width: 140px; height: 140px;">
<img src="<%= image_path("no_avatar.png") %>" class="img-circle">
</div>
<div class="fileinput-preview fileinput-exists thumbnail rounded thumb-128-wrapper" data-trigger="fileinput" style="width: 140px; height: 140px; line-height: 140px;">
<img ng-src="{{ user.profile.user_avatar.attachment_url }}" />
</div>
<div class="m-t-sm">
<input type="hidden" name="user[profile_attributes][user_avatar_attributes][id]" ng-value="user.profile.user_avatar.id">
<input type="hidden" name="user[profile_attributes][user_avatar_attributes][_destroy]" ng-value="true" ng-if="user.profile.user_avatar._destory">
<span class="btn btn-default btn-file" ng-click="user.profile.user_avatar._destory = false"><span class="fileinput-new">Ajouter un avatar</span><span class="fileinput-exists">Modifier</span>
<input type="file" name="user[profile_attributes][user_avatar_attributes][attachment]"></span>
<button class="btn btn-danger fileinput-exists" data-dismiss="fileinput" ng-click="user.profile.user_avatar._destory = true"><i class="fa fa-trash-o"></i> </button>
</div>
</div>
</div>
</div>
<div class="col-sm-offset-1 col-sm-6">
<div class="form-group" ng-class="{'has-error': userForm['user[profile_attributes][gender]'].$dirty && userForm['user[profile_attributes][gender]'].$invalid}">
<label class="checkbox-inline btn btn-default">
<input type="radio" name="user[profile_attributes][gender]" ng-model="user.profile.gender" value="true" required/><i class="fa fa-male m-l-sm"></i> Homme
</label>
<label class="checkbox-inline btn btn-default">
<input type="radio" name="user[profile_attributes][gender]" ng-model="user.profile.gender" value="false"/> <i class="fa fa-female m-l-sm"></i> Femme
</label>
<span class="help-block" ng-show="userForm['user[profile_attributes][gender]'].$dirty && userForm['user[profile_attributes][gender]'].$error.required">Le genre est obligatoire</span>
</div>
<div class="form-group" ng-class="{'has-error': userForm['user[username]'].$dirty && userForm['user[username]'].$invalid}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<input ng-model="user.username" type="text" name="user[username]" class="form-control" id="user_username" placeholder="Pseudo" required>
</div>
<span class="help-block" ng-show="userForm['user[username]'].$dirty && userForm['user[username]'].$error.required">Le pseudo est obligatoire</span>
</div>
<div class="form-group" ng-class="{'has-error': userForm['user[profile_attributes][last_name]'].$dirty && userForm['user[profile_attributes][last_name]'].$invalid}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<input ng-model="user.profile.last_name" type="text" name="user[profile_attributes][last_name]" class="form-control" id="user_last_name" placeholder="Nom" required>
</div>
<span class="help-block" ng-show="userForm['user[profile_attributes][last_name]'].$dirty && userForm['user[profile_attributes][last_name]'].$error.required">Le nom est obligatoire</span>
</div>
<div class="form-group" ng-class="{'has-error': userForm['user[profile_attributes][first_name]'].$dirty && userForm['user[profile_attributes][first_name]'].$invalid}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<input ng-model="user.profile.first_name" type="text" name="user[profile_attributes][first_name]" class="form-control" id="user_first_name" placeholder="Prénom" required>
</div>
<span class="help-block" ng-show="userForm['user[profile_attributes][first_name]'].$dirty && userForm['user[profile_attributes][first_name]'].$error.required">Le prénom est obligatoire</span>
</div>
<div class="form-group" ng-class="{'has-error': userForm['user[email]'].$dirty && userForm['user[email]'].$invalid}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-envelope"></i> </span>
<input ng-model="user.email" type="email" name="user[email]" class="form-control" id="user_email" placeholder="Adresse email" required>
</div>
<span class="help-block" ng-show="userForm['user[email]'].$dirty && userForm['user[email]'].$error.required">L'email est obligatoire</span>
</div>
<div class="form-group">
<button class="btn btn-warning btn-block" ng-click="change_password = !change_password; $event.stopPropagation(); $event.preventDefault()">Changer de mot de passe</button>
</div>
<div class="form-group" ng-class="{'has-error': userForm['user[password]'].$dirty && userForm['user[password]'].$invalid}" ng-if="change_password">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i> </span>
<input ng-model="user.password" type="password" name="user[password]" class="form-control" id="user_password" placeholder="Nouveau mot de passe" required ng-minlength="8">
</div>
<span class="help-block" ng-show="userForm['user[password]'].$dirty && userForm['user[password]'].$error.required">Le mot de passe est obligatoire</span>
<span class="help-block" ng-show="userForm['user[password]'].$dirty && userForm['user[password]'].$error.minlength">Le mot de passe est trop court (au moins 8 caractères)</span>
</div>
<div class="form-group" ng-class="{'has-error': userForm['user[password_confirmation]'].$dirty && userForm['user[password_confirmation]'].$invalid}" ng-if="change_password">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i> </span>
<input ng-model="user.password_confirmation" type="password" name="user[password_confirmation]" class="form-control" id="user_password_confirmation" placeholder="Confirmation du nouveau mot de passe" required ng-minlength="8">
</div>
<span class="help-block" ng-show="userForm['user[password_confirmation]'].$dirty && userForm['user[password_confirmation]'].$error.required">Le mot de passe de confirmation est obligatoire</span>
<span class="help-block" ng-show="userForm['user[password_confirmation]'].$dirty && userForm['user[password_confirmation]'].$error.minlength">Le mot de passe de confirmation est trop court (au moins 8 caractères)</span>
</div>
<div class="form-group" ng-class="{'has-error': userForm['user[profile_attributes][birthday]'].$dirty && userForm['user[profile_attributes][birthday]'].$invalid}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-calendar-o"></i> </span>
<input type="text"
id="user_birthday"
class="form-control"
name="user[profile_attributes][birthday]"
ng-model="user.profile.birthday"
datepicker-popup="dd/MM/yyyy"
datepicker-options="datePicker.options"
is-open="datePicker.opened"
placeholder="Date de naissance"
ng-click="openDatePicker($event)"
required/>
</div>
<span class="help-block" ng-show="userForm['user[profile_attributes][birthday]'].$dirty && userForm['user[profile_attributes][birthday]'].$error.required">La date de naissance est obligatoire</span>
</div>
<div class="form-group">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-map-marker"></i> </span>
<input type="hidden" name="user[profile_attributes][address_attributes][id]" ng-value="user.profile.address.id" />
<input ng-model="user.profile.address.address" type="text" name="user[profile_attributes][address_attributes][address]" class="form-control" id="user_address" placeholder="Adresse">
</div>
</div>
<div class="form-group" ng-class="{'has-error': userForm['user[profile_attributes][phone]'].$dirty && userForm['user[profile_attributes][phone]'].$invalid}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-phone"></i> </span>
<input ng-model="user.profile.phone" type="text" name="user[profile_attributes][phone]" class="form-control" id="user_phone" placeholder="Numéro de téléphone" required>
</div>
<span class="help-block" ng-show="userForm['user[profile_attributes][phone]'].$dirty && userForm['user[profile_attributes][phone]'].$error.required">Le numéro de téléphone est obligatoire.</span>
</div>
<div class="form-group">
<label for="user_interest">Centres d'intérêts</label>
<textarea ng-model="user.profile.interest" rows="5" name="user[profile_attributes][interest]" class="form-control" id="user_interest" placeholder=""></textarea>
</div>
<div class="form-group">
<label for="user_software_mastered">Logiciels de conception maîtrisés</label>
<textarea ng-model="user.profile.software_mastered" rows="5" name="user[profile_attributes][software_mastered]" class="form-control" id="user_software_mastered" placeholder=""></textarea>
</div>
</div>
</div>