[gen] Positioned checkboxes on the left.
This commit is contained in:
parent
dda894089a
commit
302d54c7ce
4 changed files with 36 additions and 27 deletions
|
@ -377,6 +377,11 @@ class ToolWrapper(AbstractWrapper):
|
|||
<table class="list" width="100%">
|
||||
<!-- Headers, with filters and sort arrows -->
|
||||
<tr if="showHeaders">
|
||||
<th if="checkboxes" class="cbCell" style=":cbDisplay">
|
||||
<img src=":url('checkall')" class="clickable"
|
||||
title=":_('check_uncheck')"
|
||||
onclick=":'toggleAllCbs(%s)' % q(checkboxesId)"/>
|
||||
</th>
|
||||
<th for="column in columns"
|
||||
var2="field=column.field;
|
||||
sortable=ztool.isSortable(field.name, className, 'search');
|
||||
|
@ -385,11 +390,6 @@ class ToolWrapper(AbstractWrapper):
|
|||
<x>::ztool.truncateText(_(field.labelId))</x>
|
||||
<x>:tool.pxSortAndFilter</x><x>:tool.pxShowDetails</x>
|
||||
</th>
|
||||
<th if="checkboxes" class="cbCell" style=":cbDisplay">
|
||||
<img src=":url('checkall')" class="clickable"
|
||||
title=":_('check_uncheck')"
|
||||
onclick=":'toggleAllCbs(%s)' % q(checkboxesId)"/>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<!-- Results -->
|
||||
|
@ -401,19 +401,19 @@ class ToolWrapper(AbstractWrapper):
|
|||
obj=zobj.appy(); mayView=zobj.mayView();
|
||||
cbId='%s_%s' % (checkboxesId, currentNumber)"
|
||||
class=":loop.zobj.odd and 'even' or 'odd'">
|
||||
<td for="column in columns"
|
||||
var2="field=column.field" id=":'field_%s' % field.name"
|
||||
width=":column.width"
|
||||
align=":column.align">:tool.pxQueryField</td>
|
||||
<!-- A checkbox if required -->
|
||||
<td if="checkboxes" class="cbCell" id=":cbId" style=":cbDisplay">
|
||||
<input type="checkbox" name=":checkboxesId" checked="checked"
|
||||
value=":zobj.id" onclick="toggleCb(this)"/>
|
||||
</td>
|
||||
<td for="column in columns"
|
||||
var2="field=column.field" id=":'field_%s' % field.name"
|
||||
width=":column.width"
|
||||
align=":column.align">:tool.pxQueryField</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- The button for selecting objects and closing the popup. -->
|
||||
<div if="inPopup and cbShown" align=":dright">
|
||||
<div if="inPopup and cbShown" align=":dleft">
|
||||
<input type="button" class="button"
|
||||
var="label=_('object_link_many')"
|
||||
value=":label"
|
||||
|
|
|
@ -705,8 +705,7 @@ class AbstractWrapper(object):
|
|||
|
||||
def __setattr__(self, name, value):
|
||||
appyType = self.o.getAppyType(name)
|
||||
if not appyType:
|
||||
raise 'Attribute "%s" does not exist.' % name
|
||||
if not appyType: raise Exception('Attribute "%s" does not exist.' %name)
|
||||
appyType.store(self.o, value)
|
||||
|
||||
def __getattribute__(self, name):
|
||||
|
@ -737,6 +736,7 @@ class AbstractWrapper(object):
|
|||
elif name == 'user': return self.o.getTool().getUser()
|
||||
elif name == 'fields': return self.o.getAllAppyTypes()
|
||||
elif name == 'siteUrl': return self.o.getTool().getSiteUrl()
|
||||
elif name == 'initiator': return self.o.getInitiatorInfo(True)
|
||||
# Now, let's try to return a real attribute.
|
||||
res = object.__getattribute__(self, name)
|
||||
# If we got an Appy field, return its value for this object
|
||||
|
@ -957,6 +957,13 @@ class AbstractWrapper(object):
|
|||
if res: return res._len # It is a LazyMap instance
|
||||
else: return 0
|
||||
|
||||
def ids(self, fieldName):
|
||||
'''Returns the identifiers of the objects linked to this one via field
|
||||
name p_fieldName. WARNING: do not modify this list, it is the true
|
||||
list that is stored in the database (excepted if empty). Modifying it
|
||||
will probably corrupt the database.'''
|
||||
return getattr(self.o.aq_base, fieldName, ())
|
||||
|
||||
def countRefs(self, fieldName):
|
||||
'''Counts the number of objects linked to this one via Ref field
|
||||
p_fieldName.'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue