Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iena-path-block
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iena
iena-path-block
Commits
42e2f138
Commit
42e2f138
authored
4 years ago
by
Lea
Browse files
Options
Downloads
Patches
Plain Diff
tracker_js_features
parent
072285df
Branches
Branches containing commit
No related tags found
Loading
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
amd/build/suivi.js
+33
-56
33 additions, 56 deletions
amd/build/suivi.js
career_tracker.php
+5
-3
5 additions, 3 deletions
career_tracker.php
js/suivi_career.js
+0
-1
0 additions, 1 deletion
js/suivi_career.js
templates/career_table_tracker.mustache
+12
-1
12 additions, 1 deletion
templates/career_table_tracker.mustache
with
50 additions
and
61 deletions
amd/build/suivi.js
+
33
−
56
View file @
42e2f138
/**
/**
* Handle add/remove competency links.
* Handle add/remove competency links.
*
*
* @module block
/
career
* @module block
_
career
/suivi
* @package career
* @package
block_
career
* @copyright 2021 Léa Marais
* @copyright 2021 Léa Marais
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
*/
define
([
'
jquery
'
,
'
core/ajax
'
,
'
core/templates
'
,
'
core/str
'
],
define
([
'
jquery
'
,
'
core/ajax
'
,
'
core/templates
'
,
'
core/str
'
],
function
(
$
,
ajax
,
templates
,
str
)
{
function
(
$
,
ajax
,
templates
,
str
)
{
var
all_selected
=
false
;
var
all_selected
=
false
;
var
data
=
[];
var
data
=
[];
return
{
return
{
registerFilters
:
function
(){
registerFilters
:
function
(){
$
(
"
#path-select
"
).
on
(
'
change
'
,
function
(
e
){
$
(
"
#path-select
"
).
on
(
'
change
'
,
function
(
e
){
changePath
();
changePath
();
});
});
},
},
}
function
getOption
(){
return
(
"
#path-select
"
).
val
();
}
}
function
getCompleteUrl
(){
url
=
window
.
location
.
search
;
urlParams
=
new
URLSearchParams
(
url
);
function
getCompleteUrl
(){
courseid
=
urlParams
.
get
(
'
courseid
'
);
url
=
window
.
location
.
search
;
pathid
=
urlParams
.
get
(
'
courseid
'
);
urlParams
=
new
URLSearchParams
(
url
);
if
(
!
pathid
){
courseid
=
urlParams
.
get
(
'
courseid
'
);
pathid
=
$
(
"
#path-select
"
).
val
();
completeUrl
=
'
career_tracker.php?courseid=
'
+
courseid
;
}
return
completeUrl
;
completeUrl
=
'
career_tracker.php?courseid=
'
+
courseid
+
'
&pathid=
'
+
pathid
;
}
return
completeUrl
;
}
function
changePath
(){
function
changeGroup
(){
var
select
=
$
(
"
#path-select
"
).
val
();
completeUrl
=
getCompleteUrl
();
var
completeUrl
=
getCompleteUrl
();
loadMessage
(
"
loading
"
);
$
.
ajax
({
$
.
ajax
({
url
:
completeUrl
,
url
:
completeUrl
,
data
:
{
action
:
'
test
'
},
data
:
{
pathid
:
select
},
type
:
'
post
'
,
type
:
'
post
'
,
success
:
function
(
request
)
{
success
:
function
(
request
)
{
console
.
log
(
JSON
.
parse
(
request
));
$
(
"
#tracker
"
).
html
(
request
);
changeCompletion
();
//reloadTable(JSON.parse(request));
}
});
}
}
function
reloadTable
(
params
){
});
console
.
log
(
params
);
}
url
=
getCompleteUrl
();
});
templates
.
render
(
'
block_career/career_table_tracker
'
,
params
)
\ No newline at end of file
.
done
(
function
(
html
,
js
){
console
.
log
(
"
done done
"
);
$
(
"
#partial-table
"
).
html
(
html
);
templates
.
runTemplateJS
(
js
);
window
.
history
.
pushState
(
'
suivi
'
,
""
,
url
);
})
.
fail
(
function
(){
loadMessage
(
"
error
"
);
});
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
career_tracker.php
+
5
−
3
View file @
42e2f138
...
@@ -31,7 +31,7 @@ require_login($course, false, NULL);
...
@@ -31,7 +31,7 @@ require_login($course, false, NULL);
$PAGE
->
set_title
(
get_string
(
'title_plugin'
,
'block_career'
));
$PAGE
->
set_title
(
get_string
(
'title_plugin'
,
'block_career'
));
$PAGE
->
set_heading
(
$OUTPUT
->
heading
(
$COURSE
->
fullname
,
2
,
'headingblock header outline'
));
$PAGE
->
set_heading
(
$OUTPUT
->
heading
(
$COURSE
->
fullname
,
2
,
'headingblock header outline'
));
echo
$OUTPUT
->
header
();
// echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\">";
// echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\">";
//$content = new view_career_list();
//$content = new view_career_list();
...
@@ -40,10 +40,12 @@ if(!empty($id_path)){
...
@@ -40,10 +40,12 @@ if(!empty($id_path)){
$renderer
->
get_tracker
(
$id_path
);
$renderer
->
get_tracker
(
$id_path
);
}
}
else
{
else
{
$PAGE
->
requires
->
js
(
"/blocks/career/js/suivi_career.js"
);
//
$PAGE->requires->js("/blocks/career/js/suivi_career.js");
//$id_path=getOption();
//$id_path=getOption();
//print_r($_GET['pathfilter']);
//print_r($_GET['pathfilter']);
//ici une valeur de parcours en brut pour pas avoir d'erreurs au chargement de la page
//ici une valeur de parcours en brut pour pas avoir d'erreurs au chargement de la page
echo
$OUTPUT
->
header
();
$renderer
->
get_tracker
(
1
);
$renderer
->
get_tracker
(
1
);
echo
$OUTPUT
->
footer
();
}
}
echo
$OUTPUT
->
footer
();
This diff is collapsed.
Click to expand it.
js/suivi_career.js
deleted
100644 → 0
+
0
−
1
View file @
072285df
console
.
log
(
'
Test
'
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
templates/career_table_tracker.mustache
+
12
−
1
View file @
42e2f138
<h2>
{{
track
}}
</h2>
<div
id=
"tracker"
><h2>
{{
track
}}
</h2>
{{^
isset
}}
{{^
isset
}}
<form
style=
"clear: right;"
class=
"form-inline"
action=
""
method=
"GET"
>
<form
style=
"clear: right;"
class=
"form-inline"
action=
""
method=
"GET"
>
...
@@ -18,6 +19,7 @@
...
@@ -18,6 +19,7 @@
</form>
</form>
{{/
isset
}}
{{/
isset
}}
<table
id=
"suivi"
>
<table
id=
"suivi"
>
<thead
style =
"height:100%;width:150%;overflow-x: hidden; "
>
<thead
style =
"height:100%;width:150%;overflow-x: hidden; "
>
<tr
id=
"modules"
>
<tr
id=
"modules"
>
...
@@ -62,3 +64,12 @@
...
@@ -62,3 +64,12 @@
{{/
students
}}
{{/
students
}}
</tbody>
</tbody>
</table>
</table>
</div>
{{#
js
}}
require(['block_career/suivi'], function(module) {
module.registerFilters();
});
{{/
js
}}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment