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
7b224042
authored
Dec 23, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
problem with default image for newly created student solved. issue #611 completed
parent
4d1303b9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
14 deletions
sails/src/api/models/Student.js
sails/src/assets/scripts/modules/supervisor/controllers/students.js
sails/src/assets/scripts/modules/supervisor/views/students.html
sails/src/assets/styles/main.css
sails/src/config/pictogram.js
sails/src/api/models/Student.js
View file @
7b224042
...
...
@@ -245,7 +245,7 @@ module.exports = {
beforeCreate
:
function
(
attrs
,
next
)
{
attrs
.
attributes
=
Student
.
getValidAttributes
(
attrs
.
attributes
);
attrs
.
password
=
bcrypt
.
hashSync
(
attrs
.
password
,
bcrypt
.
genSaltSync
());
attrs
.
pic
=
"defaultAvatar.jpg"
;
attrs
.
pic
=
sails
.
config
.
pictogram
.
urls
.
getStudentAvatarUrl
()
;
next
();
},
...
...
sails/src/assets/scripts/modules/supervisor/controllers/students.js
View file @
7b224042
...
...
@@ -24,7 +24,6 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
gender
:
'M'
,
lang
:
'es-es'
,
notes
:
''
,
pic
:
'defaultAvatar.jpg'
,
office
:
$scope
.
user
.
office
||
{
name
:
''
}
};
...
...
@@ -39,15 +38,6 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
console
.
log
(
"currentStudents: "
+
$scope
.
user
.
office
.
currentStudents
);
console
.
log
(
"maxStudents: "
+
$scope
.
user
.
office
.
maxStudents
);
// Compute number of licenses left
if
(
$scope
.
user
.
office
.
currentStudents
>=
$scope
.
user
.
office
.
maxStudents
)
{
$scope
.
num_licenses_left
=
0
;
}
else
{
$scope
.
num_licenses_left
=
$scope
.
user
.
office
.
maxStudents
-
$scope
.
user
.
office
.
currentStudents
;
}
}
else
{
$scope
.
user
.
office
=
{
name
:
''
};
}
...
...
@@ -114,6 +104,7 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
data
.
supervision
=
0
;
// by default, only related to office administrator
data
.
current_method
=
$translate
.
instant
(
'no_method'
);
data
.
current_instruction
=
$translate
.
instant
(
'no_instruction'
);
data
.
licenseIsValid
=
new
Date
(
data
.
license
.
expiration_ts
)
-
new
Date
()
>
0
?
true
:
false
;
$scope
.
students
.
push
(
data
);
$scope
.
resetForm
();
...
...
sails/src/assets/scripts/modules/supervisor/views/students.html
View file @
7b224042
...
...
@@ -39,7 +39,7 @@
</div>
</td>
<td>
<span
ng-show=
"!student.licenseIsValid"
class=
"license-warning text-danger glyphicon glyphicon-
warning
-sign"
aria-hidden=
"true"
popover=
"{{ 'license_invalid' | translate}}"
popover-trigger=
"mouseenter"
></span>
<span
ng-show=
"!student.licenseIsValid"
class=
"license-warning text-danger glyphicon glyphicon-
exclamation
-sign"
aria-hidden=
"true"
popover=
"{{ 'license_invalid' | translate}}"
popover-trigger=
"mouseenter"
></span>
</td>
<td>
<h4>
{{student.surname}}, {{student.name}}
</h4>
...
...
sails/src/assets/styles/main.css
View file @
7b224042
...
...
@@ -775,7 +775,7 @@ img.profile{
}
.delete_stu
,
.license-warning
{
font-size
:
24
px
;
font-size
:
18
px
;
margin-top
:
10px
;
}
...
...
sails/src/config/pictogram.js
View file @
7b224042
...
...
@@ -33,7 +33,7 @@ module.exports.pictogram = {
*/
getStudentAvatarUrl
:
function
(
filename
)
{
if
(
!
filename
)
filename
=
sails
.
config
.
pictogram
.
paths
.
de
af
ultAvatarFileName
;
filename
=
sails
.
config
.
pictogram
.
paths
.
de
fa
ultAvatarFileName
;
return
`/upload/studentAvatar/
${
filename
}
`
;
},
...
...
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