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
a2a34744
authored
Jan 25, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fixed #834
parent
1e1e63f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
sails/src/assets/scripts/modules/student/controllers/instructions.js
sails/src/assets/scripts/modules/student/views/instructions.html
sails/src/assets/scripts/modules/student/controllers/instructions.js
View file @
a2a34744
...
@@ -73,9 +73,9 @@ dashboardControllers.controller('StudentInstructionsCtrl', function StudentInstr
...
@@ -73,9 +73,9 @@ dashboardControllers.controller('StudentInstructionsCtrl', function StudentInstr
});*/
});*/
// Add method selected to the student
// Add method selected to the student
$scope
.
add_method
=
function
(){
$scope
.
add_method
=
function
(){
// Create a new method
// Create a new method
if
(
$scope
.
method_selected
.
id
==
0
){
if
(
$scope
.
method_selected
==
0
){
$http
$http
.
post
(
config
.
backend
+
'/method/new'
,
{
.
post
(
config
.
backend
+
'/method/new'
,
{
...
@@ -96,7 +96,7 @@ dashboardControllers.controller('StudentInstructionsCtrl', function StudentInstr
...
@@ -96,7 +96,7 @@ dashboardControllers.controller('StudentInstructionsCtrl', function StudentInstr
// Add method from templates
// Add method from templates
$http
$http
.
post
(
config
.
backend
+
'/method'
,
{
.
post
(
config
.
backend
+
'/method'
,
{
'id_mmethod'
:
$scope
.
method_selected
.
id
,
'id_mmethod'
:
$scope
.
method_selected
,
'id_stu'
:
$scope
.
studentData
.
id
'id_stu'
:
$scope
.
studentData
.
id
})
})
.
success
(
function
(
data
,
status
,
headers
,
config
)
{
.
success
(
function
(
data
,
status
,
headers
,
config
)
{
...
@@ -106,7 +106,7 @@ dashboardControllers.controller('StudentInstructionsCtrl', function StudentInstr
...
@@ -106,7 +106,7 @@ dashboardControllers.controller('StudentInstructionsCtrl', function StudentInstr
})
})
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
console
.
log
(
"Error from API: "
+
data
.
error
);
console
.
log
(
"Error from API: "
+
data
.
error
);
console
.
log
(
$scope
.
method_selected
.
id
+
" "
+
$scope
.
studentData
.
id
);
console
.
log
(
$scope
.
method_selected
+
" "
+
$scope
.
studentData
.
id
);
});
});
}
}
};
};
...
...
sails/src/assets/scripts/modules/student/views/instructions.html
View file @
a2a34744
...
@@ -5,18 +5,18 @@
...
@@ -5,18 +5,18 @@
<!-- Select to add new method -->
<!-- Select to add new method -->
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<select
class=
"form-control"
name=
"method_select"
id=
"method_select"
ng-model=
"method_selected"
>
<select
class=
"form-control"
name=
"method_select"
id=
"method_select"
ng-model=
"method_selected"
>
<option
ng-repeat=
"ma in methods_available track by $index"
<option
value=
""
translate
>
select_method
</option>
value=
"{{ $index }}
"
<option
ng-repeat=
"ma in methods_available track by $index
"
label=
"{{ ma.name }}
"
ng-value=
"ma.id
"
ng-if=
"ma.lang == user.lang"
>
label=
"{{ ma.name }}"
{{ ma.name }}
ng-if=
"ma.lang == user.lang"
>
</option>
{{ ma.name }}
</option>
<option
value=
""
translate
>
select
_method
</option>
<option
value=
"0"
translate
>
new
_method
</option>
</select>
</select>
<!-- Botón añadir método -->
<!-- Botón añadir método -->
<button
ng-click=
"add_method()"
class=
"btn btn-success btn-sm"
popover=
"{{ 'add' | translate}}"
popover-trigger=
"mouseenter"
ng-disabled=
"method_selected
.id
== undefined"
>
<button
ng-click=
"add_method()"
class=
"btn btn-success btn-sm"
popover=
"{{ 'add' | translate}}"
popover-trigger=
"mouseenter"
ng-disabled=
"method_selected == undefined"
>
<span
class=
"glyphicon glyphicon-plus"
aria-hidden=
"true"
></span>
<span
class=
"glyphicon glyphicon-plus"
aria-hidden=
"true"
></span>
</button>
</button>
...
...
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