Subversion Repositories wimsdev

Rev

Rev 13163 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1.  
  2. !set wims_name_job = Modules Créés ou Actualisés par année
  3. !set wims_name_graph = Évolution des publications de modules par année
  4. !set wims_name_table = Fréquence de création ou d’actualisation des modules publiés
  5.  
  6.  
  7. !! Les informations ci-dessous ont été obtenues en parcourant l'ensemble des modules publiés.
  8. !! Les dates de creation et de mise à jour viennent de l'information "COPYRIGHT" de l'INDEX de chaque module.
  9.  
  10. !! Informations obtenues via le script python ModulesStats.py > statsWIMS.txt
  11.  
  12. !!<script src="themes/_packages/bower_components/Chart.js/dist/Chart.bundle.js"></script>
  13. <script src="scripts/js/bower_components/Chart.js/dist/Chart.bundle.min.js"></script>
  14.  
  15.  
  16. <div style="max-width: 50em;margin:auto;">
  17.    <h1 class="wims_title">$wims_name_job</h1>
  18.    <canvas id="canvas"></canvas>
  19. </div>
  20.    <p class="wimscenter">Pour les actualisations, nous prenons en compte la date de dernière mise à jour de chaque module.</p>
  21. <table class="wimstable" style="width:100%;max-width: 90em;font-size:75%;">
  22.    <caption>$wims_name_table</caption>
  23.    <thead>
  24.        <tr>
  25.            <th>&nbsp;</th>
  26.            !for _tmp= 1997 to 2016
  27.                <th scope="col">$_tmp</th>
  28.            !next
  29.            <th scope="col">Total</th>
  30.        </tr>
  31.    </thead>
  32.    <tbody>
  33.        <tr>
  34.            <th scope="row">
  35.                Cr&eacute;ations
  36.                <!--div class="wims_credits">Source : feed://wims.unice.fr/wims/rss/new.xml</div-->
  37.            </th>
  38.            !reset totmodules
  39.            !set modules_created = 54,133,155,103,71,135,198,116,75,121,208,69,32,18,74,36,23,22,21,9
  40.            !for _tmp in $modules_created
  41.                <td>$_tmp</td>
  42.                !set totmodules = $totmodules + $_tmp
  43.            !next
  44.            <td><strong>$[$totmodules]</strong></th>
  45.        </tr>
  46.        <tr>
  47.            <th scope="row">
  48.                Dernières Actualisations
  49.                <!--div class="wims_credits">Source : feed://wims.unice.fr/wims/rss/modif.xml</div-->
  50.            </th>
  51.            !reset totmodules
  52.            !set modules_updated = 3,50,54,60,20,34,60,89,26,53,108,78,55,61,72,136,166,88,244,216
  53.            !for _tmp in $modules_updated
  54.                <td>$_tmp</td>
  55.                !set totmodules = $totmodules + $_tmp
  56.            !next
  57.            <td><strong>$[$totmodules]</strong></th>
  58.        </tr>
  59.    </tbody>
  60. </table>
  61. <script>
  62.  
  63.  
  64.    var barChartData = {
  65.        labels: ["1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015", "2016"],
  66.        datasets: [{
  67.            label: 'Créations',
  68.            backgroundColor: "rgba(54, 162, 235, 0.8)",
  69.            data: [$modules_created]
  70.        }, {
  71.            label: 'Dernières Actualisations',
  72.            backgroundColor: "rgba(75, 192, 192, 0.8)",
  73.            data: [$modules_updated]
  74.        }]
  75.  
  76.    };
  77.    window.onload = function() {
  78.        var ctx = document.getElementById("canvas").getContext("2d");
  79.        window.myBar = new Chart(ctx, {
  80.            type: 'bar',
  81.            data: barChartData,
  82.            options: {
  83.                title:{
  84.                    display:true,
  85.                    text:"$wims_name_graph"
  86.                },
  87.                tooltips: {
  88.                    mode: 'label'
  89.                },
  90.                responsive: true,
  91.                scales: {
  92.                    xAxes: [{
  93.                        stacked: true,
  94.                    }],
  95.                    yAxes: [{
  96.                        stacked: true
  97.                    }]
  98.                }
  99.            }
  100.        });
  101.    };
  102. </script>
  103.  
  104.