signin form ready for controller handling

parent c032ff50
...@@ -173,6 +173,7 @@ ...@@ -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_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}}", "login_success": "Login succeed. Welcome {{name}}",
"logout": "Log Out", "logout": "Log Out",
"logo_url": "URL (http://...) to office's logo",
"man": "Man", "man": "Man",
"March": "March", "March": "March",
"mark": "Mark", "mark": "Mark",
...@@ -248,6 +249,7 @@ ...@@ -248,6 +249,7 @@
"pictogram_setup": "Pictogram setup", "pictogram_setup": "Pictogram setup",
"pictograms": "Pictograms", "pictograms": "Pictograms",
"place_pictos": "Place pictograms in the phrase tape when", "place_pictos": "Place pictograms in the phrase tape when",
"postal_code": "Postal code",
"press": "Long press", "press": "Long press",
"previous_actions": "Previous actions", "previous_actions": "Previous actions",
"previous_sessions": "Previous sessions", "previous_sessions": "Previous sessions",
...@@ -268,12 +270,14 @@ ...@@ -268,12 +270,14 @@
"select_instruction": "-- Select an instruction --", "select_instruction": "-- Select an instruction --",
"select_a_method": "-- Select a method --", "select_a_method": "-- Select a method --",
"select_method": "-- Select a method or create it --", "select_method": "-- Select a method or create it --",
"select_office": "Select an office from the list",
"send": "Send", "send": "Send",
"September": "September", "September": "September",
"serial": "Serial number", "serial": "Serial number",
"serial_created": "Serial number {{serial}} created", "serial_created": "Serial number {{serial}} created",
"serial_list": "Free serial numbers", "serial_list": "Free serial numbers",
"serial_not_created": "Serial number couldn't be created", "serial_not_created": "Serial number couldn't be created",
"server_error": "An error has been reported when connecting to the server.",
"session": "Session", "session": "Session",
"sessions": "Sessions", "sessions": "Sessions",
"session_mean_length": "Session mean length: {{hours}} hours", "session_mean_length": "Session mean length: {{hours}} hours",
...@@ -281,6 +285,7 @@ ...@@ -281,6 +285,7 @@
"sessions": "Sessions", "sessions": "Sessions",
"sessions_of": "Sessions of", "sessions_of": "Sessions of",
"setup": "Setup", "setup": "Setup",
"sexo": "Sex",
"show": "Show", "show": "Show",
"size": "Size", "size": "Size",
"small": "Small", "small": "Small",
......
...@@ -173,6 +173,7 @@ ...@@ -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_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}}", "login_success": "Login correcto. Bienvenido {{name}}",
"logout": "Salir", "logout": "Salir",
"logo_url": "URL (http://...) al logo del centro/gabinete",
"man": "Hombre", "man": "Hombre",
"March": "Marzo", "March": "Marzo",
"mark": "Marcar", "mark": "Marcar",
...@@ -209,6 +210,7 @@ ...@@ -209,6 +210,7 @@
"objetive": "Objetivo", "objetive": "Objetivo",
"October": "Octubre", "October": "Octubre",
"office": "Gabinete", "office": "Gabinete",
"office_center": "Gabinete/centro",
"office_added": "Gabinete añadido", "office_added": "Gabinete añadido",
"office_deleted": "Gabinete eliminado", "office_deleted": "Gabinete eliminado",
"office_not_added": "No se ha podido añadir el gabinete", "office_not_added": "No se ha podido añadir el gabinete",
...@@ -248,6 +250,7 @@ ...@@ -248,6 +250,7 @@
"pictogram_setup": "Configuración del pictograma", "pictogram_setup": "Configuración del pictograma",
"pictograms": "Pictogramas", "pictograms": "Pictogramas",
"place_pictos": "Colocar pictogramas en la cinta de frase cuando", "place_pictos": "Colocar pictogramas en la cinta de frase cuando",
"postal_code": "Código postal",
"press": "Pulsación larga", "press": "Pulsación larga",
"previous_actions": "Acciones anteriores", "previous_actions": "Acciones anteriores",
"previous_sessions": "Sesiones anteriores", "previous_sessions": "Sesiones anteriores",
...@@ -269,12 +272,14 @@ ...@@ -269,12 +272,14 @@
"select_instruction": "-- Selecciona una instrucción --", "select_instruction": "-- Selecciona una instrucción --",
"select_a_method": "-- Selecciona un método --", "select_a_method": "-- Selecciona un método --",
"select_method": "-- Selecciona un método o créalo --", "select_method": "-- Selecciona un método o créalo --",
"select_office": "Seleccione una oficina/centro de la lista",
"send": "Enviar", "send": "Enviar",
"September": "Septiembre", "September": "Septiembre",
"serial": "Número de serie", "serial": "Número de serie",
"serial_created": "Número de serie {{serial}} creado", "serial_created": "Número de serie {{serial}} creado",
"serial_list": "Números de serie libres", "serial_list": "Números de serie libres",
"serial_not_created": "No se ha podido crear el número de serie", "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", "session": "Sesión",
"sessions": "Sesiones", "sessions": "Sesiones",
"session_mean_length": "Duración media de sesión: {{hours}} horas", "session_mean_length": "Duración media de sesión: {{hours}} horas",
...@@ -282,6 +287,7 @@ ...@@ -282,6 +287,7 @@
"sessions": "Sesiones", "sessions": "Sesiones",
"sessions_of": "Sesiones de", "sessions_of": "Sesiones de",
"setup": "Configuración", "setup": "Configuración",
"sexo": "Sexo",
"show": "Mostrar", "show": "Mostrar",
"size": "Tamaño", "size": "Tamaño",
"small": "Pequeño", "small": "Pequeño",
......
...@@ -22,18 +22,32 @@ function SignInCtrl($scope, ...@@ -22,18 +22,32 @@ function SignInCtrl($scope,
surname: '', surname: '',
address: '', address: '',
phone: '', phone: '',
gender: 'F', gender: 'M',
email: '', email: '',
email_confirm: '', email_confirm: '',
password: '', password: '',
password_confirm: '', password_confirm: '',
lang: 'es', lang: 'es',
role: 'therapist_office', role: null,
office: {
country: 'NULL'
},
office_idx: -1
}; };
}; };
$scope.reset(); $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 // Form submit
$scope.signin = function () { $scope.signin = function () {
// Validate email match // Validate email match
......
...@@ -20,55 +20,77 @@ ...@@ -20,55 +20,77 @@
<form name="signInForm" role="form" ng-submit="signin()"> <form name="signInForm" role="form" ng-submit="signin()">
<fieldset> <fieldset>
<legend translate>personal_data</legend> <legend translate>personal_data</legend>
<div class="row">
<div class="col-md-4">
<div class="form-group"> <div class="form-group">
<input type="text" class="form-control" id="signin_name" placeholder="{{ 'name' | translate }}" required ng-model="formdata.name"/> <input type="text" class="form-control" id="signin_name" placeholder="{{ 'name' | translate }}" required ng-model="formdata.name"/>
</div> </div>
</div>
<div class="col-md-8">
<div class="form-group"> <div class="form-group">
<input type="text" class="form-control" id="signin_surname" placeholder="{{ 'surname' | translate }}" required ng-model="formdata.surname"/> <input type="text" class="form-control" id="signin_surname" placeholder="{{ 'surname' | translate }}" required ng-model="formdata.surname"/>
</div> </div>
</div>
</div>
<div class="form-group"> <div class="form-group">
<input type="text" class="form-control" id="signin_address" placeholder="{{ 'address' | translate }}" ng-model="formdata.address"/> <input type="text" class="form-control" id="signin_address" placeholder="{{ 'address' | translate }}" ng-model="formdata.address"/>
</div> </div>
<div class="row">
<div class="col-md-6">
<div class="form-group"> <div class="form-group">
<input type="text" class="form-control" id="signin_phone" placeholder="{{ 'phone' | translate }}" ng-model="formdata.phone"/> <input type="text" class="form-control" id="signin_phone" placeholder="{{ 'phone' | translate }}" ng-model="formdata.phone"/>
</div> </div>
</div>
<div class="col-md-6">
<div class="form-group"> <div class="form-group">
<select class="form-control" name="signin_gender" id="signin_gender" ng-model="formdata.gender"> <select class="form-control" name="signin_gender" id="signin_gender" ng-model="formdata.gender">
<option value="F" selected translate>woman</option> <option value="F" translate>woman</option>
<option value="M" translate>man</option> <option value="M" translate>man</option>
</select> </select>
</div> </div>
</div>
</div>
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend> <div class="row">
{{ 'email' | translate }} <div class="col-md-12">
<span class="color_red text_sm pull-right" ng-show="formdata.email != formdata.email_confirm" translate>email_match</span> <span class="color_red text_sm pull-right" ng-show="formdata.email != formdata.email_confirm" translate>email_match</span>
</legend> </div>
</div>
<div class="form-group"> <div class="form-group">
<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" /> <input type="email" class="form-control" id="email" name="email" placeholder="{{ 'email_type' | translate }}" required ng-model="formdata.email" />
</div> </div>
<div class="form-group"> <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" /> <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>
</div>
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend> <div class="row">
{{ 'password' | translate }} <div class="col-md-12">
<span class="color_red text_sm pull-right" ng-show="formdata.password != formdata.password_confirm" translate>password_match</span> <span class="color_red text_sm pull-right" ng-show="formdata.password != formdata.password_confirm" translate>password_match</span>
</legend> </div>
</div>
<div class="form-group"> <div class="form-group">
<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" /> <input type="password" class="form-control" id="signin_password1" placeholder="{{ 'password_type' | translate }}" required ng-model="formdata.password" />
</div> </div>
<div class="form-group"> <div class="col-md-6">
<input type="password" class="form-control" id="signin_password2" placeholder="{{ 'password_confirm' | translate }}" required ng-model="formdata.password_confirm" /> <input type="password" class="form-control" id="signin_password2" placeholder="{{ 'password_confirm' | translate }}" required ng-model="formdata.password_confirm" />
</div> </div>
</div>
</div>
<fieldset> <fieldset>
<fieldset> <fieldset>
<legend translate>language</legend> <label translate>language</label>
<div class="form-group"> <div class="form-group">
<select class="form-control" name="signin_language" id="signin_language" ng-model="formdata.lang"> <select class="form-control" name="signin_language" id="signin_language" ng-model="formdata.lang">
<option value="es-es" selected>Español</option> <option value="es-es" selected>Español</option>
...@@ -83,7 +105,11 @@ ...@@ -83,7 +105,11 @@
<div class="form-group"> <div class="form-group">
<div class="row"> <div class="row">
<div class="col-md-1 text-right"> <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>
<div class="col-md-11"> <div class="col-md-11">
{{ 'case_therapist_office' | translate }} {{ 'case_therapist_office' | translate }}
...@@ -94,7 +120,11 @@ ...@@ -94,7 +120,11 @@
<div class="form-group"> <div class="form-group">
<div class="row"> <div class="row">
<div class="col-md-1 text-right"> <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>
<div class="col-md-11"> <div class="col-md-11">
{{ 'case_therapist_nooffice' | translate }} {{ 'case_therapist_nooffice' | translate }}
...@@ -105,7 +135,11 @@ ...@@ -105,7 +135,11 @@
<div class="form-group"> <div class="form-group">
<div class="row"> <div class="row">
<div class="col-md-1 text-right"> <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>
<div class="col-md-11"> <div class="col-md-11">
{{ 'case_tutor_office' | translate }} {{ 'case_tutor_office' | translate }}
...@@ -116,17 +150,75 @@ ...@@ -116,17 +150,75 @@
<div class="form-group"> <div class="form-group">
<div class="row"> <div class="row">
<div class="col-md-1"> <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>
<div class="col-md-11"> <div class="col-md-11">
{{ 'case_tutor_nooffice' | translate }} {{ 'case_tutor_nooffice' | translate }}
</div> </div>
</div> </div>
</div> </div>
</fieldset> </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"> <div class="form-group">
<legend></legend>
<input type="checkbox" ng-model="formdata.disclaimer_accepted"> <input type="checkbox" ng-model="formdata.disclaimer_accepted">
<span translate>disclaimer_accept</span> <span translate>disclaimer_accept</span>
</div> </div>
......
...@@ -60,7 +60,7 @@ module.exports.policies = { ...@@ -60,7 +60,7 @@ module.exports.policies = {
}, },
OfficeController: { OfficeController: {
getAll: ['tokenAuth', 'isAdmin'], getAll: true,
get: ['tokenAuth'], get: ['tokenAuth'],
getBasic: true, getBasic: true,
supervisors: ['tokenAuth', 'isAdmin'] 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