﻿/*
 * Ref.:  ctrls_liste_projets.js 
 *        _f_globales.js
 *       
 * (c) 2011 jean.st_pierre@yahoo.com
 * ---------------------------------
 */


//
// Views ----------------------------------------------------------------------
//
//

//
// Presentation et coordonnees du developpeur - 
class_liste_projets.prototype.view_presentation = function() {
    //
    // Appel du controlleur - 
    this.ctrl_presentation(); // retourne details_presentation {}
    //
    this.pres = this.details_presentation;
    //
    html  = '<h1>' + this.pres.nom + '</h1>';
    html += '<h3>' + this.pres.poste + '</h3>';
    html += '<div id="phone">' + this.pres.coords.phone + '</div>';
    //
    html += '<div id="email">';
    html += '   <a href="mailto:' + this.pres.coords.email + '">' + this.pres.coords.email + '</a>';
    html += '</div>';
    //
    html += '<h2>' + this.pres.titre + '</h2>';
    //
    document.write(html);
}

//
//
class_liste_projets.prototype.view_projets = function() {
    //
    // Appel du controlleur - 
    this.ctrl_projets(); // Retourne this.projets{}
    //
    html = '';
    for (i = 0; i < this.projets.length; i++) {
        if (this.projets[i].nom_projet) {
            //
            // Debut de la rangee - 
            html += '<tr valign="top">';
            html += ' <td class="div_data">';
            // html += this.projets[i].nom_projet + '<br />';
            //
            // Nom du projet - 
            html += '   <h2 id="h2_' + i + '"><a href="javascript:details_projet(' + i + ');" title="Afficher les détails">' + this.projets[i].nom_projet + '</a></h2>';
            //
            // Le conteneur des details - pas affiche par defaut - 
            html += '   <div id="sous_contenant_' + i + '" style="display:none;">';
            //
            // vhost et dir
            /*
            html += '     <table cellspacing="0" cellpadding="0" border="0">';
            //
            // Y a-t-il un vhost pour ce projet ? - 
            this.f_vhost_dir = f_vhost_dir;
            if (this.projets[i].vhost) {
                html += this.f_vhost_dir(this.projets[i].vhost,this.projets[i].dir);
            } else {
                html += this.f_vhost_dir(0,this.projets[i].dir);
            }
            html += '     </table>';
            */
            //
            // Langages -
            html += '     <h3>Langages utilisés:</h3>';
            html += '     <ul class="ul_langages">';
            for (j = 0; j < this.projets[i].langages.length; j++) {
                html += '   <li>' + this.projets[i].langages[j] + '</li>';
            }
            html += '     </ul>';
            //
            // Fonctions standards -
            html += '     <h3>Fonctions standards:</h3>';
            html += '     <ul class="ul_fonctions_st">';
            for (k = 0; k < this.projets[i].fonctions.standards.length; k++) {
                html += '   <li>' + this.projets[i].fonctions.standards[k] + '</li>';
            }
            html += '     </ul>';
            //
            // Fonctions particulieres -
            if (this.projets[i].fonctions.particulieres) {
                html += ' <h3>Fonctions particulières:</h3>';
                html += ' <ul class="ul_fonctions_part">';
                for (l = 0; l < this.projets[i].fonctions.particulieres.length; l++) {
                    html += '<li>' + this.projets[i].fonctions.particulieres[l] + '</li>';
                }
                html += ' </ul>';
            }
            html += '     <br />';
            //
            // Fin du conteneur - 
            html += '   </div>';
            html += ' </td>';
            // Fin de la rangee - 
            html += '</tr>';
            //
        }
    }
    //
    document.write(html);
}
