]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/acq/funding_source/list.tt2
I18N: Make everything in tt2 files translatable.
[working/Evergreen.git] / Open-ILS / src / templates / acq / funding_source / list.tt2
1 [% WRAPPER 'base.tt2' %]
2
3 <!-- The main grid lives here -->
4 <script type="text/javascript">
5     function getName(rowIndex, item) {
6         if(!item) return '';
7         var name = this.grid.store.getValue(item, 'name');
8         var id = this.grid.store.getValue(item, 'id');
9         // weird hack to pass the data we need to the formatter which is now required for HTML cell values
10         return id + ':' + name;
11     }
12
13     function formatName(value) {
14         if(value) {
15             var vals = value.split(/:/);
16             return '<a href="[% ctx.base_path %]/acq/funding_source/view/'+vals[0]+'">'+vals[1]+'</a>';
17         }
18     }
19 </script>
20
21 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
22
23     <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
24         <div>[% l('Funding Sources') %]</div>
25         <div>
26             <button dojoType='dijit.form.Button' onClick='fsGrid.showCreateDialog()'>[% l('New Funding Source') %]</button>
27             <button dojoType='dijit.form.Button' onClick='fsGrid.deleteSelected()'>[% l('Delete Selected') %]</button>
28         </div>
29     </div>
30
31     <table  jsId="fsGrid"
32             dojoType="openils.widget.AutoGrid"
33             fieldOrder="['id', 'name', 'owner', 'code', 'currency_type', 'balance']"
34             query="{name: '*'}"
35             defaultCellWidth='"auto"'
36             fmClass='acqfs'
37             editOnEnter='true'>
38         <thead>
39             <tr>
40                 <th field="name" get='getName' formatter='formatName'/>
41                 <th field="owner" get='getOrgInfo'/>
42                 <th field="balance" get='getBalanceInfo'/>
43             </tr>
44         </thead>
45     </table>
46 </div>
47
48 <!-- load the page-specific JS -->
49 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/acq/financial/list_funding_sources.js'></script>
50
51 [% END %]