From 31b4905c349465a8882d82889a205a253eaa3b8c Mon Sep 17 00:00:00 2001
From: Leonardo <leopiccionia@gmail.com>
Date: Tue, 15 Dec 2020 13:41:50 -0300
Subject: [PATCH] Split participation reports into components - Part 4

---
 .../role-participation-report.component.js    | 31 +++++++++
 .../role-participation-report.module.js       |  8 +++
 .../user-participation-report.app.js          |  1 +
 ...ty-participation-report-list.template.html |  2 +-
 .../role-participation-report.template.html   | 63 +++++++++++++++++++
 .../user-participation-report.template.html   |  2 +
 .../templates/user-participation-report.html  |  2 +
 courses_legacy/urls.py                        |  1 +
 8 files changed, 109 insertions(+), 1 deletion(-)
 create mode 100644 courses_legacy/static/js/reports/role-participation-report/role-participation-report.component.js
 create mode 100644 courses_legacy/static/js/reports/role-participation-report/role-participation-report.module.js
 create mode 100644 courses_legacy/templates/components/role-participation-report.template.html

diff --git a/courses_legacy/static/js/reports/role-participation-report/role-participation-report.component.js b/courses_legacy/static/js/reports/role-participation-report/role-participation-report.component.js
new file mode 100644
index 0000000..16e8fe7
--- /dev/null
+++ b/courses_legacy/static/js/reports/role-participation-report/role-participation-report.component.js
@@ -0,0 +1,31 @@
+(function() {
+    'use strict';
+
+    angular
+        .module('roleParticipationReport')
+        .component('roleParticipationReport', {
+            templateUrl: '/role-participation-report.template.html',
+            controller: RoleParticipationReportCtrl,
+            bindings: {
+                date: '<',
+            },
+        });
+
+    RoleParticipationReportCtrl.$inject = ['$scope'];
+
+    function RoleParticipationReportCtrl ($scope) {
+
+        var ctrl = this;
+
+        ctrl.minimized = false;
+        ctrl.toggleDetails = toggleDetails;
+
+        ctrl.$onInit = function() {
+
+        };
+
+        function toggleDetails() {
+            ctrl.minimized = !ctrl.minimized;
+        }
+    }
+})();
diff --git a/courses_legacy/static/js/reports/role-participation-report/role-participation-report.module.js b/courses_legacy/static/js/reports/role-participation-report/role-participation-report.module.js
new file mode 100644
index 0000000..ecba0e0
--- /dev/null
+++ b/courses_legacy/static/js/reports/role-participation-report/role-participation-report.module.js
@@ -0,0 +1,8 @@
+(function() {
+    'use strict';
+
+    angular.module('roleParticipationReport', [
+        'reports.services',
+    ]);
+
+})();
diff --git a/courses_legacy/static/js/reports/user-participation-report/user-participation-report.app.js b/courses_legacy/static/js/reports/user-participation-report/user-participation-report.app.js
index f5e4940..7c2e6e6 100644
--- a/courses_legacy/static/js/reports/user-participation-report/user-participation-report.app.js
+++ b/courses_legacy/static/js/reports/user-participation-report/user-participation-report.app.js
@@ -5,6 +5,7 @@
         'cityParticipationReport',
         'cityParticipationReportList',
         'classroomParticipationReport',
+        'roleParticipationReport',
         'userParticipationGraphicsReport',
         'userParticipationReport',
         'shared',
diff --git a/courses_legacy/templates/components/city-participation-report-list.template.html b/courses_legacy/templates/components/city-participation-report-list.template.html
index f5a9775..6c5492c 100644
--- a/courses_legacy/templates/components/city-participation-report-list.template.html
+++ b/courses_legacy/templates/components/city-participation-report-list.template.html
@@ -19,7 +19,7 @@
     <div class="filter-row">
       <span>Busque pelo nome do município:</span>
       <input name="city" placeholder="Busque por um município" aria-label="Nome">
-      <span>Filtre a lista</span>
+      <span>Filtre a lista:</span>
       <select name="city" aria-label="Nome">
         <option>Selecione o Nome</option>
       </select>
diff --git a/courses_legacy/templates/components/role-participation-report.template.html b/courses_legacy/templates/components/role-participation-report.template.html
new file mode 100644
index 0000000..c716295
--- /dev/null
+++ b/courses_legacy/templates/components/role-participation-report.template.html
@@ -0,0 +1,63 @@
+{% verbatim %}
+
+<section class="widget container-fluid">
+  <header class="widget-header">
+    <div class="row">
+      <div class="col-sm-12 col-md-12">
+        <span class="pull-left">
+          <h2 class="widget-title">Funções</h2>
+        </span>
+        <div class="pull-right">
+          <button class="btn btn-primary collapse-button" ng-click="$ctrl.toggleDetails()">
+            {{ $ctrl.minimized ? 'Exibir' : 'Minimizar' }} dados<i ng-class="['fa', $ctrl.minimized ? 'fa-chevron-down' : 'fa-chevron-up']" aria-hidden="true"></i>
+          </button>
+        </div>
+      </div>
+    </div>
+  </header>
+  <main class="widget-body" ng-if="!$ctrl.minimized">
+    <div class="filter-row">
+      <span>Filtre a lista:</span>
+      <select name="nte" aria-label="NTE">
+        <option>Selecione o NTE</option>
+      </select>
+      <select name="network" aria-label="Rede">
+        <option>Selecione a Rede</option>
+      </select>
+      <select name="city" aria-label="Município">
+        <option>Selecione o Município</option>
+      </select>
+    </div>
+    <div class="table-wrapper">
+      <table>
+        <thead>
+          <tr>
+            <th>Cargo/função</th>
+            <th>Participantes ativos</th>
+            <th>Participantes não ativos</th>
+            <th>Usuários não participantes</th>
+            <th>Total geral</th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr>
+            <td><b>Apoio pedagógico</b></td>
+            <td>124</td>
+            <td>124</td>
+            <td>163</td>
+            <td>600</td>
+          </tr>
+          <tr class="total">
+            <td><b>TOTAL GERAL</b></td>
+            <td>124</td>
+            <td>124</td>
+            <td>163</td>
+            <td>600</td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+  </main>
+</section>
+
+{% endverbatim %}
diff --git a/courses_legacy/templates/components/user-participation-report.template.html b/courses_legacy/templates/components/user-participation-report.template.html
index e5cbaf2..7e90208 100644
--- a/courses_legacy/templates/components/user-participation-report.template.html
+++ b/courses_legacy/templates/components/user-participation-report.template.html
@@ -11,6 +11,8 @@
   <city-participation-report-list ntes="$ctrl.ntes_reports"></city-participation-report-list>
 
   <classroom-participation-report></classroom-participation-report>
+
+  <role-participation-report></role-participation-report>
 </div>
 
 {% endverbatim %}
diff --git a/courses_legacy/templates/user-participation-report.html b/courses_legacy/templates/user-participation-report.html
index a0e96f8..96519ef 100644
--- a/courses_legacy/templates/user-participation-report.html
+++ b/courses_legacy/templates/user-participation-report.html
@@ -34,6 +34,8 @@
 <script type="text/javascript" src="{% static 'js/reports/city-participation-report-list/city-participation-report-list.component.js' %}"></script>
 <script type="text/javascript" src="{% static 'js/reports/classroom-participation-report/classroom-participation-report.module.js' %}"></script>
 <script type="text/javascript" src="{% static 'js/reports/classroom-participation-report/classroom-participation-report.component.js' %}"></script>
+<script type="text/javascript" src="{% static 'js/reports/role-participation-report/role-participation-report.module.js' %}"></script>
+<script type="text/javascript" src="{% static 'js/reports/role-participation-report/role-participation-report.component.js' %}"></script>
 <script type="text/javascript" src="{% static 'js/reports/user-participation-graphics-report/user-participation-graphics-report.module.js' %}"></script>
 <script type="text/javascript" src="{% static 'js/reports/user-participation-graphics-report/user-participation-graphics-report.component.js' %}"></script>
 <script type="text/javascript" src="{% static 'js/reports/user-participation-report/user-participation-report.module.js' %}"></script>
diff --git a/courses_legacy/urls.py b/courses_legacy/urls.py
index 27cab2c..8ff0bee 100644
--- a/courses_legacy/urls.py
+++ b/courses_legacy/urls.py
@@ -210,6 +210,7 @@ urlpatterns = [
     url(r'^city-participation-report.template.html', TemplateView.as_view(template_name="components/city-participation-report.template.html"), name='city-participation-report'),
     url(r'^city-participation-report-list.template.html', TemplateView.as_view(template_name="components/city-participation-report-list.template.html"), name='city-participation-report-list'),
     url(r'^classroom-participation-report.template.html', TemplateView.as_view(template_name="components/classroom-participation-report.template.html"), name='classroom-participation-report'),
+    url(r'^role-participation-report.template.html', TemplateView.as_view(template_name="components/role-participation-report.template.html"), name='role-participation-report'),
     url(r'^user-participation-graphics-report.template.html', TemplateView.as_view(template_name="components/user-participation-graphics-report.template.html"), name='user-participation-graphics-report'),
     url(r'^user-participation-report.template.html', TemplateView.as_view(template_name="components/user-participation-report.template.html"), name='user-participation-report'),
 
-- 
GitLab