[gen] Optimized PXs.

This commit is contained in:
Gaetan Delannay 2013-07-15 13:39:05 +02:00
parent 1810373304
commit 5d350de491
8 changed files with 36 additions and 39 deletions

View file

@ -47,7 +47,7 @@ class Calendar(Field):
goForward=not endDate or (endDate.strftime(fmt) > \
grid[-1][-1].strftime(fmt))">
<!-- Go to the previous month -->
<img style="cursor:pointer" if="goBack" src=":img('arrowLeftSimple')"
<img class="clickable" if="goBack" src=":img('arrowLeftSimple')"
onclick=":'askMonthView(%s,%s,%s,%s)' % \
(q(ajaxHookId),q(objUrl),q(field.name),q(previousMonth))"/>
<!-- Go back to the default date -->
@ -60,7 +60,7 @@ class Calendar(Field):
q(objUrl), q(field.name), q(defaultDateMonth))"
disabled=":defaultDate.strftime(fmt)==monthDayOne.strftime(fmt)"/>
<!-- Go to the next month -->
<img style="cursor:pointer" if="goForward" src=":img('arrowRightSimple')"
<img class="clickable" if="goForward" src=":img('arrowRightSimple')"
onclick=":'askMonthView(%s, %s, %s, %s)' % (q(ajaxHookId), \
q(objUrl), q(field.name), q(nextMonth))"/>
<span>:_('month_%s' % monthDayOne.aMonth())</span>
@ -104,7 +104,7 @@ class Calendar(Field):
<span if="day == 1">:_('month_%s_short' % date.aMonth())"></span>
<!-- Icon for adding an event -->
<x if="mayCreate">
<img style="visibility:hidden; cursor:pointer"
<img class="clickable" style="visibility:hidden"
var="info=field.getApplicableEventsTypesAt(contextObj, date, \
allEventTypes, preComputed, True)"
if="info['eventTypes']" src=":img('plus')"
@ -113,7 +113,7 @@ class Calendar(Field):
q(info['message']))"/>
</x>
<!-- Icon for deleting an event -->
<img if="mayDelete" style="visibility:hidden; cursor:pointer"
<img if="mayDelete" class="clickable" style="visibility:hidden"
src=":img('delete')"
onclick=":'openEventPopup(%s, %s, %s, %s, null, null)' % \
(q('del'), q(field.name), q(dayString), q(str(spansDays)))"/>

View file

@ -33,8 +33,7 @@ class List(Field):
widgetName='%s*%d' % (field.name, rowIndex)">:field.pxView</td>
<!-- Icon for removing the row -->
<td if="layoutType=='edit'" align=":dright">
<img style="cursor:pointer" src=":img(delete')"
title=":_('object_delete')"
<img class="clickable" src=":img(delete')" title=":_('object_delete')"
onclick=":'deleteRow(%s, this)' % q('list_%s' % name)"/>
</td>
</tr>''')
@ -48,7 +47,7 @@ class List(Field):
<th for="info in field.fields">::_(info[1].labelId)</th>
<!-- Icon for adding a new row. -->
<th if="isEdit">
<img style="cursor:pointer" src=":img('plus')" title=":_('add_ref')"
<img class="clickable" src=":img('plus')" title=":_('add_ref')"
onclick=":'insertRow(%s)' % q('list_%s' % name)"/>
</th>
</tr>

View file

@ -46,7 +46,7 @@ class Pod(Field):
<img for="fmt in field.getToolInfo(contextObj.appy())[1]" src=":img(fmt)"
onclick=":'generatePodDocument(%s, %s, %s, %s)' % \
(q(contextObj.UID()), q(name), q(fmt), q(ztool.getQueryInfo()))"
title=":fmt.capitalize()" style="cursor:pointer"/>
title=":fmt.capitalize()" class="clickable"/>
</x>''')
pxEdit = pxSearch = ''

View file

@ -61,10 +61,10 @@ class Ref(Field):
ajaxBaseCall=navBaseCall.replace('**v**','%s,%s,{%s:%s,%s:%s}'%\
(q(startNumber), q('ChangeRefOrder'), q('refObjectUid'),
q(obj.UID()), q('move'), q('**v**')))">
<img if="objectIndex &gt; 0" style="cursor:pointer"
src=":img('arrowUp')" title=":_('move_up')"
<img if="objectIndex &gt; 0" class="clickable" src=":img('arrowUp')"
title=":_('move_up')"
onclick=":ajaxBaseCall.replace('**v**', 'up')"/>
<img if="objectIndex &lt; (totalNumber-1)" style="cursor:pointer"
<img if="objectIndex &lt; (totalNumber-1)" class="clickable"
src=":img('arrowDown')" title=":_('move_down')"
onclick=":ajaxBaseCall.replace('**v**', 'down')"/>
</td>
@ -80,13 +80,12 @@ class Ref(Field):
</td>
<!-- Delete -->
<td if="not isBack and field.delete and canWrite and obj.mayDelete()">
<img style="cursor:pointer" title=":_('object_delete')"
<img class="clickable" title=":_('object_delete')"
src=":img('delete')" onclick=":'onDeleteObject(%s)'%q(obj.UID())"/>
</td>
<!-- Unlink -->
<td if="not isBack and field.unlink and canWrite">
<img style="cursor:pointer" title=":_('object_unlink')"
src=":img('unlink')"
<img class="clickable" title=":_('object_unlink')" src=":img('unlink')"
onclick=":'onUnlinkObject(%s,%s,%s)' % (q(contextObj.UID()), \
q(field.name), q(obj.UID()))"/>
</td>
@ -121,9 +120,9 @@ class Ref(Field):
var2="ajaxBaseCall=navBaseCall.replace('**v**', '%s,%s,{%s:%s,%s:%s}'% \
(q(startNumber), q('SortReference'), q('sortKey'), \
q(field.name), q('reverse'), q('**v**')))">
<img style="cursor:pointer" src=":img('sortAsc')"
<img class="clickable" src=":img('sortAsc')"
onclick=":ajaxBaseCall.replace('**v**', 'False')"/>
<img style="cursor:pointer" src=":img('sortDesc')"
<img class="clickable" src=":img('sortDesc')"
onclick=":ajaxBaseCall.replace('**v**', 'True')"/>
</x>''')

View file

@ -50,7 +50,7 @@ img { border: 0; vertical-align: middle }
padding: 6px; border: 1px dashed grey; border-radius: 0.3em }
.xhtml img { margin-right: 5px }
.xhtml p { margin: 3px 0 7px 0 }
.clickable { cursor: pointer }
.main { width: 900px; background-color: white; box-shadow: 3px 3px 3px #A9A9A9;
border-style: solid; border-width: 1px; border-color: grey }
.top { height: 89px; margin-left: 3em; vertical-align: top }

View file

@ -71,7 +71,7 @@ class GroupDescr(Descr):
<x var="expanded=req.get(field.labelId, 'collapsed') == 'expanded'">
<!-- Group name, prefixed by the expand/collapse icon -->
<div class="portletGroup">
<img style="cursor:pointer; margin-right: 3px" align=":dleft"
<img class="clickable" style="margin-right: 3px" align=":dleft"
id=":'%s_img' % field.labelId"
src=":expanded and img('collapse.gif') or img('expand.gif')"
onclick=":'toggleCookie(%s)' % q(field.labelId)"/>
@ -183,8 +183,7 @@ class PhaseDescr(Descr):
lockMsg=_('page_locked', mapping=lockMap)"
src=":img('locked')" title=":lockMsg"/></a>
<a if="editable and locked and user.has_role('Manager')">
<img style="cursor: pointer" title=":_('page_unlock')"
src=":img('unlock')"
<img class="clickable" title=":_('page_unlock')" src=":img('unlock')"
onclick=":'onUnlockPage(%s,%s)' % \
(q(contextObj.UID()), q(aPage))"/></a>
</x>

View file

@ -50,7 +50,7 @@ class ToolWrapper(AbstractWrapper):
href=":obj.getUrl(mode='edit', page=obj.getDefaultEditPage(), \
nav=navInfo)">
<img src=":img('edit')" title=":_('object_edit')"/></a>
<img if="obj.mayDelete()" style="cursor:pointer" src=":img('delete')"
<img if="obj.mayDelete()" class="clickable" src=":img('delete')"
title=":_('object_delete')"
onClick="'onDeleteObject(%s)' % q(obj.UID())"/>
</div>
@ -306,12 +306,12 @@ class ToolWrapper(AbstractWrapper):
<tr>
<th for="columnHeader in importElems[0]">
<img if="loop.columnHeader.nb == 0" src=":img('eye')"
title="_('import_show_hide')" style="cursor:pointer"
title="_('import_show_hide')" class="clickable"
onClick="toggleViewableElements()" align=":dleft" />
<x>:columnHeader</x>
</th>
<th></th>
<th width="20px"><img src=":img('select_elems')" style="cursor:pointer"
<th width="20px"><img src=":img('select_elems')" class="clickable"
title=":_('select_delesect')" onClick="toggleCheckboxes()"/></th>
</tr>
<tr for="row in importElems[1]"

View file

@ -33,8 +33,8 @@ class AbstractWrapper(object):
# Icon for hiding/showing details below the title.
pxShowDetails = Px('''
<img if="ztool.subTitleIsUsed(className) and (field.name == 'title')"
style="cursor:pointer" src=":img('toggleDetails')"
onClick="toggleSubTitles()"/>''')
class="clickable" src=":img('toggleDetails')"
onclick="toggleSubTitles()"/>''')
# Displays up/down arrows in a table header column for sorting a given
# column. Requires variables "sortable", 'filterable' and 'field'.
@ -43,18 +43,18 @@ class AbstractWrapper(object):
<img if="(sortKey != field.name) or (sortOrder == 'desc')"
onclick=":navBaseCall.replace('**v**', '0,%s,%s,%s' % \
(q(field.name), q('asc'), q(filterKey)))"
src=":img('sortDown.gif')" style="cursor:pointer"/>
src=":img('sortDown.gif')" class="clickable"/>
<img if="(sortKey != field.name) or (sortOrder == 'asc')"
onClick=":navBaseCall.replace('**v**', '0,%s,%s,%s' % \
onclick=":navBaseCall.replace('**v**', '0,%s,%s,%s' % \
(q(field.name), q('desc'), q(filterKey)))"
src=":img('sortUp.gif')" style="cursor:pointer"/>
src=":img('sortUp.gif')" class="clickable"/>
</x>
<x if="filterable">
<input type="text" size="7" id=":'%s_%s' % (ajaxHookId, field.name)"
value=":filterKey == field.name and filterValue or ''"/>
<img onClick=":navBaseCall.replace('**v**', '0, %s,%s,%s' % \
<img onclick=":navBaseCall.replace('**v**', '0, %s,%s,%s' % \
(q(sortKey), q(sortOrder), q(field.name)))"
src=":img('funnel')" style="cursor:pointer"/>
src=":img('funnel')" class="clickable"/>
</x></x>''')
# Buttons for navigating among a list of elements: next,back,first,last...
@ -67,13 +67,13 @@ class AbstractWrapper(object):
<tr valign="middle">
<!-- Go to the first page -->
<td if="(startNumber != 0) and (startNumber != batchSize)"><img
style="cursor:pointer" src=":img('arrowLeftDouble')"
class="clickable" src=":img('arrowLeftDouble')"
title=":_('goto_first')"
onClick=":navBaseCall.replace('**v**', '0'+sortAndFilter)"/></td>
<!-- Go to the previous page -->
<td var="sNumber=startNumber - batchSize" if="startNumber != 0"><img
style="cursor:pointer" src=":img('arrowLeftSimple')"
class="clickable" src=":img('arrowLeftSimple')"
title=":_('goto_previous')"
onClick="navBaseCall.replace('**v**', \
str(sNumber)+sortAndFilter)"/></td>
@ -86,7 +86,7 @@ class AbstractWrapper(object):
<!-- Go to the next page -->
<td var="sNumber=startNumber + batchSize"
if="sNumber &lt; totalNumber"><img style="cursor:pointer"
if="sNumber &lt; totalNumber"><img class="clickable"
src=":img('arrowRightSimple')" title=":_('goto_next')"
onClick=":navBaseCall.replace('**v**', \
str(sNumber)+sortAndFilter)"/></td>
@ -98,7 +98,7 @@ class AbstractWrapper(object):
nbOfCompletePages or nbOfCompletePages-1;
sNumber= nbOfCountedPages * batchSize"
if="(startNumber != sNumber) and \
(startNumber != sNumber-batchSize)"><img style="cursor:pointer"
(startNumber != sNumber-batchSize)"><img class="clickable"
src=":img('arrowRightDouble')" title=":_('goto_last')"
onClick="navBaseCall.replace('**v**', \
str(sNumber)+sortAndFilter)"/></td>
@ -293,7 +293,7 @@ class AbstractWrapper(object):
<td><input type="text" size="14" name="w_SearchableText"
class="inputSearch"/></td>
<td>
<input type="image" style="cursor:pointer" src=":img('search.gif')"
<input type="image" class="clickable" src=":img('search.gif')"
title=":_('search_button')"/></td>
</tr>
</table>
@ -324,7 +324,7 @@ class AbstractWrapper(object):
pxMessage = Px('''
<div var="messages=ztool.consumeMessages()" if="messages" class="message">
<!-- The icon for closing the message -->
<img src=":img('close')" align=":dright" style="cursor:pointer"
<img src=":img('close')" align=":dright" class="clickable"
onclick="this.parentNode.style.display='none'"/>
<!-- The message content -->
<x>::messages</x>
@ -446,7 +446,7 @@ class AbstractWrapper(object):
<!-- Connect link if discreet login -->
<a if="isAnon and discreetLogin" id="loginLink" name="loginLink"
onclick="showLoginForm()" class="pageLink"
style="cursor:pointer">:_('app_connect')</a>
class="clickable">:_('app_connect')</a>
<!-- Language selector -->
<select if="ztool.showLanguageSelector()"
@ -587,7 +587,7 @@ class AbstractWrapper(object):
class="odd and 'even' or 'odd'" valign="top">
<td if="isDataChange">
<x>:_('data_change')</x>
<img if="user.has_role('Manager')" style="cursor:pointer"
<img if="user.has_role('Manager')" class="clickable"
src=":img('delete')"
onclick=":'onDeleteEvent(%s,%s)' % \
(q(contextObj.UID()), q(event['time']))"/>
@ -667,7 +667,7 @@ class AbstractWrapper(object):
<td colspan="2" class="by">
<!-- Plus/minus icon for accessing history -->
<x if="hasHistory">
<img style="cursor:pointer" onclick="toggleCookie('appyHistory')"
<img class="clickable" onclick="toggleCookie('appyHistory')"
src="historyExpanded and img('collapse.gif') or img('expand.gif')"
align=":dleft" id="appyHistory_img"/>
<x>:_('object_history')</x> ||