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="scripts/js/external/chart.js/Chart.bundle.min.js"></script>
  13.  
  14. !set wims_menu_items=!append line back2,1,cmd=resume\
  15.  to $wims_menu_items
  16.  
  17. <div style="max-width: 50em;margin:auto;">
  18.   <h1 class="wims_title">$wims_name_job</h1>
  19.   <canvas id="canvas"></canvas>
  20. </div>
  21.  
  22. <p class="wimscenter">Pour les actualisations, nous prenons en compte la date de dernière  mise à jour de chaque module.</p>
  23.  
  24. <table class="wimstable" style="width:100%;max-width: 90em;font-size:75%;">
  25.   <caption>$wims_name_table</caption>
  26.   <thead>
  27.     <tr>
  28.       <th>&nbsp;</th>
  29.       !for _tmp= 1997 to 2016
  30.         <th scope="col">$_tmp</th>
  31.       !next
  32.       <th scope="col">Total</th>
  33.     </tr>
  34.   </thead>
  35.   <tbody>
  36.     <tr>
  37.       <th scope="row">
  38.         Cr&eacute;ations
  39.         <!--div class="wims_credits">Source : feed://wims.unice.fr/wims/rss/new.xml</div-->
  40.       </th>
  41.       !reset totmodules
  42.       !set modules_created = 54,133,155,103,71,135,198,116,75,121,208,69,32,18,74,36,23,22,21,9
  43.       !for _tmp in $modules_created
  44.         <td>$_tmp</td>
  45.         !set totmodules = $totmodules + $_tmp
  46.       !next
  47.       <td><strong>$[$totmodules]</strong></th>
  48.     </tr>
  49.     <tr>
  50.       <th scope="row">
  51.         Dernières Actualisations
  52.         <!--div class="wims_credits">Source : feed://wims.unice.fr/wims/rss/modif.xml</div-->
  53.       </th>
  54.       !reset totmodules
  55.       !set modules_updated = 3,50,54,60,20,34,60,89,26,53,108,78,55,61,72,136,166,88,244,216
  56.       !for _tmp in $modules_updated
  57.         <td>$_tmp</td>
  58.         !set totmodules = $totmodules + $_tmp
  59.       !next
  60.       <td><strong>$[$totmodules]</strong></th>
  61.     </tr>
  62.   </tbody>
  63. </table>
  64. <script>
  65.  
  66.  
  67.   var barChartData = {
  68.     labels: ["1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015", "2016"],
  69.     datasets: [{
  70.       label: 'Créations',
  71.       backgroundColor: "rgba(54, 162, 235, 0.8)",
  72.       data: [$modules_created]
  73.     }, {
  74.       label: 'Dernières Actualisations',
  75.       backgroundColor: "rgba(75, 192, 192, 0.8)",
  76.       data: [$modules_updated]
  77.     }]
  78.  
  79.   };
  80.   window.onload = function() {
  81.     var ctx = document.getElementById("canvas").getContext("2d");
  82.     window.myBar = new Chart(ctx, {
  83.       type: 'bar',
  84.       data: barChartData,
  85.       options: {
  86.         title:{
  87.           display:true,
  88.           text:"$wims_name_graph"
  89.         },
  90.         tooltips: {
  91.           mode: 'label'
  92.         },
  93.         responsive: true,
  94.         scales: {
  95.           xAxes: [{
  96.             stacked: true,
  97.           }],
  98.           yAxes: [{
  99.             stacked: true
  100.           }]
  101.         }
  102.       }
  103.     });
  104.   };
  105. </script>
  106.  
  107.