Skip to content

Commit

Permalink
Corrigida a animação e a cor de fundo do acordeão de diário de aula (#…
Browse files Browse the repository at this point in the history
…477)

Co-authored-by: TI GUSTAVO <ti.gustavo@ipti.org.br>
  • Loading branch information
Gusta-Santos and TI GUSTAVO authored Oct 3, 2023
1 parent dd97651 commit bb43f2f
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 68 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

## [Versão 3.58.98]
- Corrigida a animação e a cor de fundo do acordeão de diário de aula

## [Versão 3.58.97]
- Corrigindo a responsividade do formulário de aluno

Expand Down
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$debug = getenv("YII_DEBUG");
defined('YII_DEBUG') or define('YII_DEBUG', $debug);

define("TAG_VERSION", '3.58.97');
define("TAG_VERSION", '3.58.98');


define("YII_VERSION", Yii::getVersion());
Expand Down
31 changes: 14 additions & 17 deletions js/classes/class-contents/_initialization.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function loadClassContents() {
if ($("#classroom").val() !== "" && $("#month").val() !== "" && (!$("#disciplines").is(":visible") || $("#disciplines").val() !== "")) {


jQuery.ajax({
type: 'POST',
url: "?r=classes/getClassContents",
Expand All @@ -17,7 +17,7 @@ function loadClassContents() {
$("#classroom, #month, #disciplines, #classesSearch, #classesSearchMobile").attr("disabled", "disabled");
},
success: function (data) {
var data = jQuery.parseJSON(data);
data = jQuery.parseJSON(data);
if (data.valid) {
createTable(data);
$("#print").addClass("show").removeClass("hide");
Expand Down Expand Up @@ -80,15 +80,13 @@ $("#classroom").on("change", function () {

$("#month").on("change", loadClassContents);

//$("#disciplines").on("change", loadClassContents);

$("#disciplines").on("change", function () {
loadClassContents();
var disciplinesValue = $("#disciplines option:selected").text();
let disciplinesValue = $("#disciplines option:selected").text();
$("#disciplinesValue").text(disciplinesValue);
var monthValue = $("#month option:selected").text();
let monthValue = $("#month option:selected").text();
$("#monthValue").text(monthValue);
var classroomValue = $("#classroom option:selected").text();
let classroomValue = $("#classroom option:selected").text();
$("#classroomValue").text(classroomValue);
});

Expand All @@ -104,9 +102,9 @@ $(document).on("click", "#print", function () {

$("#save, #save-button-mobile").on('click', function () {
$(".alert-save").hide();
var classContents = [];
let classContents = [];
$(".day-row").each(function () {
var students = [];
let students = [];
$(this).find(".student-diary-of-the-day").each(function () {
students.push({
id: $(this).attr("studentid"),
Expand Down Expand Up @@ -151,11 +149,11 @@ $("#save, #save-button-mobile").on('click', function () {
$('.heading-buttons').css('width', $('#content').width());

$(document).on("click", ".classroom-diary-button", function () {
var button = this;
let button = this;
$(".classroom-diary-day").val($(button).closest("tr").attr("day"));
$(".js-classroom-diary").val($(button).parent().find(".classroom-diary-of-the-day").val());
$(".js-std-classroom-diaries").each(function () {
var value = $(button).parent().find(".student-diary-of-the-day[studentid=" + $(this).find(".js-student-classroom-diary").attr("studentid") + "]").val();
let value = $(button).parent().find(".student-diary-of-the-day[studentid=" + $(this).find(".js-student-classroom-diary").attr("studentid") + "]").val();
$(this).find(".js-student-classroom-diary").val(value);
value !== ""
? $(this).find(".accordion-title").find(".fa").removeClass("fa-file-o").addClass("fa-file-text-o")
Expand All @@ -165,12 +163,11 @@ $(document).on("click", ".classroom-diary-button", function () {
});

$(document).on("click", ".js-add-classroom-diary", function () {
var tr = $("#class-contents tbody").find("tr[day=" + $(".classroom-diary-day").val() + "]");
let tr = $("#class-contents tbody").find("tr[day=" + $(".classroom-diary-day").val() + "]");

tr.find(".classroom-diary-of-the-day").val($(".js-classroom-diary").val());
$(".js-student-classroom-diary").each(function () {
tr.find(".student-diary-of-the-day[studentid=" + $(this).attr
("studentid") + "]").val($(this).val())
tr.find(".student-diary-of-the-day[studentid=" + $(this).attr("studentid") + "]").val($(this).val())
});
});

Expand All @@ -185,4 +182,4 @@ $(document).on("input", ".js-student-classroom-diary", function () {
$(this).val() === ""
? $(this).closest(".accordion-group").find(".accordion-title").find(".fa").removeClass("fa-file-text-o").addClass("fa-file-o")
: $(this).closest(".accordion-group").find(".accordion-title").find(".fa").removeClass("fa-file-o").addClass("fa-file-text-o");
});
});
51 changes: 13 additions & 38 deletions js/classes/class-contents/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ function createTable(data) {
$('#class-contents > thead').html('<tr><th class="center">Dias</th><th style="text-align:left">Conteúdo ministrado em sala de aula</th></tr>');
$('#class-contents > tbody').html('');

var options = "";
let options = "";
$.each(data.courseClasses, function () {
options += '<option value="' + this.id + '" disciplineid="' + this.edid + '" disciplinename="' + this.edname + '">' + this.cpname + "|" + this.order + "|" + this.objective + "|" + this.edname + '</option>';
});
var accordionBuilt = false;
var accordionHtml = "";
let accordionBuilt = false;
let accordionHtml = "";
accordionHtml += `<div id='accordion' class='t-accordeon-primary'>`
$.each(data.classContents, function (day, classContent) {
var studentInputs = "";
let studentInputs = "";
if (Object.keys(classContent.students).length) {
$.each(classContent.students, function () {
studentInputs += "<input type='hidden' class='student-diary-of-the-day' studentid='" + this.id + "' value='" + this.diary + "'>";
Expand All @@ -20,7 +20,7 @@ function createTable(data) {
`<div class='align-items--center'>
<h4 class='t-title'>
<span class='t-icon-person icon-color'></span>
${this.name}
${this.name}
</h4>
</div>
<div class='ui-accordion-content js-std-classroom-diaries'>
Expand All @@ -37,8 +37,8 @@ function createTable(data) {
$(".classroom-diary-no-students").show();
}

var head = '<th class="center vmiddle contents-day ">' + ((day < 10) ? '0' : '') + day + '</th>';
var body = '<td class="t-multiselect">'
let head = '<th class="center vmiddle contents-day ">' + ((day < 10) ? '0' : '') + day + '</th>';
let body = '<td class="t-multiselect">'
+ '<input type="hidden" class="classroom-diary-of-the-day" value="' + classContent.diary + '">'
+ studentInputs
+ '<span class="t-icon-annotation t-icon classroom-diary-button ' + (!classContent.available ? "disabled" : "") + '" data-toggle="tooltip" title="Diário"></span>'
Expand All @@ -47,7 +47,7 @@ function createTable(data) {
+ '</select>'
+ '</td>';
$('#class-contents > tbody').append('<tr class="center day-row" day="' + day + '">' + head + body + '</tr>');
var select = $("select.course-classes-select").last();
let select = $("select.course-classes-select").last();
select.children("option").each(function () {
if (!select.find("optgroup[value=" + $(this).attr("disciplineid") + "]").length) {
select.append("<optgroup value='" + $(this).attr("disciplineid") + "' label='" + $(this).attr("disciplinename") + "'></optgroup>");
Expand All @@ -64,11 +64,11 @@ function createTable(data) {
$('select.course-classes-select').select2({
width: "calc(100% - 40px)",
formatSelection: function (state) {
var textArray = state.text.split("|");
let textArray = state.text.split("|");
return 'Plano de Aula "' + textArray[0] + '": Aula ' + textArray[1];
},
formatResult: function (data, container) {
var textArray = data.text.split("|");
let textArray = data.text.split("|");
if (textArray.length === 1) {
return "<div class='course-classes-optgroup'><b>" + textArray[0] + "</b></div>";
} else {
Expand All @@ -84,34 +84,9 @@ function createTable(data) {
$( "#accordion" ).accordion({
active: false,
collapsible: true,
icons: false
icons: false,
heightStyle: "content"
});
})

}

/*
const tableContents = {
// data
data: {},
setData: function (data){
this.data = data;
},
// mutate
// render
renderTable: function () {
this.table = $("<table></table>");
},
renderRowContent: function (days, students) {
array.forEach(element => {
let row = $("<th></th>");
this.table.append()
});
},
renderListStudents: function () {},
renderListItemStudent: function () {},
build: function () {}
};
*/
}
2 changes: 1 addition & 1 deletion sass/css/main.css

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions sass/scss/_accordeon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@

.ui-accordion-header {
background: $colorsBaseCloudLight;

&:hover,
&--active {
background-color: $colorsBaseCloudLightHover;
}
}

.ui-accordion-content {
background: $colorsBaseCloudLight !important;
}

.icon-color {
Expand Down
34 changes: 23 additions & 11 deletions themes/default/views/classes/classContents.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,41 @@
<?php echo Yii::t('default', 'Print') ?>
</a>
</div>
<a id="save" class='t-button-primary'><?php echo Yii::t('default', 'Save') ?></a>
<a id="save" class='t-button-primary hide'><?php echo Yii::t('default', 'Save') ?></a>
</div>
<table class="table table-bordered table-striped visible-print">
<table class="table table-bordered table-striped visible-print" summary="Tabela relacionada a informações da escola">
<tr>
<th>Escola:</th>
<th scope="school">Escola:</th>
<td colspan="7"><?php echo $school->inep_id . " - " . $school->name ?></td>
<tr>
<tr>
<th>Estado:</th>
<th scope="uf">Estado:</th>
<td colspan="1"><?php echo $school->edcensoUfFk->name . " - " . $school->edcensoUfFk->acronym ?></td>
<th>Municipio:</th>
<th scope="city">Municipio:</th>
<td colspan="1"><?php echo $school->edcensoCityFk->name ?></td>
<th>Endereço:</th>
<th scope="address">Endereço:</th>
<td colspan="1"><?php echo $school->address ?></td>
<tr>
<tr>
<th>Localização:</th>
<td colspan="1"><?php echo ($school->location == 1 ? "URBANA" : "RURAL") ?></td>
<th>Dependência Administrativa:</th>
<th scope="location">Localização:</th>
<td colspan="1"><?php echo $school->location == 1 ? "URBANA" : "RURAL" ?></td>
<th scope="Administrative Dependence">Dependência Administrativa:</th>
<td colspan="3"><?php
$ad = $school->administrative_dependence;
echo ($ad == 1 ? "FEDERAL" : ($ad == 2 ? "ESTADUAL" : ($ad == 3 ? "MUNICIPAL" :
"PRIVADA")));
switch ($ad) {
case 1:
echo "FEDERAL";
break;
case 2:
echo "ESTADUAL";
break;
case 3:
echo "MUNICIPAL";
break;
default:
echo "PRIVADA";
break;
}
?></td>
<tr>
</table>
Expand Down

0 comments on commit bb43f2f

Please sign in to comment.