Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses-legacy
Commits
70a0fd09
Commit
70a0fd09
authored
4 years ago
by
Matheus Miranda
Browse files
Options
Download
Plain Diff
Merge branch 'develop' into 'master'
Update general user report list See merge request
!65
parents
dec45cae
2d3feca4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
67 deletions
+8
-67
courses_legacy/static/js/reports/general-user-report-list/general-user-report-list.component.js
...al-user-report-list/general-user-report-list.component.js
+7
-16
courses_legacy/templates/components/general-user-report-list.template.html
...mplates/components/general-user-report-list.template.html
+1
-1
courses_legacy/templates/user-general-report.html
courses_legacy/templates/user-general-report.html
+0
-50
No files found.
courses_legacy/static/js/reports/general-user-report-list/general-user-report-list.component.js
View file @
70a0fd09
...
...
@@ -17,6 +17,7 @@
ctrl
.
city
=
''
;
ctrl
.
classroom
=
''
;
ctrl
.
count
=
0
;
ctrl
.
filters
=
null
;
ctrl
.
keyword
=
''
;
ctrl
.
filteredUsers
=
[];
...
...
@@ -33,12 +34,12 @@
ctrl
.
filters
=
data
;
});
fetchUserReportPage
(
1
);
fetchUserReportPage
();
};
ctrl
.
$doCheck
=
function
()
{
if
(
ctrl
.
city
!==
ctrl
.
old
.
city
||
ctrl
.
classroom
!==
ctrl
.
old
.
classroom
||
ctrl
.
nte
!==
ctrl
.
old
.
nte
||
ctrl
.
role
!==
ctrl
.
old
.
role
)
{
fetchUserReportPage
(
1
);
fetchUserReportPage
();
}
if
(
ctrl
.
users
!==
ctrl
.
old
.
users
||
ctrl
.
keyword
!==
ctrl
.
old
.
keyword
)
{
filterUsers
();
...
...
@@ -55,37 +56,27 @@
ctrl
.
old
.
users
=
ctrl
.
users
;
};
function
fetchUserReportPage
(
page
)
{
const
params
=
{
page
};
let
filteredRequest
=
false
;
function
fetchUserReportPage
()
{
const
params
=
{
page
:
ctrl
.
page
};
if
(
ctrl
.
city
)
{
params
.
municipio
=
ctrl
.
city
;
filteredRequest
=
true
;
}
if
(
ctrl
.
classroom
)
{
params
.
turma
=
ctrl
.
classroom
;
filteredRequest
=
true
;
}
if
(
ctrl
.
nte
)
{
params
.
nte
=
ctrl
.
nte
;
filteredRequest
=
true
;
}
if
(
ctrl
.
role
)
{
params
.
funcao
=
ctrl
.
role
;
filteredRequest
=
true
;
}
GeneralUserReports
.
get
(
params
,
(
data
)
=>
{
const
usersList
=
ctrl
.
users
.
slice
();
usersList
.
splice
((
page
-
1
)
*
50
,
0
,
...
data
.
results
);
usersList
.
splice
((
ctrl
.
page
-
1
)
*
50
,
0
,
...
data
.
results
);
ctrl
.
count
=
data
.
count
;
ctrl
.
users
=
usersList
;
if
(
page
===
1
)
{
const
totalPages
=
Math
.
ceil
(
data
.
count
/
50
);
for
(
let
extraPage
=
2
;
(
filteredRequest
&&
extraPage
<=
totalPages
)
||
(
extraPage
<=
20
);
extraPage
++
)
{
fetchUserReportPage
(
extraPage
);
}
}
});
}
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/templates/components/general-user-report-list.template.html
View file @
70a0fd09
...
...
@@ -33,7 +33,7 @@
<div
class=
"classroom-reports--list"
>
<user-report
ng-repeat=
"user in $ctrl.paginatedUsers track by user.id"
user=
"user"
></user-report>
</div>
<ul
uib-pagination
boundary-links=
"true"
total-items=
"$ctrl.
filteredUsers.length
"
ng-model=
"$ctrl.page"
rotate=
"false"
force-ellipses=
"true"
max-size=
"
10
0"
items-per-page=
"
10
0"
class=
"pagination pagination-md"
previous-text=
"‹"
next-text=
"›"
first-text=
"primeira"
last-text=
"última"
ng-if=
"$ctrl.
filteredUsers.length
>
10
0"
></ul>
<ul
uib-pagination
boundary-links=
"true"
total-items=
"$ctrl.
count
"
ng-model=
"$ctrl.page"
rotate=
"false"
force-ellipses=
"true"
max-size=
"
2
0"
items-per-page=
"
5
0"
class=
"pagination pagination-md"
previous-text=
"‹"
next-text=
"›"
first-text=
"primeira"
last-text=
"última"
ng-if=
"$ctrl.
count
>
5
0"
></ul>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/templates/user-general-report.html
deleted
100644 → 0
View file @
dec45cae
{% extends "base.html" %}
{% load staticfiles %}
{% load compress %}
{% load join_path %}
{% load is_assistant_or_coordinator %}
{% block js %} {{ block.super }}
<!-- <script src="https://bowercdn.net/c/angular-click-outside-2.10.2/clickoutside.directive.js"></script> -->
{% compress js %}
<script
type=
"text/javascript"
src=
"{% static 'js/core/app.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/core/controllers.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/core/services.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/core/filters.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/main-nav/app.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/main-nav/controller.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/main-nav/services.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/classroom/iat.classroom.services.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/reports/services.js' %}"
></script>
<script
src=
"{% static 'js/reports/user-report/user-report.module.js' %}"
></script>
<script
src=
"{% static 'js/reports/user-report/user-report.component.js' %}"
></script>
<script
src=
"{% static 'js/reports/general-user-report-list/general-user-report-list.module.js' %}"
></script>
<script
src=
"{% static 'js/reports/general-user-report-list/general-user-report-list.component.js' %}"
></script>
<script
src=
"{% static 'js/reports/user-course-report-list/user-course-report-list.module.js' %}"
></script>
<script
src=
"{% static 'js/reports/user-course-report-list/user-course-report-list.component.js' %}"
></script>
<script
src=
"{% static 'js/reports/user-course-report/user-course-report.module.js' %}"
></script>
<script
src=
"{% static 'js/reports/user-course-report/user-course-report.component.js' %}"
></script>
<script
src=
"{% static 'js/reports/user-actions-report-list/user-actions-report-list.module.js' %}"
></script>
<script
src=
"{% static 'js/reports/user-actions-report-list/user-actions-report-list.component.js' %}"
></script>
<script
src=
"{% static 'js/reports/user-access-report/user-access-report.module.js' %}"
></script>
<script
src=
"{% static 'js/reports/user-access-report/user-access-report.component.js' %}"
></script>
<script
src=
"{% static 'js/reports/general-user-report-list/general-user-report.app.js' %}"
></script>
{% endcompress %}
{% endblock %}
{% block body_attrs %}
ng-app="user-general-report"
{% endblock %}
{% block content %}
<general-user-report-list></general-user-report-list>
{% endblock %}
This diff is collapsed.
Click to expand it.
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