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
2f994ab3
authored
Dec 20, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fixed problem with supervisor search in student setup
parent
51c69a8d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
sails/src/assets/scripts/modules/student/controllers/setup.js
sails/src/assets/scripts/modules/student/views/setup.html
sails/src/assets/scripts/modules/student/controllers/setup.js
View file @
2f994ab3
...
...
@@ -17,6 +17,8 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
// For tab navigation (here too, if the user refresh the page...)
$scope
.
nav
.
tab
=
'setup'
;
$scope
.
supsForm
=
{};
/**
* Updates the student picture
* @param {Angular file array} $files Image to be uploaded
...
...
@@ -136,8 +138,9 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
* The email used for search is fetched from $scope.email_sup.
*/
$scope
.
search_sup
=
function
()
{
console
.
log
(
"--> "
+
$scope
.
supsForm
.
email_sup
);
// Find tutor by email
$http
.
get
(
config
.
backend
+
'/sup/email/'
+
$scope
.
email_sup
)
$http
.
get
(
config
.
backend
+
'/sup/email/'
+
$scope
.
supsForm
.
email_sup
)
.
success
(
function
(
data
)
{
if
(
data
)
{
$scope
.
supToAdd
=
data
;
...
...
@@ -173,7 +176,7 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
// Add to the list of tutors in view
$scope
.
studentSupervisors
.
push
(
$scope
.
supToAdd
);
// Delete the email form field
$scope
.
email_sup
=
''
;
$scope
.
supsForm
.
email_sup
=
''
;
// Hide the message of supervisor founded
$scope
.
showmessagesupfound
=
false
;
})
...
...
@@ -214,7 +217,7 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
// Search tutor by email
$scope
.
search_tutor
=
function
()
{
// Find tutor by email
$http
.
get
(
config
.
backend
+
'/sup/email/'
+
$scope
.
email_tutor
)
$http
.
get
(
config
.
backend
+
'/sup/email/'
+
$scope
.
supsForm
.
email_tutor
)
.
success
(
function
(
data
)
{
// If it found the length is > 0
if
(
data
)
{
...
...
@@ -252,7 +255,7 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
// Add to the list of tutors in view
$scope
.
studentTutors
.
push
(
$scope
.
tutorToAdd
);
// Delete the email form field
$scope
.
email_tutor
=
''
;
$scope
.
supsForm
.
email_tutor
=
''
;
// Hide the message of tutor founded
$scope
.
showmessagetutorfound
=
false
;
...
...
sails/src/assets/scripts/modules/student/views/setup.html
View file @
2f994ab3
...
...
@@ -94,7 +94,7 @@
<p>
<form
role=
"search"
ng-submit=
"search_sup()"
>
<div
class=
"input-group"
>
<input
type=
"email"
class=
"form-control"
placeholder=
"{{ 'search_sup_email' | translate }}"
name=
"email_sup"
id=
"email_sup"
ng-model=
"email_sup"
required
>
<input
type=
"email"
class=
"form-control"
placeholder=
"{{ 'search_sup_email' | translate }}"
name=
"email_sup"
id=
"email_sup"
ng-model=
"
supsForm.
email_sup"
required
>
<div
class=
"input-group-btn"
>
<button
class=
"btn btn-default"
type=
"submit"
>
<span
class=
"glyphicon glyphicon-search"
></span>
...
...
@@ -134,7 +134,7 @@
<p>
<form
role=
"search"
ng-submit=
"search_tutor()"
>
<div
class=
"input-group"
>
<input
type=
"email"
class=
"form-control"
placeholder=
"{{ 'search_tutor_email' | translate }}"
name=
"email_tutor"
id=
"email_tutor"
ng-model=
"email_tutor"
required
>
<input
type=
"email"
class=
"form-control"
placeholder=
"{{ 'search_tutor_email' | translate }}"
name=
"email_tutor"
id=
"email_tutor"
ng-model=
"
supsForm.
email_tutor"
required
>
<div
class=
"input-group-btn"
>
<button
class=
"btn btn-default"
type=
"submit"
>
<span
class=
"glyphicon glyphicon-search"
></span>
...
...
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