Skip to content

Instantly share code, notes, and snippets.

@romulostorel
Created September 3, 2013 15:13
Show Gist options
  • Save romulostorel/6425254 to your computer and use it in GitHub Desktop.
Save romulostorel/6425254 to your computer and use it in GitHub Desktop.
class Type01 < Importer
def import!
ReportTemplate.create(report_type: 'academic_record', template: report)
end
protected
def report
" {% for person in people %}
<div id='landscape-container'>
{% if current_prefecture %}
<div class='header'>
<div class='banner'>
<img src={{current_prefecture.image_url}} class='image'>
</div>
<div class='title'>
<h2>{{current_prefecture.name}}</h2>
<h3>Secretaria Municipal de Educação</h3>
{% if current_school %}
<h4>{{ current_school.name }}</h4>
<h5>
{{ current_school.address }} - {{ current_school.city }}/{{ current_school.state_acronym }}
{% if !current_school.zip_code.blank? %}
- CEP: {{ current_school.zip_code }}
{% endif %}
{% if !current_school.phone.blank? %}
- Fone: {{ current_school.phone }}
{% endif %}
</h5>
{% endif %}
</div>
<div class='page'>
<h6>
Data: {{current_date}}
</h6>
<h6>
Hora: {{current_hour}}
</h6>
</div>
</div>
{% endif %}
{% for academic_record_group in person.academic_records_grouped_by_courses %}
{% for group in academic_record_group %}
{% if forloop.index == 1 %}
<div class='report_type'>
<h3>CERTIFICADO DE CONCLUSÃO DE CICLO, {{ group.name }} </h3>
<h3>{{ person.name }}</h3>
</div>
{% else %}
{% for academic_record in group %}
{% if forloop.index == 1 %}
<table class='historico'>
<tr>
<td rowspan=18 class='rotate_cell2 year'>
<div class='rotate_text2'>{{ academic_record.academic_year }}</div>
</td>
<th colspan={{ academic_record.report_th_colspan }} class='esquerda' height=30px>
Estabelecimento: {{ academic_record.school }} - Município: {{ academic_record.city }}
</th>
</tr>
<tr>
<th colspan={{ academic_record.report_th_colspan }} class='esquerda' height=30px>
Estado: {{ academic_record.state }} - Mínimo para aprovação: {{academic_record.minimal_approval_percentage}} %
</th>
</tr>
<tr>
<td rowspan=10 class='legendamenor' >
Verificação de <br>
Redimento
</td>
<th colspan={{academic_record.base_naciona_disciplines_size}} height=30px>
Base Nacional Comum
</th>
<td rowspan=10 class='rotate_cell subtotal'>
<div class=rotate_text>Sub total em Horas (H.R)</div>
</td>
{% if academic_record.has_diversified_disciplines? %}
<th colspan={{academic_record.diversified_disciplines_size}}>
Parte Diversificada
</th>
{% endif %}
<td rowspan=10 class='rotate_cell'>
{% if academic_record.has_diversified_disciplines? %}
<div class=rotate_text>Sub total em Horas (H.R)</div>
{% endif %}
</td>
<td rowspan=10 class=rotate_cell>
<div class=rotate_text>Carga horaria Total(H.R)</div>
</td>
</tr>
<tr>
{% for base_naciona_discipline in academic_record.base_naciona_disciplines %}
<td rowspan=9 class=rotate_cell>
<div class=rotate_text>{{ base_naciona_discipline }}</div>
</td>
{% endfor %}
{% for diversified_discipline in academic_record.diversified_disciplines %}
<td rowspan=9 class=rotate_cell>
<div class=rotate_text>{{ diversified_discipline }}</div>
</td>
{% endfor %}
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<td class=legendamenor>
Aproveitamento
</td>
{% for base_naciona_discipline in academic_record.base_naciona_disciplines %}
<td>{{ base_naciona_discipline.note }}</td>
{% endfor %}
<td class='subtotal' rowspan=3>{{ academic_record.base_naciona_disciplines_total_hours }}</td>
{% for diversified_discipline in academic_record.diversified_disciplines %}
<td>{{ diversified_discipline.note }}</td>
{% endfor %}
<td rowspan=3>{{ academic_record.diversified_disciplines_total_hours }}</td>
<td rowspan=3>{{ academic_record.total_work_load }}</td>
<tr>
<td class=legendamenor>
C.H Curricular (H.R)
</td>
{% for base_naciona_discipline in academic_record.base_naciona_disciplines %}
<td>{{ base_naciona_discipline.work_load }}</td>
{% endfor %}
{% for diversified_discipline in academic_record.diversified_disciplines %}
<td>{{ diversified_discipline.work_load }}</td>
{% endfor %}
</tr>
<tr>
<td class=legendamenor>
Faltas (H.R)
</td>
{% for base_naciona_discipline in academic_record.base_naciona_disciplines %}
<td>{{ base_naciona_discipline.faults }}</td>
{% endfor %}
{% for diversified_discipline in academic_record.diversified_disciplines %}
<td>{{ diversified_discipline.faults }}</td>
{% endfor %}
</tr>
<tr>
<td class=legendamenor>
Observação
</td>
<td colspan={{ academic_record.report_td_national_base_collspan }}>{{ academic_record.notes }}</td>
<td class=legendamenor>
Situação do aluno
</td>
<td colspan={{ academic_record.repot_th_diversified_collspan }}>{{ academic_record.result }}</td>
</tr>
</table>
{% else %}
<table class='historico'>
<tr>
<td rowspan=18 class='rotate_cell2 year'>
<div class='rotate_text2'>{{ academic_record.academic_year }}</div>
</td>
<th colspan={{ academic_record.report_th_colspan }} class='esquerda' height=30px>
Estabelecimento: {{ academic_record.school }} - Município: {{ academic_record.city }}
</th>
</tr>
<tr>
<th colspan={{ academic_record.report_th_colspan }} class='esquerda' height=30px>
Estado: {{ academic_record.state }} - Mínimo para aprovação: {{academic_record.minimal_approval_percentage}} %
</th>
</tr>
<tr>
<td rowspan=10 class='legendamenor' >
Verificação de <br>
Redimento
</td>
<th colspan={{academic_record.base_naciona_disciplines_size}} height=30px>
Base Nacional Comum
</th>
<td rowspan=10 class='rotate_cell subtotal'>
<div class=rotate_text>Sub total em Horas (H.R)</div>
</td>
{% if academic_record.has_diversified_disciplines? %}
<th colspan={{academic_record.diversified_disciplines_size}}>
Parte Diversificada
</th>
{% endif %}
<td rowspan=10 class='rotate_cell'>
{% if academic_record.has_diversified_disciplines? %}
<div class=rotate_text>Sub total em Horas (H.R)</div>
{% endif %}
</td>
<td rowspan=10 class=rotate_cell>
<div class=rotate_text>Carga horaria Total(H.R)</div>
</td>
</tr>
<tr>
{% for base_naciona_discipline in academic_record.base_naciona_disciplines %}
<td rowspan=9 class=rotate_cell>
<div class=rotate_text>{{ base_naciona_discipline }}</div>
</td>
{% endfor %}
{% for diversified_discipline in academic_record.diversified_disciplines %}
<td rowspan=9 class=rotate_cell>
<div class=rotate_text>{{ diversified_discipline }}</div>
</td>
{% endfor %}
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<td class=legendamenor>
Aproveitamento
</td>
{% for base_naciona_discipline in academic_record.base_naciona_disciplines %}
<td>{{ base_naciona_discipline.note }}</td>
{% endfor %}
<td class='subtotal' rowspan=3>{{ academic_record.base_naciona_disciplines_total_hours }}</td>
{% for diversified_discipline in academic_record.diversified_disciplines %}
<td>{{ diversified_discipline.note }}</td>
{% endfor %}
<td rowspan=3>{{ academic_record.diversified_disciplines_total_hours }}</td>
<td rowspan=3>{{ academic_record.total_work_load }}</td>
<tr>
<td class=legendamenor>
C.H Curricular (H.R)
</td>
{% for base_naciona_discipline in academic_record.base_naciona_disciplines %}
<td>{{ base_naciona_discipline.work_load }}</td>
{% endfor %}
{% for diversified_discipline in academic_record.diversified_disciplines %}
<td>{{ diversified_discipline.work_load }}</td>
{% endfor %}
</tr>
<tr>
<td class=legendamenor>
Faltas (H.R)
</td>
{% for base_naciona_discipline in academic_record.base_naciona_disciplines %}
<td>{{ base_naciona_discipline.faults }}</td>
{% endfor %}
{% for diversified_discipline in academic_record.diversified_disciplines %}
<td>{{ diversified_discipline.faults }}</td>
{% endfor %}
</tr>
<tr>
<td class=legendamenor>
Observação
</td>
<td colspan={{ academic_record.report_td_national_base_collspan }}>{{ academic_record.notes }}</td>
<td class=legendamenor>
Situação do aluno
</td>
<td colspan={{ academic_record.repot_th_diversified_collspan }}>{{ academic_record.result }}</td>
</tr>
</table>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endfor %}
</div>
{% endfor %}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment