<html>
    <head>
        <style>
            @page{
                size: A4 landscape;
                margin: 2cm;
                @frame content_frame {          /* Content Frame */
                    
                }
                @frame footer_frame {           /* Another static Frame */
                    -pdf-frame-content: footer_content;
                    left: 50pt;  bottom: 20pt; height: 20pt;
                }
            }            

         @page regular_template { margin: 2cm; }
            .page-break {                
                page-break-before: always;               
            }
            .page-avoid{
                page-break-inside: avoid;
            }
            .header-info{
                font-size: 8pt;
            }

            .header-info,.global , .desc {
                table-layout: fixed;
                width: 100%;
                border: 1px solid black;
            }

            .header-info th {
                text-align: left;
                padding: 3px;
                padding-bottom: 0;
            }

            .header-info td {
                width: 40%;
                padding: 1mm;
            }
            .header-info th{
                width: 20%;
                padding: 1mm;
            }
            .desc {
                padding: 1mm;
                font-size: 10pt;
            }
            .desc td{
                width 50%;
            }
            .global{
                padding: 1mm;
                font-size: 10pt;
            }
            .global td{
                width: 100%;
            }
            h3{
               font-size: 14pt;
            }
            .clerc-logo{
                width: 100px;
                right: 0;
                top: 500px;
                position: fixed;
            }



        </style>
    </head>

    <body>        
        <div id="footer_content">            
            Évaluation étudiant clerc - page <pdf:pagenumber>
            sur <pdf:pagecount>
        </div>

        {%for object in objects%}
            <table style="padding-bottom: 0.2cm">
                <tr>
                    <td width="90%">
                         <h3>Liste des évaluations #{{object.ID}} {{object.sStudent}}</h3>
                    </td>
                    <td><img src="https://cloud.ambulance-clerc.ch/index.php/s/CpHfC8HoXNfdoCZ/preview" alt="ClercNet Logo" class="clerc-logo" style="float: right"></td>
                </tr>
            </table>

            <table class="header-info page-avoid">
                <tbody>
                    <tr class="">
                        <th class=" " align="center" >Date de suivi</th>
                        <td class="">{{ object.dtDate }}</td>
                        <th class=" " align="center">Date de d'écriture</th>
                        <td class="">{{ object.dtCreated }}</td>
                    </tr>
                    <tr class="">
                        <th class="" align="center">Auteur</th>
                        <td class="">{{ object.sAuthor }}</td>
                        <th class=" " align="center">Second auteur</th>
                        <td class="">{{ object.sAuthor_2e }}</td>
                    </tr>

                    <tr class="">
                        <th class=" "align="center">Type de suivi</th>
                        <td class="">{{ object.get_eval_type }}</td>
                    </tr>
                    {% if object.nEval_Type == "1" %}
                    <tr class="">
                        <th class=" "align="center">N° FIP</th>
                        <td class="">{{ object.sRef }}</td>
                        <th class=" "align="center">Priorité</th>
                        <td class="">{{ object.get_inter_priority }}</td>
                    </tr>
                    <tr>
                        <th class=" "align="center">Description</th>
                        <td class="" >{{ object.sInter_Desc }}</td>
                        <th class=" "align="center">Rôle de l'étudiant</th>
                        <td class="">{{ object.get_student_role }}</td>
                    </tr>
                    <tr class="">
                        <th class=" "align="center">Nature de l'intervention</th>
                        <td class="">{{ object.get_inter_nature }}</td>
                        <th class=" "align="center">Complexité de l'intervention</th>
                        <td class="" >{{ object.get_inter_complexity }}</td>
                    </tr>
                    {% endif %}
                </tbody>
            </table>
        <hr>
        <div class="page-avoid">
        <table class="desc page-avoid">
                    <tbody>                        
                        <tr>
                            <th class="">
                                Éléments positifs (auto-évaluation)
                            </th>
                            <th class="">
                                Éléments positifs (Encadrant)
                            </th>
                        </tr>
                        <tr class="">
                            <td class="" >
                                {{object.o_Auto_eval.sDesc_pos | safe}}
                            </td>
                            <td class="" >
                                {{object.o_Encadrant_eval.sDesc_pos | safe}}
                            </td>
                        </tr>
                    </tbody>
                </table>
                </div>
                <div class="page-avoid">
                <table class="desc page-break page-avoid">
                    <tbody>                                                   
                         <tr class="">
                                <th class="">
                                    Éléments à améliorer (auto-évaluation)
                                </th>
                                <th class="">
                                    Éléments améliorer (Encadrant)
                                </th>
                            </tr>
                            <tr>
                                <td class="" >
                                    {{object.o_Auto_eval.sDesc_neg | safe}}
                                </td>
                                <td class="" >
                                    {{object.o_Encadrant_eval.sDesc_neg | safe}}
                                </td>
                            </tr>                        
                    </tbody>
                 </table>
                </div>
                <div class="page-avoid">
                <table class="global page-break">
                            <tbody>
                                <tr class="">
                                    <th class="">Avis Global</th>

                                </tr>
                                <tr class="">
                                    <td class="">{{ object.o_Encadrant_eval.sDesc_global | safe }}</td>
                                </tr>
                                <tr class="">
                                    <th class="">Avis Global (auto)</th>

                                </tr>
                                <tr class="">
                                    <td class="">{{ object.o_Auto_eval.sDesc_global | safe}}</td>
                                </tr>
                            </tbody>
                        </table>
                </div>

                 <pdf:nextpage  />
         {%endfor%}

    </body>
</html>
