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
25bfb99e
authored
Nov 30, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Issue #627 done
parent
ffcf82eb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
31 deletions
sails/src/assets/scripts/modules/student/controllers/collections.js
sails/src/assets/scripts/modules/student/views/addpicto.html
sails/src/assets/scripts/modules/student/views/collections.html
sails/src/assets/styles/main.css
sails/src/assets/scripts/modules/student/controllers/collections.js
View file @
25bfb99e
...
...
@@ -86,8 +86,6 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
grid
[
i
]
=
[];
for
(
j
=
0
;
j
<
gridWidth
;
j
++
)
{
grid
[
i
][
j
]
=
$scope
.
emptyStudentPicto
;
grid
[
i
][
j
].
attributes
.
coord_x
=
j
;
grid
[
i
][
j
].
attributes
.
coord_y
=
i
;
}
}
return
grid
;
...
...
@@ -305,7 +303,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
};
// Modal window to add pictos
$scope
.
open_add
=
function
(
selectedPictoCell
)
{
$scope
.
open_add
=
function
(
col
,
row
)
{
console
.
log
(
col
+
" "
+
row
);
var
modalInstance
=
$modal
.
open
({
animation
:
true
,
templateUrl
:
'modules/student/views/addpicto.html'
,
...
...
@@ -322,27 +321,25 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
});
// Returned data from the modal window
modalInstance
.
result
.
then
(
function
(
pictoId
)
{
// Send the picto to the server
$http
.
post
(
config
.
backend
+
'/stu/'
+
student
.
id
+
'/picto/'
+
pictoId
,
{
$http
.
post
(
config
.
backend
+
'/stu/'
+
$scope
.
studentData
.
id
+
'/picto/'
+
pictoId
,
{
attributes
:
{
id_cat
:
$scope
.
selectedCategory
.
id
,
coord_
x
:
selectedPictoCell
.
attributes
.
coord_x
,
coord_y
:
selectedPictoCell
.
attributes
.
coord_y
,
free_category_coord_x
:
selectedPictoCell
.
attributes
.
free_category_coord_x
,
free_category_coord_y
:
selectedPictoCell
.
attributes
.
free_category_coord_y
coord_x
:
$scope
.
showFreeCategory
?
null
:
col
,
coord_
y
:
$scope
.
showFreeCategory
?
null
:
row
,
status
:
'enabled'
,
free_category_coord_x
:
$scope
.
showFreeCategory
?
col
:
null
,
free_category_coord_y
:
$scope
.
showFreeCategory
?
row
:
null
}
})
.
success
(
function
(
studentPicto
)
{
$translate
(
'picto_added'
).
then
(
function
(
translation
)
{
ngToast
.
success
({
content
:
translation
});
});
console
.
log
(
studentPicto
.
attributes
);
placePicto
(
studentPicto
);
io
.
socket
.
post
(
'/stu/vocabulary'
,
{
action
:
'add'
,
attributes
:
{
id_stu
:
student
.
id
,
id_stu
:
$scope
.
studentData
.
id
,
stu_picto
:
studentPicto
}
},
function
()
{});
...
...
sails/src/assets/scripts/modules/student/views/addpicto.html
View file @
25bfb99e
...
...
@@ -46,18 +46,22 @@
class=
"picto_peq pull-left"
ng-repeat=
"p in pictos | filter:srch_term_picto"
>
<img
ng-src=
"{{p.uri}}"
popover=
"{{p.expressions[0].text}}"
popover-trigger=
"mouseenter"
/>
<a
ng-click=
"close(p.id)"
class=
"picto_add"
title=
"{{ 'add_picto' | translate}}"
>
<i
class=
"color_white glyphicon glyphicon-plus-sign"
aria-hidden=
"true"
></i>
</a>
<!-- Options to remove picto (Only for own pictos) -->
<div
class=
"picto_options"
ng-show=
"source == 'ownpictos'"
>
<a
ng-click=
"remove_own_picto(p.id)"
class=
"picto_remove"
title=
"{{ 'delete' | translate}}"
>
<span
class=
"color_red glyphicon glyphicon-remove-circle"
aria-hidden=
"true"
></span>
</a>
</div>
<div
class=
"picto_options"
>
<a
ng-click=
"remove_own_picto(p.id)"
class=
"picto_remove"
title=
"{{ 'delete' | translate}}"
>
<a
ng-click=
"close(p.id)"
class=
"picto_add"
title=
"{{ 'add_picto' | translate}}"
>
<i
class=
"color_green glyphicon glyphicon-plus-sign"
aria-hidden=
"true"
></i>
</a>
</a>
</div>
</div>
<div
class=
"clearfix"
></div>
</div>
...
...
sails/src/assets/scripts/modules/student/views/collections.html
View file @
25bfb99e
...
...
@@ -22,18 +22,20 @@
class=
"picto-grid picto-free-grid"
>
<div
ng-repeat=
"studentPictoRow in freeCategoryPictos"
ng-init=
"rowIndex = $index"
class=
"picto-grid__row"
>
<div
class=
"picto pull-left"
data-row=
"{{
$parent.$i
ndex }}"
data-column=
"{{
$i
ndex }}"
data-row=
"{{
rowI
ndex }}"
data-column=
"{{
colI
ndex }}"
id=
"student-picto-{{
studentPicto.id ||
('empty-' +
$index + '-' + $parent.$i
ndex)
('empty-' +
colIndex + '-' + rowI
ndex)
}}"
draggable
droppable
drop=
"handleDrop"
popover=
"{{studentPicto.expression.text}}"
popover-trigger=
"mouseenter"
ng-init=
"colIndex = $index"
ng-repeat=
"studentPicto in studentPictoRow track by $index"
>
<img
src=
"/app/img/redcross.png"
...
...
@@ -47,9 +49,19 @@
'deactivate': studentPicto.attributes.status == 'disabled'
}"
ng-style=
"{
'background-color': studentPicto.attributes.color
'background-color': studentPicto.attributes.color
|| '#ffffff'
}"
/>
<div
class=
"picto_options"
ng-if=
"studentPicto == emptyStudentPicto"
>
<a
ng-click=
"open_add(rowIndex, colIndex)"
class=
"picto_add"
title=
"{{ 'add_picto' | translate}}"
>
<i
class=
"color_green glyphicon glyphicon-plus-sign"
aria-hidden=
"true"
></i>
</a>
</div>
<div
class=
"picto_options"
ng-if=
"studentPicto !== emptyStudentPicto"
>
<a
...
...
@@ -140,18 +152,20 @@
<h3
class=
"picto-category-grid__title"
>
{{ selectedCategory.expression.text }}
</h3>
<div
ng-repeat=
"studentPictoRow in studentPictos[getCategoryId(selectedCategory)]"
ng-init=
"rowIndex = $index"
class=
"picto-grid__row"
>
<div
class=
"picto pull-left"
data-row=
"{{
$parent.$i
ndex }}"
data-column=
"{{
$i
ndex }}"
data-row=
"{{
rowI
ndex }}"
data-column=
"{{
colI
ndex }}"
id=
"student-picto-{{
studentPicto.id ||
('empty-' +
$index + '-' + $parent.$i
ndex)
('empty-' +
colIndex + '-' + rowI
ndex)
}}"
draggable
droppable
drop=
"handleDrop"
popover=
"{{studentPicto.expression.text}}"
popover-trigger=
"mouseenter"
ng-init=
"colIndex = $index"
ng-repeat=
"studentPicto in studentPictoRow track by $index"
>
<img
src=
"/app/img/redcross.png"
...
...
@@ -165,17 +179,17 @@
'deactivate': studentPicto.attributes.status == 'disabled'
}"
ng-style=
"{
'background-color': studentPicto.attributes.color
'background-color': studentPicto.attributes.color
|| '#ffffff'
}"
/>
<div
class=
"picto_options"
ng-if=
"studentPicto == emptyStudentPicto"
>
<a
ng-click=
"open_add(
studentPicto
)"
ng-click=
"open_add(
rowIndex, colIndex
)"
class=
"picto_add"
title=
"{{ 'add_picto' | translate}}"
>
<i
class=
"color_
white
glyphicon glyphicon-plus-sign"
aria-hidden=
"true"
></i>
<i
class=
"color_
green
glyphicon glyphicon-plus-sign"
aria-hidden=
"true"
></i>
</a>
</div>
<div
...
...
sails/src/assets/styles/main.css
View file @
25bfb99e
...
...
@@ -433,7 +433,10 @@ textarea.editable{
display
:
block
;
}
/* Picto options in own picto (supervisor) collection */
#collections
.picto_peq
.picto_options
.picto_remove
{
position
:
absolute
;
top
:
18px
;
left
:
20px
;
}
/* #collections .picto_peq .picto_options .picto_remove{ position: absolute; top: 18px; left: 20px; } */
#collections
.picto_peq
.picto_options
.picto_remove
{
position
:
absolute
;
top
:
2px
;
left
:
2px
;
}
#collections
.picto_peq
.picto_options
.picto_add
{
position
:
absolute
;
top
:
2px
;
right
:
2px
;
}
/* Picto options when adding a picto to a category */
.picto_cat
.picto_peq
.picto_options
.picto_remove
{
position
:
absolute
;
top
:
4px
;
left
:
7px
;
}
/* Picto options in student collection */
...
...
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