1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-30 11:24:21 +01:00
fab-manager/app/assets/templates/shared/_admin_form.html
Sylvain 6c32f7e54a fixes in datepicker
- date displayed in inputs has the correct year
- date sent to server match the selected date in html forms
- datepicker date format is configurable for i18n
2016-03-29 13:31:02 +02:00

123 lines
5.9 KiB
HTML

<div class="row m-t">
<div class="col-sm-offset-3 col-sm-6">
<div class="form-group" ng-class="{'has-error': adminForm['admin[profile_attributes][gender]'].$dirty && adminForm['admin[profile_attributes][gender]'].$invalid}">
<label class="checkbox-inline btn btn-default">
<input type="radio"
name="admin[profile_attributes][gender]"
ng-model="admin.profile_attributes.gender"
ng-value="true"
required/>
<i class="fa fa-male m-l-sm"></i> {{ 'man' | translate }}
</label>
<label class="checkbox-inline btn btn-default">
<input type="radio"
name="admin[profile_attributes][gender]"
ng-model="admin.profile_attributes.gender"
ng-value="false"/>
<i class="fa fa-female m-l-sm"></i> {{ 'woman' | translate }}
</label>
</div>
<div class="form-group" ng-class="{'has-error': adminForm['admin[username]'].$dirty && adminForm['admin[username]'].$invalid}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<input ng-model="admin.username"
type="text" name="admin[username]"
class="form-control"
id="user_username"
placeholder="{{ 'pseudonym' | translate }}"
required>
</div>
<span class="help-block" ng-show="adminForm['admin[username]'].$dirty && adminForm['admin[username]'].$error.required" translate>{{ 'pseudonym_is_required' }}</span>
</div>
<div class="form-group" ng-class="{'has-error': adminForm['admin[profile_attributes][last_name]'].$dirty && adminForm['admin[profile_attributes][last_name]'].$invalid}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<input ng-model="admin.profile_attributes.last_name"
type="text"
name="admin[profile_attributes][last_name]"
class="form-control"
id="user_last_name"
placeholder="{{ 'surname' | translate }}"
required>
</div>
<span class="help-block" ng-show="adminForm['admin[profile_attributes][last_name]'].$dirty && adminForm['admin[profile_attributes][last_name]'].$error.required" translate>{{ 'surname_is_required' }}</span>
</div>
<div class="form-group" ng-class="{'has-error': adminForm['admin[profile_attributes][first_name]'].$dirty && adminForm['admin[profile_attributes][first_name]'].$invalid}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<input ng-model="admin.profile_attributes.first_name"
type="text"
name="admin[profile_attributes][first_name]"
class="form-control"
id="user_first_name"
placeholder="{{ 'first_name' | translate }}"
required>
</div>
<span class="help-block" ng-show="adminForm['admin[profile_attributes][first_name]'].$dirty && adminForm['admin[profile_attributes][first_name]'].$error.required" translate>{{ 'first_name_is_required' }}</span>
</div>
<div class="form-group" ng-class="{'has-error': adminForm['admin[email]'].$dirty && adminForm['admin[email]'].$invalid}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-envelope"></i> </span>
<input ng-model="admin.email"
type="email"
name="admin[email]"
class="form-control"
id="user_email"
placeholder="{{ 'email_address' | translate }}"
required>
</div>
<span class="help-block" ng-show="adminForm['admin[email]'].$dirty && adminForm['admin[email]'].$error.required" translate>{{ 'email_is_required' }}</span>
</div>
<div class="form-group" ng-class="{'has-error': adminForm['admin[profile_attributes][birthday]'].$dirty && adminForm['admin[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"
ng-model="admin.profile_attributes.birthday"
uib-datepicker-popup="{{datePicker.format}}"
datepicker-options="datePicker.options"
is-open="datePicker.opened"
placeholder="{{ 'birth_date' | translate }}"
ng-click="openDatePicker($event)"
/>
<input type="hidden"
name="admin[profile_attributes][birthday]"
value="{{admin.profile_attributes.birthday | toIsoDate}}" />
</div>
</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="admin[profile_attributes][address_attributes][id]"
ng-value="admin.profile_attributes.address.id" />
<input ng-model="admin.profile_attributes.address_attributes.address"
type="text"
name="admin[profile_attributes][address_attributes][address]"
class="form-control"
id="user_address"
placeholder="{{ 'address' | translate }}">
</div>
</div>
<div class="form-group" ng-class="{'has-error': adminForm['admin[profile_attributes][phone]'].$dirty && adminForm['admin[profile_attributes][phone]'].$invalid}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-phone"></i> </span>
<input ng-model="admin.profile_attributes.phone"
type="text"
name="admin[profile_attributes][phone]"
class="form-control" id="user_phone"
placeholder="{{ 'phone_number' | translate }}">
</div>
</div>
</div>
</div>