Ignore:
Timestamp:
01/25/16 11:02:28 (8 years ago)
Author:
nanardon
Message:

Add stat to dpmt page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/root/html/groups/dpmt.tt

    r1626 r1654  
    88<div class="objectform" id="objectform"> 
    99 
    10 <div style="margin: 2em; border: outset;"> 
     10<div style="margin: 2em; border: outset; width: auto; display: inline-block"> 
    1111<form action="[% c.uri_for(groupname, 'dpmt') %]"> 
    1212<input id="inactive" type="checkbox" name="inactive" value="1" [% "checked" IF c.req.param('inactive') %]> 
     
    4848[% ou = c.model('Accounts').db.get_object('user', u) %] 
    4949<a href="[% c.uri_for('/users', u) %]">[% ou.get_attributes('displayName') | html %]</a> 
     50([% ou.get_attributes('contratType') | html %]) 
    5051[% IF c.req.param('mail') %] 
    5152&lt;[% ou.get_attributes('mail') | html %]&gt; 
     
    6869</div> 
    6970 
     71<div id=chartdpmt style="display: inline-block; width: 600px; height: 500px;"> 
     72</div> 
     73 
     74<script> 
     75$(document).ready(function(){ 
     76  // Our ajax data renderer which here retrieves a text file. 
     77  // it could contact any source and pull data, however. 
     78  // The options argument isn't used in this renderer. 
     79 
     80    $.ajax({ 
     81      // have to use synchronous here, else the function 
     82      // will return before the data is fetched 
     83      // async: false, 
     84      url: "[% c.uri_for('/json/dpmtrh', dpmt) %]", 
     85      dataType:"json", 
     86      success: function(data) { 
     87          var plot2 = $.jqplot('chartdpmt', 
     88            [ data ], 
     89 
     90            { 
     91                title: '[% l('Status') %]', 
     92                seriesDefaults: { 
     93                    shadow: false, 
     94                    renderer: jQuery.jqplot.PieRenderer, 
     95                    rendererOptions: { padding: 2, sliceMargin: 2, showDataLabels: true } 
     96            }, 
     97            legend: { show:true, location: 'e' }, 
     98          }); 
     99        } 
     100    }); 
     101    $.jqplot.config.enablePlugins = true; 
     102}); 
     103</script> 
     104 
    70105</div> 
    71106[% END %] 
Note: See TracChangeset for help on using the changeset viewer.