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
09eaef18
authored
Feb 21, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
working on issue #951
parent
eebde1a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
sails/src/api/controllers/SupervisorController.js
sails/src/assets/scripts/modules/student/views/addpicto.html
sails/src/api/controllers/SupervisorController.js
View file @
09eaef18
...
@@ -260,7 +260,6 @@ module.exports = {
...
@@ -260,7 +260,6 @@ module.exports = {
*/
*/
create
:
function
(
req
,
res
)
{
create
:
function
(
req
,
res
)
{
var
params
=
req
.
params
.
all
();
var
params
=
req
.
params
.
all
();
var
supervisor
;
// Send email confirmation
// Send email confirmation
function
sendConfirmationMail
(
cb
)
{
function
sendConfirmationMail
(
cb
)
{
...
@@ -293,7 +292,7 @@ module.exports = {
...
@@ -293,7 +292,7 @@ module.exports = {
sails
.
log
.
debug
(
"Creating supervisor with params "
+
JSON
.
stringify
(
params
));
sails
.
log
.
debug
(
"Creating supervisor with params "
+
JSON
.
stringify
(
params
));
if
(
!
params
.
name
||
!
params
.
surname
||
!
params
.
gender
||
!
params
.
password
||
!
params
.
email
)
if
(
!
params
.
name
||
!
params
.
surname
||
!
params
.
gender
||
!
params
.
password
||
!
params
.
email
)
res
.
badRequest
(
"Invalid params"
);
re
turn
re
s
.
badRequest
(
"Invalid params"
);
var
supData
=
{
var
supData
=
{
name
:
params
.
name
,
name
:
params
.
name
,
...
@@ -311,15 +310,11 @@ module.exports = {
...
@@ -311,15 +310,11 @@ module.exports = {
if
(
params
.
id_off
)
if
(
params
.
id_off
)
supData
.
id_off
=
params
.
id_off
;
supData
.
id_off
=
params
.
id_off
;
console
.
log
(
"supData:\n"
+
JSON
.
stringify
(
supData
));
Supervisor
.
create
(
supData
)
Supervisor
.
create
(
supData
)
.
then
(
function
(
sup
)
{
.
then
(
function
(
sup
)
{
if
(
!
sup
)
if
(
!
sup
)
res
.
serverError
(
"Supervisor created but returned null"
);
return
res
.
serverError
(
"Supervisor created but returned null"
);
supervisor
=
sup
;
if
(
params
.
role
===
'therapist_office'
||
params
.
role
===
'tutor_office'
)
{
if
(
params
.
role
===
'therapist_office'
||
params
.
role
===
'tutor_office'
)
{
sendConfirmationMail
((
err
)
=>
{
sendConfirmationMail
((
err
)
=>
{
...
@@ -332,9 +327,11 @@ module.exports = {
...
@@ -332,9 +327,11 @@ module.exports = {
.
then
((
off
)
=>
{
.
then
((
off
)
=>
{
// link supervisor with office
// link supervisor with office
supervisor
.
id_off
=
off
.
id
;
console
.
log
(
"supervisor: \n"
+
JSON
.
stringify
(
supervisor
));
delete
supervisor
.
password
;
sup
.
id_off
=
off
.
id
;
supervisor
.
save
();
delete
sup
.
password
;
sup
.
save
();
console
.
log
(
"supervisor: \n"
+
JSON
.
stringify
(
supervisor
));
// set supervisor as admin in the office
// set supervisor as admin in the office
off
.
admin
=
supervisor
.
id
;
off
.
admin
=
supervisor
.
id
;
...
...
sails/src/assets/scripts/modules/student/views/addpicto.html
View file @
09eaef18
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
<hr>
<hr>
<!-- Bread and categories -->
<!-- Bread and categories -->
<div
id=
"bread_and_categories"
ng-show=
"source == 'symbolstx'"
class=
"panel panel-default"
>
<div
id=
"bread_and_categories"
ng-show=
"source == 'symbolstx'"
class=
"panel panel-default"
style=
"z-index:1000"
>
<div
class=
"panel-heading"
>
<div
class=
"panel-heading"
>
<div
class=
"pull-left"
ng-repeat=
"b in breadcrumbs"
>
<div
class=
"pull-left"
ng-repeat=
"b in breadcrumbs"
>
<a
ng-click=
"open_category_from_bc(b.id)"
>
<a
ng-click=
"open_category_from_bc(b.id)"
>
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
<div
id=
"clearfix-infiniteScroll-parent"
infinite-scroll=
"scroll()"
infinite-scroll-container=
"'#collections'"
>
<div
id=
"clearfix-infiniteScroll-parent"
infinite-scroll=
"scroll()"
infinite-scroll-container=
"'#collections'"
>
<div
class=
"picto_peq pull-left"
ng-repeat=
"p in pictos"
>
<div
class=
"picto_peq pull-left"
ng-repeat=
"p in pictos"
>
<img
ng-src=
"{{p.uri}}"
popover=
"{{p.expressions[0].text}}"
popover-trigger=
"mouseenter"
style=
"z-index:9000"
/>
<img
ng-src=
"{{p.uri}}"
popover=
"{{p.expressions[0].text}}"
popover-trigger=
"mouseenter"
/>
<!-- Options to remove picto (Only for own pictos) -->
<!-- Options to remove picto (Only for own pictos) -->
<div
class=
"picto_options"
>
<div
class=
"picto_options"
>
<a
ng-click=
"remove_own_picto(p.id)"
class=
"picto_remove"
title=
"{{ 'delete' | translate }}"
ng-show=
"source == 'ownpictos'"
>
<a
ng-click=
"remove_own_picto(p.id)"
class=
"picto_remove"
title=
"{{ 'delete' | translate }}"
ng-show=
"source == 'ownpictos'"
>
...
...
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