Ignore:
Timestamp:
May 12, 2010 9:01:28 AM (14 years ago)
Author:
mylan
Message:

Change label of 'Add new row' button to 'Add new'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.referencedatagridfield/trunk/quintagroup/referencedatagridfield/skins/referencedatagridfield/referencedatagridwidget.pt

    r2281 r2293  
    3232    <!-- EDIT --> 
    3333    <metal:define define-macro="edit"> 
    34       <div metal:use-macro="field_macro | here/datagridwidget/macros/edit"> 
    35       </div> 
    36        
     34      <metal:use use-macro="field_macro | here/widgets/field/macros/edit"> 
     35        <metal:body metal:fill-slot="widget_body"> 
     36             
     37            <table class="datagridwidget-table-edit" 
     38                        tal:attributes="id python: 'datagridwidget-table-' + field.getName()" 
     39                style="width: 100%" 
     40                tal:define="columns python:widget.getColumnDefs(field, context); 
     41                            fielddata python: value or field.getEditAccessor(context)();                            
     42                            eventHandler python: test(widget.isAutoInsertEnabled(), 'dataGridFieldFunctions.autoInsertRow(event)', '') 
     43                           "> 
     44                <thead tal:condition="python: widget.hasHeader(context, field)"> 
     45                    <tr> 
     46                                                <tal:block tal:repeat="c columns" 
     47                         ><th tal:attributes="class python:not c['visible'] and 'dgw-hidden-column discreet' or 'discreet';"  style="text-align: left"  
     48                            tal:content="c/label"  
     49                            i18n:translate="">Column name</th 
     50                                                 ></tal:block> 
     51                        <th />  
     52                        <th /> 
     53                        <th /> 
     54                    </tr> 
     55                </thead>      
     56                        
     57                <tbody tal:attributes="id python: 'datagridwidget-tbody-' + field.getName()"> 
     58                 
     59                        <tal:comment replace="nothing"> 
     60                                <!-- Existing data rows --> 
     61                        </tal:comment> 
     62                 
     63                    <tal:row-loop tal:repeat="rows fielddata" tal:define="newRow python: False"> 
     64                        <tal:row metal:use-macro="here/datagridwidget_edit_row/macros/edit_row"/> 
     65                    </tal:row-loop> 
     66 
     67                        <tal:comment replace="nothing"> 
     68                                <!-- A template row for adding new rows dynamically --> 
     69                        </tal:comment> 
     70                     
     71                        <tal:empty-row tal:define="newRow python: True"> 
     72                                <tal:template metal:use-macro="here/datagridwidget_edit_row/macros/edit_empty_row"/>                     
     73                        </tal:empty-row>                                 
     74                 </tbody> 
     75            </table> 
     76 
     77            <a class="datagridwidget-add-button" id="datagridwidget-add-button" 
     78                           tal:condition="field/allow_insert" 
     79                   tal:attributes='onclick python: "dataGridFieldFunctions.addRow(\"" + field.getName() + "\")"'>Add new</a> 
     80 
     81                        <tal:comment replace="nothing"> 
     82                                <!-- Button that allowes creation of the initial row when DGF is empty --> 
     83                        </tal:comment> 
     84                                    
     85        </metal:body> 
     86      </metal:use> 
    3787    </metal:define> 
    3888 
Note: See TracChangeset for help on using the changeset viewer.