signin form ready for controller handling

parent c032ff50
......@@ -173,6 +173,7 @@
"login_footer": "<strong>Pictogram Web</strong> is a product by <a href='http://www.yottacode.com'>Yottacode S.L.</a> for Augmentative and Alternative Communication, loaded with more than 20,000 images from the <a href='https://www.n2y.com/products/symbolstix'>SymbolStix</a> collection, in several languages. From here, you will be able to manage devices with official <i>Pictogram Tablet</i> app installed.",
"login_success": "Login succeed. Welcome {{name}}",
"logout": "Log Out",
"logo_url": "URL (http://...) to office's logo",
"man": "Man",
"March": "March",
"mark": "Mark",
......@@ -248,6 +249,7 @@
"pictogram_setup": "Pictogram setup",
"pictograms": "Pictograms",
"place_pictos": "Place pictograms in the phrase tape when",
"postal_code": "Postal code",
"press": "Long press",
"previous_actions": "Previous actions",
"previous_sessions": "Previous sessions",
......@@ -268,12 +270,14 @@
"select_instruction": "-- Select an instruction --",
"select_a_method": "-- Select a method --",
"select_method": "-- Select a method or create it --",
"select_office": "Select an office from the list",
"send": "Send",
"September": "September",
"serial": "Serial number",
"serial_created": "Serial number {{serial}} created",
"serial_list": "Free serial numbers",
"serial_not_created": "Serial number couldn't be created",
"server_error": "An error has been reported when connecting to the server.",
"session": "Session",
"sessions": "Sessions",
"session_mean_length": "Session mean length: {{hours}} hours",
......@@ -281,6 +285,7 @@
"sessions": "Sessions",
"sessions_of": "Sessions of",
"setup": "Setup",
"sexo": "Sex",
"show": "Show",
"size": "Size",
"small": "Small",
......
......@@ -173,6 +173,7 @@
"login_footer": "<strong>Pictogram Web</strong> es un producto de <a href='http://www.yottacode.com'>Yottacode S.L.</a> para Comunicación Aumentativa y Alternativa, cargado con más de 20,000 pictogramas de <a href='https://www.n2y.com/products/symbolstix'>SymbolStix</a>, en varios idiomas. Desde aquí podrás gestionar los dispositivos que dispongan de la app oficial <i>Pictogram Tablet</i>.",
"login_success": "Login correcto. Bienvenido {{name}}",
"logout": "Salir",
"logo_url": "URL (http://...) al logo del centro/gabinete",
"man": "Hombre",
"March": "Marzo",
"mark": "Marcar",
......@@ -209,6 +210,7 @@
"objetive": "Objetivo",
"October": "Octubre",
"office": "Gabinete",
"office_center": "Gabinete/centro",
"office_added": "Gabinete añadido",
"office_deleted": "Gabinete eliminado",
"office_not_added": "No se ha podido añadir el gabinete",
......@@ -248,6 +250,7 @@
"pictogram_setup": "Configuración del pictograma",
"pictograms": "Pictogramas",
"place_pictos": "Colocar pictogramas en la cinta de frase cuando",
"postal_code": "Código postal",
"press": "Pulsación larga",
"previous_actions": "Acciones anteriores",
"previous_sessions": "Sesiones anteriores",
......@@ -269,12 +272,14 @@
"select_instruction": "-- Selecciona una instrucción --",
"select_a_method": "-- Selecciona un método --",
"select_method": "-- Selecciona un método o créalo --",
"select_office": "Seleccione una oficina/centro de la lista",
"send": "Enviar",
"September": "Septiembre",
"serial": "Número de serie",
"serial_created": "Número de serie {{serial}} creado",
"serial_list": "Números de serie libres",
"serial_not_created": "No se ha podido crear el número de serie",
"server_error": "No se ha podido conectar con el servidor.",
"session": "Sesión",
"sessions": "Sesiones",
"session_mean_length": "Duración media de sesión: {{hours}} horas",
......@@ -282,6 +287,7 @@
"sessions": "Sesiones",
"sessions_of": "Sesiones de",
"setup": "Configuración",
"sexo": "Sexo",
"show": "Mostrar",
"size": "Tamaño",
"small": "Pequeño",
......
......@@ -22,18 +22,32 @@ function SignInCtrl($scope,
surname: '',
address: '',
phone: '',
gender: 'F',
gender: 'M',
email: '',
email_confirm: '',
password: '',
password_confirm: '',
lang: 'es',
role: 'therapist_office',
role: null,
office: {
country: 'NULL'
},
office_idx: -1
};
};
$scope.reset();
// Get the list of offices
$http
.get(config.backend + '/office/get_all')
.success(function (offices) {
$scope.offices = offices;
})
.error(function () {
ngToast.danger({ content: $translate.instant('server_error') });
});
// Form submit
$scope.signin = function () {
// Validate email match
......
......@@ -20,55 +20,77 @@
<form name="signInForm" role="form" ng-submit="signin()">
<fieldset>
<legend translate>personal_data</legend>
<div class="form-group">
<input type="text" class="form-control" id="signin_name" placeholder="{{ 'name' | translate }}" required ng-model="formdata.name"/>
</div>
<div class="form-group">
<input type="text" class="form-control" id="signin_surname" placeholder="{{ 'surname' | translate }}" required ng-model="formdata.surname"/>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<input type="text" class="form-control" id="signin_name" placeholder="{{ 'name' | translate }}" required ng-model="formdata.name"/>
</div>
</div>
<div class="col-md-8">
<div class="form-group">
<input type="text" class="form-control" id="signin_surname" placeholder="{{ 'surname' | translate }}" required ng-model="formdata.surname"/>
</div>
</div>
</div>
<div class="form-group">
<input type="text" class="form-control" id="signin_address" placeholder="{{ 'address' | translate }}" ng-model="formdata.address"/>
</div>
<div class="form-group">
<input type="text" class="form-control" id="signin_phone" placeholder="{{ 'phone' | translate }}" ng-model="formdata.phone"/>
</div>
<div class="form-group">
<select class="form-control" name="signin_gender" id="signin_gender" ng-model="formdata.gender">
<option value="F" selected translate>woman</option>
<option value="M" translate>man</option>
</select>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<input type="text" class="form-control" id="signin_phone" placeholder="{{ 'phone' | translate }}" ng-model="formdata.phone"/>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<select class="form-control" name="signin_gender" id="signin_gender" ng-model="formdata.gender">
<option value="F" translate>woman</option>
<option value="M" translate>man</option>
</select>
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend>
{{ 'email' | translate }}
<span class="color_red text_sm pull-right" ng-show="formdata.email != formdata.email_confirm" translate>email_match</span>
</legend>
<div class="form-group">
<input type="email" class="form-control" id="email" name="email" placeholder="{{ 'email_type' | translate }}" required ng-model="formdata.email" />
<div class="row">
<div class="col-md-12">
<span class="color_red text_sm pull-right" ng-show="formdata.email != formdata.email_confirm" translate>email_match</span>
</div>
</div>
<div class="form-group">
<input type="email" class="form-control" id="email_confirm" name="email_confirm" placeholder="{{ 'email_confirm' | translate }}" required ng-model="formdata.email_confirm" />
<div class="row">
<div class="col-md-6">
<input type="email" class="form-control" id="email" name="email" placeholder="{{ 'email_type' | translate }}" required ng-model="formdata.email" />
</div>
<div class="col-md-6">
<input type="email" class="form-control" id="email_confirm" name="email_confirm" placeholder="{{ 'email_confirm' | translate }}" required ng-model="formdata.email_confirm" />
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend>
{{ 'password' | translate }}
<span class="color_red text_sm pull-right" ng-show="formdata.password != formdata.password_confirm" translate>password_match</span>
</legend>
<div class="form-group">
<input type="password" class="form-control" id="signin_password1" placeholder="{{ 'password_type' | translate }}" required ng-model="formdata.password" />
<div class="row">
<div class="col-md-12">
<span class="color_red text_sm pull-right" ng-show="formdata.password != formdata.password_confirm" translate>password_match</span>
</div>
</div>
<div class="form-group">
<input type="password" class="form-control" id="signin_password2" placeholder="{{ 'password_confirm' | translate }}" required ng-model="formdata.password_confirm" />
<div class="row">
<div class="col-md-6">
<input type="password" class="form-control" id="signin_password1" placeholder="{{ 'password_type' | translate }}" required ng-model="formdata.password" />
</div>
<div class="col-md-6">
<input type="password" class="form-control" id="signin_password2" placeholder="{{ 'password_confirm' | translate }}" required ng-model="formdata.password_confirm" />
</div>
</div>
</div>
<fieldset>
<fieldset>
<legend translate>language</legend>
<label translate>language</label>
<div class="form-group">
<select class="form-control" name="signin_language" id="signin_language" ng-model="formdata.lang">
<option value="es-es" selected>Español</option>
......@@ -83,7 +105,11 @@
<div class="form-group">
<div class="row">
<div class="col-md-1 text-right">
<input type="radio" ng-model="formdata.role" value="therapist_office">
<input
type="radio"
ng-model="formdata.role"
value="therapist_office"
onClick="$('#office_selection').slideDown(); $('#office_form').slideUp();">
</div>
<div class="col-md-11">
{{ 'case_therapist_office' | translate }}
......@@ -94,7 +120,11 @@
<div class="form-group">
<div class="row">
<div class="col-md-1 text-right">
<input type="radio" ng-model="formdata.role" value="therapist_nooffice">
<input
type="radio"
ng-model="formdata.role"
value="therapist_nooffice"
onClick="$('#office_selection').slideUp(); $('#office_form').slideDown();">
</div>
<div class="col-md-11">
{{ 'case_therapist_nooffice' | translate }}
......@@ -105,7 +135,11 @@
<div class="form-group">
<div class="row">
<div class="col-md-1 text-right">
<input type="radio" ng-model="formdata.role" value="tutor_office">
<input
type="radio"
ng-model="formdata.role"
value="tutor_office"
onClick="$('#office_selection').slideDown(); $('#office_form').slideUp();">
</div>
<div class="col-md-11">
{{ 'case_tutor_office' | translate }}
......@@ -116,17 +150,75 @@
<div class="form-group">
<div class="row">
<div class="col-md-1">
<input type="radio" ng-model="formdata.role" value="tutor_nooffice">
<input
type="radio"
ng-model="formdata.role"
value="tutor_nooffice"
onClick="$('#office_selection').slideUp(); $('#office_form').slideUp();">
</div>
<div class="col-md-11">
{{ 'case_tutor_nooffice' | translate }}
</div>
</div>
</div>
</fieldset>
<div class="form-group" id="office_form" hidden>
<legend translate>office_center</legend>
<div class="form-group">
<input type="text" class="form-control" placeholder="{{ 'name' | translate }}" ng-model="formdata.office.name"/>
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="{{ 'logo_url' | translate }}" ng-model="formdata.office.logo_url"/>
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="{{ 'address' | translate }}" ng-model="formdata.office.address"/>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<input type="text" class="form-control" placeholder="{{ 'postal_code' | translate }}" ng-model="formdata.office.postal_code"/>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<select class="form-control" ng-model="formdata.office.country">
<option value="NULL" selected disabled hidden>{{ 'country' | translate }}</option>
<option value="ES">España</option>
<option value="US">United States</option>
<option value="UK">United Kingdom</option>
<option value="IE">Ireland</option>
</select>
</div>
</div>
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="{{ 'contact_person' | translate }}" ng-model="formdata.office.contact_person"/>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<input type="email" class="form-control" placeholder="{{ 'email' | translate }}" ng-model="formdata.office.email"/>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<input type="text" class="form-control" placeholder="{{ 'phone' | translate }}" ng-model="formdata.office.phone1"/>
</div>
</div>
</div>
</div>
<div class="form-group" id="office_selection" hidden>
<legend translate>office_center</legend>
<select class="form-control" ng-model="formdata.office_idx">
<option selected disabled hidden value="-1">{{ 'select_office' | translate }}</option>
<option ng-repeat="office in offices | orderBy: 'name' track by $index" value="$index"> {{ office.name }} </option>
</select>
</div>
<div class="form-group">
<legend></legend>
<input type="checkbox" ng-model="formdata.disclaimer_accepted">
<span translate>disclaimer_accept</span>
</div>
......
......@@ -60,7 +60,7 @@ module.exports.policies = {
},
OfficeController: {
getAll: ['tokenAuth', 'isAdmin'],
getAll: true,
get: ['tokenAuth'],
getBasic: true,
supervisors: ['tokenAuth', 'isAdmin']
......
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 sign in to comment