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