Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8eca6916
authored
Jun 06, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into develop
parents
16e8b513
da28133a
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
20 additions
and
12 deletions
sails/src/api/controllers/StudentController.js
sails/src/api/controllers/SupervisorController.js
sails/src/api/controllers/TryController.js
sails/src/api/models/Student.js
sails/src/assets/app/i18n/en-gb.json
sails/src/assets/app/i18n/es-es.json
sails/src/assets/scripts/modules/student/controllers/collections.js
sails/src/assets/scripts/modules/student/views/header.html
sails/src/assets/scripts/modules/student/views/session.html
sails/src/config/pictogram.js
sails/src/api/controllers/StudentController.js
View file @
8eca6916
...
...
@@ -163,8 +163,8 @@ module.exports = {
student
.
supervision
=
1
;
// requester is tutor of the studend
else
if
(
stu_sup
&&
req
.
token
.
office
)
student
.
supervision
=
2
;
// requester is supervisor of student
else
if
(
req
.
token
.
isStudent
&&
req
.
token
.
id
==
student
.
id
)
student
.
supervision
=
3
// requester is the student himself
else
if
(
req
.
token
.
isStudent
&&
req
.
token
.
id
==
student
.
id
)
student
.
supervision
=
3
// requester is the student himself
if
(
student
.
supervision
==
-
1
)
// should not hace access!!!
return
res
.
forbidden
(
"Access to this student should not be granted to you"
);
...
...
sails/src/api/controllers/SupervisorController.js
View file @
8eca6916
...
...
@@ -337,7 +337,7 @@ module.exports = {
phone
:
params
.
phone
||
''
,
lang
:
params
.
lang
||
'es-es'
,
};
if
(
params
.
id_off
)
if
(
params
.
id_off
&&
params
.
role
==
'therapist_office'
)
supData
.
id_off
=
params
.
id_off
;
console
.
log
(
JSON
.
stringify
(
supData
));
...
...
sails/src/api/controllers/TryController.js
View file @
8eca6916
...
...
@@ -30,7 +30,7 @@ module.exports = {
var
params
=
req
.
allParams
();
if
(
!
params
.
id
)
return
res
.
badRequest
(
"No try defined"
);
if
(
params
.
end
)
prams
.
end
=
new
Date
().
toISOString
();
if
(
params
.
end
)
p
a
rams
.
end
=
new
Date
().
toISOString
();
Try
.
update
(
params
.
id
,
params
)
.
then
(
function
(
t
)
{
...
...
sails/src/api/models/Student.js
View file @
8eca6916
...
...
@@ -303,7 +303,7 @@ module.exports = {
if
(
err
)
return
callback
(
err
,
[]);
if
(
!
stuSups
||
stuSups
.
length
==
0
)
return
callback
(
n
ew
Error
(
"No supervisors found"
)
,
[]);
return
callback
(
n
ull
,
[]);
var
sups
=
stuSups
.
map
((
st
)
=>
{
return
st
.
supervisor
});
return
callback
(
null
,
sups
);
...
...
sails/src/assets/app/i18n/en-gb.json
View file @
8eca6916
...
...
@@ -238,6 +238,7 @@
"next_actions"
:
"Next actions"
,
"next_sessions"
:
"Next sessions"
,
"no"
:
"No"
,
"no_categories"
:
"Without categories"
,
"nobegin"
:
"No started"
,
"no_method"
:
"No method defined"
,
"no_office"
:
"No office"
,
...
...
@@ -455,6 +456,7 @@
"warning_no_pictos_found"
:
"No pictograms found with specified keyword"
,
"warning_no_tablet_online"
:
"No Pictogran Tablet online detected"
,
"warning_two_characters"
:
"Must type at least two characters"
,
"with_categories"
:
"With categories"
,
"woman"
:
"Woman"
,
"year_totals"
:
"Year totals"
,
"yes"
:
"Yes"
,
...
...
sails/src/assets/app/i18n/es-es.json
View file @
8eca6916
...
...
@@ -238,6 +238,7 @@
"next_actions"
:
"Acciones posteriores"
,
"next_sessions"
:
"Sesiones posteriores"
,
"no"
:
"No"
,
"no_categories"
:
"Sin categorías"
,
"no_method"
:
"Método sin definir"
,
"no_office"
:
"Sin centro"
,
"no_instruction"
:
"Instrucción sin definir"
,
...
...
@@ -455,6 +456,7 @@
"warning_no_pictos_found"
:
"No se encontraron pictogramas con las palabras introducidas"
,
"warning_no_tablet_online"
:
"No se detectó ningún usuario de Pictogram Tablet online"
,
"warning_two_characters"
:
"Debe introducir al menos dos caracteres"
,
"with_categories"
:
"Con categorías"
,
"woman"
:
"Mujer"
,
"year_totals"
:
"Totales año"
,
"yes"
:
"Sí"
,
...
...
sails/src/assets/scripts/modules/student/controllers/collections.js
View file @
8eca6916
...
...
@@ -132,7 +132,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$http
.
get
(
config
.
backend
+
'/stu/'
+
$scope
.
studentData
.
id
+
'/activeScene'
)
.
success
(
function
(
activeScene
)
{
$scope
.
showFreeCategory
=
!
activeScene
.
categories
;
$scope
.
showFreeCategory
=
!
activeScene
.
categories
;
activeScene
.
name
=
$translate
.
instant
(
activeScene
.
name
);
$scope
.
viewingScene
=
activeScene
;
activeScene
.
pictos
.
forEach
(
placePicto
);
$scope
.
loadingPictos
=
false
;
...
...
@@ -156,8 +157,10 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$http
.
get
(
config
.
backend
+
'/scene/'
+
idScene
)
.
success
(
function
(
scene
)
{
$scope
.
showFreeCategory
=
!
scene
.
categories
;
$scope
.
viewingScene
=
scene
;
$scope
.
showFreeCategory
=
!
scene
.
categories
;
scene
.
name
=
$translate
.
instant
(
scene
.
name
);
$scope
.
viewingScene
=
scene
;
scene
.
pictos
.
forEach
(
placePicto
);
$scope
.
loadingPictos
=
false
;
//setTimeout(function () { $scope.$apply(); });
...
...
@@ -173,7 +176,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$scope
.
loadScenesList
=
function
()
{
$http
.
get
(
config
.
backend
+
'/stu/'
+
$scope
.
studentData
.
id
+
'/scenes'
)
.
success
(
function
(
scenes
)
{
.
success
(
function
(
scenes
)
{
scenes
.
map
((
sce
)
=>
{
sce
.
name
=
$translate
.
instant
(
sce
.
name
);
return
sce
});
$scope
.
scenesList
=
scenes
;
//setTimeout(function () { $scope.$apply(); });
})
...
...
sails/src/assets/scripts/modules/student/views/header.html
View file @
8eca6916
...
...
@@ -50,7 +50,7 @@
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<ul
class=
"nav nav-tabs tabs_student"
>
<!-- 0: admin, 1: tutor, 2: therapist -->
<!-- 0: admin, 1: tutor, 2: therapist -->
<li
role=
"presentation"
ng-class=
"{'active' : nav.tab == 'collections'}"
ng-if=
"studentData.supervision != 0"
>
<a
href=
"/app/#/student/{{studentData.id}}/collections"
ng-click=
"nav.tab = ''"
><span
class=
"glyphicon glyphicon-th"
aria-hidden=
"true"
></span>
{{ 'collections' | translate }}
</a>
</li>
...
...
sails/src/assets/scripts/modules/student/views/session.html
View file @
8eca6916
...
...
@@ -6,7 +6,7 @@
<button
class=
"btn btn-default"
btn-radio=
"'new'"
ng-model=
"section"
>
<span
class=
"glyphicon glyphicon-record"
></span>
{{ 'new_session' | translate }}
</button>
<button
class=
"btn btn-default"
btn-radio=
"'previous'"
ng-model=
"section"
ng-click=
"load_tries()"
>
<button
class=
"btn btn-default"
btn-radio=
"'previous'"
ng-model=
"section"
ng-click=
"load_tries()"
ng-if=
"wsessions.length > 0"
>
<span
class=
"glyphicon glyphicon-transfer"
></span>
{{ 'previous_sessions' | translate }}
</button>
</div>
...
...
sails/src/config/pictogram.js
View file @
8eca6916
...
...
@@ -6,7 +6,7 @@ var ASSETS_PATH = path.join(__dirname, '..', 'assets');
var
UPLOAD_PATH
=
path
.
join
(
__dirname
,
'..'
,
'..'
,
'upload'
);
module
.
exports
.
pictogram
=
{
version
:
"1.
1
"
,
// actual version of the server, to be checked by the client
version
:
"1.
2
"
,
// actual version of the server, to be checked by the client
admins
:
[
{
email
:
'amontejo@ujaen.es'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment